Created
May 18, 2013 02:00
-
-
Save localredhead/5602959 to your computer and use it in GitHub Desktop.
pbcopy for irb sessions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IRB.conf[:PROMPT_MODE] = :DEFAULT | |
def pbcopy(input) | |
str = input.to_s | |
IO.popen('pbcopy', 'w') { |f| f << str } | |
str | |
end | |
def pbpaste | |
`pbpaste` | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment