Created
April 10, 2019 16:22
-
-
Save laginha87/6ec1688186ddd416ab82543fa2c7fb7f to your computer and use it in GitHub Desktop.
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 copy(text) | |
IO.popen('pbcopy', 'w') {|f| f << text} | |
end | |
class Array | |
def to_c | |
copy map(&:to_s).join("\n") | |
end | |
end | |
class String | |
def to_c | |
copy self | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment