I often copy the last input in a Ruby REPL (Pry or IRB) to the clipboard, so I can paste it into my editor.
Here's how to do that from within the REPL.
Pry:
IO.popen('pbcopy', 'w') { |cb| cb.write(_in_[-1]) } # 'xclip' on Linux
IRB:
IO.popen('pbcopy', 'w') { |cb| cb.write(Reline::HISTORY[-2]) }
about 1 month ago