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

renamed _in_ and _out_ to inp and out, for convenience and ease of use

This commit is contained in:
John Mair 2011-06-08 00:57:01 +12:00
parent b875f1b08c
commit 61daefbf03
2 changed files with 14 additions and 14 deletions

View file

@ -73,8 +73,8 @@ class Pry
end end
end end
# @return [Integer] The maximum amount of objects remembered by the _in_ and # @return [Integer] The maximum amount of objects remembered by the inp and
# _out_ arrays. Defaults to 100. # out arrays. Defaults to 100.
def memory_size def memory_size
@output_array.max_size @output_array.max_size
end end
@ -124,11 +124,11 @@ class Pry
Pry.active_instance = self Pry.active_instance = self
# Make sure special locals exist # Make sure special locals exist
target.eval("_in_ = ::Pry.active_instance.instance_eval { @input_array }") target.eval("inp = ::Pry.active_instance.instance_eval { @input_array }")
target.eval("_out_ = ::Pry.active_instance.instance_eval { @output_array }") target.eval("out = ::Pry.active_instance.instance_eval { @output_array }")
set_active_instance(target) set_active_instance(target)
@input_array << nil # add empty input so _in_ and _out_ match @input_array << nil # add empty input so inp and out match
set_last_result(Pry.last_result, target) set_last_result(Pry.last_result, target)
self.session_target = target self.session_target = target
@ -214,8 +214,8 @@ class Pry
# save the pry instance to active_instance # save the pry instance to active_instance
Pry.active_instance = self Pry.active_instance = self
target.eval("_in_ = ::Pry.active_instance.instance_eval { @input_array }") target.eval("inp = ::Pry.active_instance.instance_eval { @input_array }")
target.eval("_out_ = ::Pry.active_instance.instance_eval { @output_array }") target.eval("out = ::Pry.active_instance.instance_eval { @output_array }")
@last_result_is_exception = false @last_result_is_exception = false
set_active_instance(target) set_active_instance(target)

View file

@ -153,9 +153,9 @@ describe Pry do
res.should == [:foo, 42] res.should == [:foo, 42]
end end
it 'sets _out_ to an array with the result' do it 'sets out to an array with the result' do
res = {} res = {}
input = InputTester.new *[":foo", "42", "self[:res] = _out_"] input = InputTester.new *[":foo", "42", "self[:res] = out"]
pry = Pry.new(:input => input, :output => Pry::NullOutput) pry = Pry.new(:input => input, :output => Pry::NullOutput)
pry.repl(res) pry.repl(res)
@ -163,9 +163,9 @@ describe Pry do
res[:res][1..2].should == [:foo, 42] res[:res][1..2].should == [:foo, 42]
end end
it 'sets _in_ to an array with the entered lines' do it 'sets inp to an array with the entered lines' do
res = {} res = {}
input = InputTester.new *[":foo", "42", "self[:res] = _in_"] input = InputTester.new *[":foo", "42", "self[:res] = inp"]
pry = Pry.new(:input => input, :output => Pry::NullOutput) pry = Pry.new(:input => input, :output => Pry::NullOutput)
pry.repl(res) pry.repl(res)
@ -173,9 +173,9 @@ describe Pry do
res[:res][1..2].should == [":foo\n", "42\n"] res[:res][1..2].should == [":foo\n", "42\n"]
end end
it 'uses 100 as the size of _in_ and _out_' do it 'uses 100 as the size of inp and out' do
res = [] res = []
input = InputTester.new *["self << _out_.max_size << _in_.max_size"] input = InputTester.new *["self << out.max_size << inp.max_size"]
pry = Pry.new(:input => input, :output => Pry::NullOutput) pry = Pry.new(:input => input, :output => Pry::NullOutput)
pry.repl(res) pry.repl(res)
@ -184,7 +184,7 @@ describe Pry do
it 'can change the size of the history arrays' do it 'can change the size of the history arrays' do
res = [] res = []
input = InputTester.new *["self << _out_.max_size << _in_.max_size"] input = InputTester.new *["self << out.max_size << inp.max_size"]
pry = Pry.new(:input => input, :output => Pry::NullOutput, pry = Pry.new(:input => input, :output => Pry::NullOutput,
:memory_size => 1000) :memory_size => 1000)
pry.repl(res) pry.repl(res)