Sha256: e532f91a8b9083fe518d9542c2ca4b1b6e66a27be308dbf4ab57d1b6b0f70cd1

Contents?: true

Size: 293 Bytes

Versions: 6

Compression:

Stored size: 293 Bytes

Contents

module Clipboard; end

module Clipboard::File
  extend self

  FILE = File.expand_path("~/.clipboard")

  def copy(text)
    File.open(FILE, 'w', 0600) { |f| f.write(text) } rescue ''
    paste
  end

  def paste(_ = nil)
    File.read(FILE) rescue ''
  end

  def clear
    copy ''
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
clipboard-1.1.0 lib/clipboard/file.rb
clipboard-1.0.6 lib/clipboard/file.rb
clipboard-1.0.5 lib/clipboard/file.rb
clipboard-1.0.4 lib/clipboard/file.rb
clipboard-1.0.3 lib/clipboard/file.rb
clipboard-1.0.2 lib/clipboard/file.rb