Created
May 10, 2023 15:22
-
-
Save robsimpsondev/42fef741b435579f7c115fece5738e06 to your computer and use it in GitHub Desktop.
Ruby copy to clipboard (macOS)
This file contains hidden or 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
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