Skip to content

Instantly share code, notes, and snippets.

@dustym
Created September 24, 2008 18:18
Show Gist options
  • Save dustym/12623 to your computer and use it in GitHub Desktop.
Save dustym/12623 to your computer and use it in GitHub Desktop.
# .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