Parent

Teamocil::Layout

This class act as a wrapper around a tmux YAML layout file

Attributes

session[R]

Public Class Methods

new(layout, options={}) click to toggle source

Initialize a new layout from a hash

@param layout [Hash] the parsed layout @param options [Hash] some options

# File lib/teamocil/layout.rb, line 15
def initialize(layout, options={}) # {{{
  @layout = layout
  @options = options
end

Public Instance Methods

compile!() click to toggle source

Compile the layout into objects

@return [Session]

# File lib/teamocil/layout.rb, line 30
def compile! # {{{
  if @layout["session"].nil?
    @session = Session.new @options, "windows" => @layout["windows"]
  else
    @session = Session.new @options, @layout["session"]
  end
end
execute_commands(commands) click to toggle source

Execute each command in the shell

@param commands [Array] an array of complete commands to send to the shell

# File lib/teamocil/layout.rb, line 41
def execute_commands(commands) # {{{
  `#{commands.join("; ")}`
end
generate_commands() click to toggle source

Generate tmux commands based on the data found in the layout file

@return [Array] an array of shell commands to send

# File lib/teamocil/layout.rb, line 23
def generate_commands # {{{
  @session.generate_commands
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.