6yqm-q
3.963K
· June 2012 ·
F86911c918d9c3eb1644189a50d74ccb

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.

Sign in or sign up to add your response.

4 Responses

2065
890f7065d081f3a735362b6a1ca74b92

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
F86911c918d9c3eb1644189a50d74ccb

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

over 1 year ago ·
3546
901b686e3824cd357b169ac7ce431b1b
4603
97113f00f49fafd72811b5d892bd68a8

This is great!

over 1 year ago ·