Class: GnomeTerminal

Inherits:
Object
  • Object
show all
Defined in:
lib/hilfer/gnome_terminal.rb

Overview

Knows how to lauch gnome-terminal with mutiple tabs, each opened on a different directory

Instance Method Summary collapse

Instance Method Details

#launch(dirs) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/hilfer/gnome_terminal.rb', line 11

def launch( dirs )
  # construct arguments and launch
  args = [ "gnome-terminal" ]
  dirs.uniq.each do |x|
    # first one will be a window, subsequent ones are tabs
    args << ( args.size == 1 ? '--window' : '--tab' )
    args << "--working-directory=#{x}"
  end
  system( *args )
end