lib/clipboard/mac.rb in clipboard-1.1.0 vs lib/clipboard/mac.rb in clipboard-1.1.1

- old
+ new

@@ -1,20 +1,20 @@ require 'open3' -module Clipboard; end +module Clipboard + module Mac + extend self -module Clipboard::Mac - extend self + def paste(_ = nil) + `pbpaste` + end - def paste(_ = nil) - `pbpaste` - end + def copy(data) + Open3.popen3( 'pbcopy' ){ |input, _, _| input << data } + paste + end - def copy(data) - Open3.popen3( 'pbcopy' ){ |input,_,_| input << data } - paste - end - - def clear - copy '' + def clear + copy '' + end end end