From 9d5a1415accdc8c0b745bce677defb9d1fbacfc5 Mon Sep 17 00:00:00 2001 From: Shannon Skipper Date: Sun, 24 Nov 2013 15:16:28 -0800 Subject: [PATCH] Rollback untoward mutations. --- lib/pry/cli.rb | 2 +- lib/pry/commands/amend_line.rb | 2 +- lib/pry/commands/find_method.rb | 2 +- lib/pry/indent.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pry/cli.rb b/lib/pry/cli.rb index 55f77d4a..e81bbdbc 100644 --- a/lib/pry/cli.rb +++ b/lib/pry/cli.rb @@ -114,7 +114,7 @@ Copyright (c) 2013 John Mair (banisterfiend) -- } on :e, :exec=, "A line of code to execute in context before the session starts" do |input| - exec_string << input << "\n" + exec_string + input + "\n" end on "no-pager", "Disable pager for long output" do diff --git a/lib/pry/commands/amend_line.rb b/lib/pry/commands/amend_line.rb index 838d5c85..d30c9a0f 100644 --- a/lib/pry/commands/amend_line.rb +++ b/lib/pry/commands/amend_line.rb @@ -52,7 +52,7 @@ class Pry end def replace_in_array(array, range) - array[range] = arg_string << "\n" + array[range] = arg_string + "\n" end # @return [Fixnum] The number of lines currently in `eval_string` (the input buffer). diff --git a/lib/pry/commands/find_method.rb b/lib/pry/commands/find_method.rb index 3e61c351..a6d024e7 100644 --- a/lib/pry/commands/find_method.rb +++ b/lib/pry/commands/find_method.rb @@ -97,7 +97,7 @@ class Pry output.puts text.bold(klass.name) grouped[klass].each do |method| header = method.name_with_owner - output.puts header << additional_info(header, method) + output.puts header + additional_info(header, method) end end diff --git a/lib/pry/indent.rb b/lib/pry/indent.rb index 848454a4..12e476df 100644 --- a/lib/pry/indent.rb +++ b/lib/pry/indent.rb @@ -156,7 +156,7 @@ class Pry before.times{ prefix.sub! SPACES, '' } new_prefix = prefix + SPACES * after - line = prefix << line.lstrip unless previously_in_string + line = prefix + line.lstrip unless previously_in_string output += line