Class: Outputter::Outputter
Instance Method Summary collapse
- #_stdout ⇒ Object
- #copy ⇒ Object
-
#initialize(mode, item_list) ⇒ Outputter
constructor
A new instance of Outputter.
Constructor Details
#initialize(mode, item_list) ⇒ Outputter
Returns a new instance of Outputter.
21 22 23 24 25 26 27 28 29 |
# File 'lib/outputter.rb', line 21 def initialize(mode, item_list) raise '' if mode.nil? @ir = Inputreceiver::Inputreceiver.new('stdout') @item_list = item_list send mode end |
Instance Method Details
#_stdout ⇒ Object
46 47 48 |
# File 'lib/outputter.rb', line 46 def _stdout @item_list.to_s end |
#copy ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/outputter.rb', line 31 def copy if IO.respond_to? :popen IO.popen 'xclip -selection c', 'w' do |f| puts _stdout f.print _stdout end; # end else true; require "native" $$.copyTextToClipboard(_stdout) # $$.querySelector("sensibleness") $$.document.querySelector("sensibleness").appendChild($$.document.createTextNode(_stdout)) puts _stdout # .gsub "\n", " " end end |