6yqm-q
Last Updated: February 25, 2016
·
4.07K
· 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

2065

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 ·
2128

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

over 1 year ago ·
3546
4603

This is great!

over 1 year ago ·