Source

dotfiles / .irbrc

Full commit
# Written by Magnus Holm: http://timelessrepo.com/copy-paste

# Evaluate the code on the clipboard.
def ep
  IRB.CurrentContext.workspace.evaluate(self, paste)
end

# http://gist.github.com/124272
# Thanks to Bjørn Arild Mæland
def copy(str)
  IO.popen('xclip -i', 'w') { |f| f << str.to_s }
end

def paste
  `xclip -o`
end