Now using command processor to run system commands

This commit is contained in:
Mon ouïe 2011-04-29 18:14:48 +02:00
parent 8351b9a20d
commit b8cd918983
2 changed files with 5 additions and 4 deletions

View File

@ -6,14 +6,13 @@ class Pry
attr_accessor :target
attr_accessor :opts
attr_accessor :command_set
attr_accessor :command_processor
def run(name, *args)
if name.start_with? "."
cmd = name[1..-1]
unless system("#{cmd} #{args.join(' ')}")
output.puts "Error: there was a problem executing system command: #{cmd}"
end
command_processor.execute_system_command(Shellwords.join([name] + args),
target)
else
command_set.run_command(self, name, *args)
end

View File

@ -148,6 +148,8 @@ class Pry
context.output = output
context.command_set = commands
context.command_processor = self
ret = commands.run_command(context, command, *args)
# Tick, tock, im getting rid of this shit soon.