1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Don't pass target to run_command either

This commit is contained in:
Conrad Irwin 2012-12-18 00:26:51 -08:00
parent 432e07732e
commit 8a434a747d
3 changed files with 3 additions and 13 deletions

View file

@ -10,7 +10,7 @@ class Pry
# The default hooks - display messages when beginning and ending Pry sessions.
DEFAULT_HOOKS = Pry::Hooks.new.add_hook(:before_session, :default) do |out, target, _pry_|
next if _pry_.quiet?
_pry_.run_command("whereami --quiet", "", target)
_pry_.run_command("whereami --quiet")
end
# The default print

View file

@ -205,7 +205,6 @@ class Pry
end
# Initialize the repl session.
# @param [Binding] target The target binding for the session.
def repl_prologue
exec_hook :before_session, output, current_binding, self
set_last_result nil
@ -214,7 +213,6 @@ class Pry
end
# Clean-up after the repl session.
# @param [Binding] target The target binding for the session.
def repl_epilogue
exec_hook :after_session, output, current_binding, self
@ -450,14 +448,13 @@ class Pry
# Run the specified command.
# @param [String] val The command (and its params) to execute.
# @param [String] eval_string The current input buffer.
# @param [Binding] target The binding to use..
# @return [Pry::Command::VOID_VALUE]
# @example
# pry_instance.run_command("ls -m")
def run_command(val, eval_string = "", target = binding_stack.last)
def run_command(val, eval_string = "")
commands.process_line(val,
:eval_string => eval_string,
:target => target,
:target => current_binding,
:pry_instance => self,
:output => output
)

View file

@ -215,13 +215,6 @@ describe "commands" do
end
describe "Pry#run_command" do
it 'should run a command in a specified context' do
b = Pry.binding_for(7)
p = Pry.new(:output => @str_output)
p.run_command("ls -m", "", b)
p.output.string.should =~ /divmod/
end
it 'should run a command that modifies the passed in eval_string' do
p = Pry.new(:output => @str_output)
p.push_binding 7