From 61daefbf034ace553370499870e3c85c7fd8cbc7 Mon Sep 17 00:00:00 2001 From: John Mair Date: Wed, 8 Jun 2011 00:57:01 +1200 Subject: [PATCH] renamed _in_ and _out_ to inp and out, for convenience and ease of use --- lib/pry/pry_instance.rb | 14 +++++++------- test/test_pry.rb | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/pry/pry_instance.rb b/lib/pry/pry_instance.rb index d69a8bd6..275ea094 100644 --- a/lib/pry/pry_instance.rb +++ b/lib/pry/pry_instance.rb @@ -73,8 +73,8 @@ class Pry end end - # @return [Integer] The maximum amount of objects remembered by the _in_ and - # _out_ arrays. Defaults to 100. + # @return [Integer] The maximum amount of objects remembered by the inp and + # out arrays. Defaults to 100. def memory_size @output_array.max_size end @@ -124,11 +124,11 @@ class Pry Pry.active_instance = self # Make sure special locals exist - target.eval("_in_ = ::Pry.active_instance.instance_eval { @input_array }") - target.eval("_out_ = ::Pry.active_instance.instance_eval { @output_array }") + target.eval("inp = ::Pry.active_instance.instance_eval { @input_array }") + target.eval("out = ::Pry.active_instance.instance_eval { @output_array }") 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) self.session_target = target @@ -214,8 +214,8 @@ class Pry # save the pry instance to active_instance Pry.active_instance = self - target.eval("_in_ = ::Pry.active_instance.instance_eval { @input_array }") - target.eval("_out_ = ::Pry.active_instance.instance_eval { @output_array }") + target.eval("inp = ::Pry.active_instance.instance_eval { @input_array }") + target.eval("out = ::Pry.active_instance.instance_eval { @output_array }") @last_result_is_exception = false set_active_instance(target) diff --git a/test/test_pry.rb b/test/test_pry.rb index e4f0e740..efb8bea1 100644 --- a/test/test_pry.rb +++ b/test/test_pry.rb @@ -153,9 +153,9 @@ describe Pry do res.should == [:foo, 42] end - it 'sets _out_ to an array with the result' do + it 'sets out to an array with the result' do 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.repl(res) @@ -163,9 +163,9 @@ describe Pry do res[:res][1..2].should == [:foo, 42] end - it 'sets _in_ to an array with the entered lines' do + it 'sets inp to an array with the entered lines' do 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.repl(res) @@ -173,9 +173,9 @@ describe Pry do res[:res][1..2].should == [":foo\n", "42\n"] end - it 'uses 100 as the size of _in_ and _out_' do + it 'uses 100 as the size of inp and out' do 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.repl(res) @@ -184,7 +184,7 @@ describe Pry do it 'can change the size of the history arrays' do 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, :memory_size => 1000) pry.repl(res)