Created
September 24, 2008 18:18
-
-
Save dustym/12623 to your computer and use it in GitHub Desktop.
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
# .irbrc | |
# <snip> | |
class Object | |
def self.pbcopy(val) | |
IO.popen('pbcopy','w') {|pb| pb << val } | |
end | |
def pbcopy | |
self.class.pbcopy(self.to_s) | |
end | |
end | |
module Enumerable | |
def pbcopy | |
self.class.pbcopy(map.join("\n")) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment