Skip to content

Instantly share code, notes, and snippets.

@chrisbodhi
Created September 21, 2016 14:25
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save chrisbodhi/ba69a83e0112fd5ff7c962004820e8ad to your computer and use it in GitHub Desktop.
Save chrisbodhi/ba69a83e0112fd5ff7c962004820e8ad to your computer and use it in GitHub Desktop.
Copy from IRB/Pry to the system clipboard
# 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