Where developers come to connect, share, build and be inspired.

0

irb time saver

3827 views


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.

Comments

Add a comment