lib/clipboard/mac.rb in clipboard-0.9.4 vs lib/clipboard/mac.rb in clipboard-0.9.5
- old
+ new
@@ -1,11 +1,17 @@
-module Clipboard
+require 'open3'
+
+module Clipboard; end
+
+module Clipboard::Mac
+ extend self
+
def paste(_ = nil)
`pbpaste`
end
def copy(data)
- IO.popen('pbcopy', 'w'){|input| input << data }
+ Open3.popen3( 'pbcopy' ){ |input,_,_| input << data }
paste
end
def clear
copy ''