Created
September 21, 2016 14:25
-
-
Save chrisbodhi/ba69a83e0112fd5ff7c962004820e8ad to your computer and use it in GitHub Desktop.
Copy from IRB/Pry to the system clipboard
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
# https://coderwall.com/p/qp2aha/ruby-pbcopy-and-pbpaste | |
def pbcopy(input) | |
str = input.to_s | |
IO.popen('pbcopy', 'w') { |f| f << str } | |
str | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment