Module: PbcopyRuby
- Included in:
- Object
- Defined in:
- lib/pbcopy-ruby.rb,
lib/pbcopy-ruby/version.rb
Overview
Provides a global function to copy text to the system clipboard
Defined Under Namespace
Classes: Error
Constant Summary collapse
- VERSION =
"0.1.0"
Instance Method Summary collapse
-
#pbcopy(text) ⇒ String
Copy the given text to the system clipboard using pbcopy.
Instance Method Details
#pbcopy(text) ⇒ String
Copy the given text to the system clipboard using pbcopy
13 14 15 16 |
# File 'lib/pbcopy-ruby.rb', line 13 def pbcopy(text) IO.popen("pbcopy", "w") { |io| io.write(text.to_s) } text end |