Module: Irbtab
Constant Summary collapse
- Version =
'0.0.9'
Class Method Summary collapse
Instance Method Summary collapse
- #copy(args) ⇒ Object
- #irbt(*args) ⇒ Object (also: #irbtab)
- #paste(*args) ⇒ Object
Class Method Details
Instance Method Details
#copy(args) ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/irbtab.rb', line 35 def copy(args) raise ArgumentError.new("Two dimentional array required") unless args.first.kind_of?(Array) stdin = CSV.generate({:col_sep => "\t"}) do |csv| args.each { |i| csv << i } end systemu(Copy, :stdin => stdin) stdin end |
#irbt(*args) ⇒ Object Also known as: irbtab
50 51 52 |
# File 'lib/irbtab.rb', line 50 def irbt(*args) args.size==0 ? paste(*args) : copy(*args) end |
#paste(*args) ⇒ Object
44 45 46 47 48 |
# File 'lib/irbtab.rb', line 44 def paste(*args) stdout = '' systemu(Paste, :stdout => stdout) CSV.parse(stdout, { :col_sep => "\t" }) end |