Class: Threeman::Frontends::Tmux

Inherits:
Threeman::Frontend show all
Defined in:
lib/threeman/frontends/tmux.rb

Instance Attribute Summary collapse

Attributes inherited from Threeman::Frontend

#options

Instance Method Summary collapse

Methods inherited from Threeman::Frontend

#bash_script, #paned_command_names, #sort_commands

Constructor Details

#initialize(options) ⇒ Tmux

Returns a new instance of Tmux.



8
9
10
11
# File 'lib/threeman/frontends/tmux.rb', line 8

def initialize(options)
  @session = "threeman_#{Time.now.to_i}"
  super
end

Instance Attribute Details

#sessionObject (readonly)

Returns the value of attribute session.



6
7
8
# File 'lib/threeman/frontends/tmux.rb', line 6

def session
  @session
end

Instance Method Details

#run_commands(commands) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/threeman/frontends/tmux.rb', line 13

def run_commands(commands)
  sort_commands(commands).each_with_index do |command, index|
    run_command(command, index)
  end

  system "tmux attach-session -t #{session}"
end