From b64bb6021d1c375093246f3b85951315bb17580b Mon Sep 17 00:00:00 2001 From: John Mair Date: Mon, 11 Apr 2011 19:38:04 +1200 Subject: [PATCH] changed Pry.run_command so it works on both rbx (using Object#clone) and YARV 1.9 (using Object#dup). Both implementations have bugs. --- lib/pry/pry_class.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/pry/pry_class.rb b/lib/pry/pry_class.rb index da0e2bc4..fcbf53a7 100644 --- a/lib/pry/pry_class.rb +++ b/lib/pry/pry_class.rb @@ -179,7 +179,13 @@ class Pry null_output = Object.new.tap { |v| v.instance_eval { def puts(*) end } } - commands = options[:commands].dup + # FIXME! ugly hack to get around broken methods in both YARD and RBX + if RUBY_VERSION =~ /1.9/ + commands = options[:commands].dup + else + commands = options[:commands].clone + end + commands.output = options[:show_output] ? options[:output] : null_output commands.target = Pry.binding_for(options[:context])