Last Updated: September 09, 2019
· tiegz

irb time saver

add to ~/.irbrc:

def copy(*args) IO.popen('pbcopy', 'r+') { |clipboard| clipboard.puts }; end

and then in irb:

copy [1,2,3,4]

"[1, 2, 3, 4]" is now in your clipboard.

4 Responses
Add your response

Pry has something like this built-in, but slightly more comprehensive, let me know what you think:

over 1 year ago ·

thx @banister! I haven't tried it out yet, but I might give it a shot now

over 1 year ago ·

This is great!

over 1 year ago ·