Module: Irbtab

Extended by:
Irbtab
Included in:
Irbtab
Defined in:
lib/irbtab.rb

Constant Summary collapse

Version =
'0.0.9'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.versionObject



14
# File 'lib/irbtab.rb', line 14

def Irbtab.version() Irbtab::Version end

Instance Method Details

#copy(args) ⇒ Object

Raises:

  • (ArgumentError)


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