Module: Rush::ExternalCommands

Defined in:
lib/rush/commands.rb

Constant Summary collapse

COMMANDS_TO_ADD =
[:vim, :mate, :kate, :gedit]

Instance Method Summary collapse

Instance Method Details

#add_command(command) ⇒ Object



54
55
56
57
58
59
60
61
# File 'lib/rush/commands.rb', line 54

def add_command(command)
	if system("which #{command} > /dev/null 2>&1")
		define_method(command) do |*args|
			names = entries.map { |f| f.quoted_path }.join(' ')
			system("#{command} #{args.join(' ')} #{names}")
		end
	end
end