bmaland (owner)

Revisions

gist: 124272 Download_button fork
public
Public Clone URL: git://gist.github.com/124272.git
copynpaste.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Copy `n Paste from IRB, based on http://judofyr.net/posts/copy-paste-irb.html
# Requires xclip for clipboard interaction. Stick in .irbrc:
def copy(str)
  IO.popen('xclip -i', 'w') { |f| f << str.to_s }
end
 
def paste
  `xclip -o`
end
 
def ep
  eval(paste)
end