Module: Clipboard::File
Constant Summary collapse
- FILE =
::File.("~/.clipboard")
Instance Method Summary collapse
Instance Method Details
#clear ⇒ Object
18 19 20 |
# File 'lib/clipboard/file.rb', line 18 def clear copy '' end |
#copy(text) ⇒ Object
9 10 11 12 |
# File 'lib/clipboard/file.rb', line 9 def copy(text) ::File.open(FILE, 'w', 0o0600) { |f| f.write(text) } rescue '' paste end |
#paste(_ = nil) ⇒ Object
14 15 16 |
# File 'lib/clipboard/file.rb', line 14 def paste(_ = nil) ::File.read(FILE) rescue '' end |