Commits

Tobias Langhoff committed 5e7ec95

irb

Comments (0)

Files changed (1)

+# 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