mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
now passing output object and pry instance into Pry.config.system proc
This commit is contained in:
parent
b8af3ce006
commit
8f6878e0e3
3 changed files with 4 additions and 3 deletions
|
@ -114,7 +114,7 @@ class Pry
|
|||
end,
|
||||
]
|
||||
|
||||
DEFAULT_SYSTEM = proc do |cmd|
|
||||
DEFAULT_SYSTEM = proc do |output, cmd, _|
|
||||
if !system(cmd)
|
||||
output.puts "Error: there was a problem executing system command: #{cmd}"
|
||||
end
|
||||
|
|
|
@ -120,7 +120,8 @@ class Pry
|
|||
attr_accessor :control_d_handler
|
||||
|
||||
# @return [Proc] The proc that runs system commands
|
||||
# The proc is passed the command string to eval
|
||||
# The proc is passed the pry output object, the command string
|
||||
# to eval, and a reference to the pry instance
|
||||
attr_accessor :system
|
||||
end
|
||||
end
|
||||
|
|
|
@ -12,7 +12,7 @@ class Pry
|
|||
output.puts "No such directory: #{dest}"
|
||||
end
|
||||
else
|
||||
Pry.config.system.call(cmd)
|
||||
Pry.config.system.call(output, cmd, _pry_)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue