Class: Termup::Iterm

Inherits:
Base
  • Object
show all
Defined in:
lib/termup/iterm.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Termup::Base

Instance Method Details

#startObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/termup/iterm.rb', line 3

def start
  split_panes if @options['iterm']

  # Setting up tabs
  @tabs.each.with_index do |(tabname, values), index|
    set_property(:name, tabname) # Set tab title

    if advanced_iterm?
      values['commands'].each do |command|
        run(command)
      end

      values['properties'].each do |key, value|
        set_property(key, value)
      end if values['properties']

      values['layout'].each do |command|
        layout command
      end if values['layout']
    else
      values.each do |command|
        run(command)
      end

      layout :goto_next_pane
    end
  end

  super
end