class Threeman::Frontend

Attributes

options[R]

Public Class Methods

new(options) click to toggle source
# File lib/threeman/frontend.rb, line 7
def initialize(options)
  @options = options
end

Public Instance Methods

bash_script(command) click to toggle source
# File lib/threeman/frontend.rb, line 15
def bash_script(command)
  [
    "echo -ne \"\\033]0;#{Shellwords.escape command.name}\\007\"",
    command.bash_script
  ].join(" ; ")
end
paned_command_names() click to toggle source
# File lib/threeman/frontend.rb, line 26
def paned_command_names
  options[:panes] || []
end
run_commands(commands) click to toggle source
# File lib/threeman/frontend.rb, line 11
def run_commands(commands)
  raise "Subclasses must implement #run_commands"
end
sort_commands(commands) click to toggle source
# File lib/threeman/frontend.rb, line 22
def sort_commands(commands)
  commands.sort_by { |c| paned_command_names.include?(c.name) ? 0 : 1 }
end