From 3e69b03dc185e85e9c02cc360bc9cde7929be67d Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 6 Jul 2009 17:51:46 +0200 Subject: allow to set a preferred application at runcontexts --- code/runcontext.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'code') diff --git a/code/runcontext.rb b/code/runcontext.rb index d3a0b9d1..df9f3a81 100644 --- a/code/runcontext.rb +++ b/code/runcontext.rb @@ -33,21 +33,21 @@ class RunContext end ## }}} - def initialize(files, mode=0, flags='') + def initialize(files, mode=nil, flags=nil, preferred_app=nil) @mode = mode.to_i if files.is_a? Array @files = files.dup else @files = [files.dup] end - self.flags = flags + self.flags = flags || '' @files.reject! {|file| file.handler == nil or !file.exists? } @handlers = @files.map {|file| file.handler} @paths = @files.map {|file| file.path} - @handler = @handlers.first + @handler = preferred_app || @handlers.first @multi = (@files.size > 1 and @handlers.uniq.size == 1) -- cgit 1.4.1-2-gfad0