Last Updated: September 09, 2019
·
4.26K
· tiegz

irb time saver

add to ~/.irbrc:

def copy(*args) IO.popen('pbcopy', 'r+') { |clipboard| clipboard.puts args.map(&:inspect) }; 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:

http://showterm.io/a4215515770b517dba13c

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 ·