changed Pry.run_command so it works on both rbx (using Object#clone)

and YARV 1.9 (using Object#dup).

Both implementations have bugs.
This commit is contained in:
John Mair 2011-04-11 19:38:04 +12:00
parent d95e787dac
commit b64bb6021d
1 changed files with 7 additions and 1 deletions

View File

@ -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])