Module: Sesh

Defined in:
lib/sesh/tmux_control.rb,
lib/sesh.rb,
lib/sesh/cli.rb,
lib/sesh/logger.rb,
lib/sesh/version.rb,
lib/sesh/inferences.rb,
lib/sesh/ssh_control.rb

Overview

require ‘yaml’

Defined Under Namespace

Modules: Inferences Classes: Cli, Logger, SshControl, TmuxControl

Constant Summary collapse

HELP_BANNER =
"Sesh: remote background sessions powered by tmux and tmuxinator.\nRuns a headless tmuxinator session for remote slave machines to connect to.\n\nUsage: \#{File.basename $0} command [project]\n\nCommands:\n\nsesh new                           Create a new tmuxinator configuration.\nsesh edit    [project]             Edit an existing tmuxinator configuration.\nsesh start   [project]             Start a Sesh session for a project.\nsesh stop    [project]             Stop a Sesh session for a project.\nsesh list                          List running Sesh sessions on this machine.\nsesh enslave [project] user@host   Connect a slave to a local Sesh session.\nsesh connect [project] [user@host] Connect as a slave to a Sesh session.\nsesh run     [location] [command]  Run a shell command in the specified location.\nsesh rspec   [location] [spec]     Run a spec in the specified location.\n\nLeave project blank to use the name of your current directory.\n\n"
DEFAULT_OPTIONS =
{
  project: nil,
  template: nil,
  shell: {
    command: nil,
    pane: nil,
    spec: nil,
    rspec_prefix: nil,
    and_return: false
  },
  ssh: {
    local_addr: nil,
    remote_addr: nil,
    connect_in_new_window: false,
    connect_fullscreen: false
  },
  tmux: { socket_file: nil }
}
POSSIBLE_CONFIG_LOCATIONS =
%w( sesh_config.yml config/sesh.yml )
VERSION =
'0.4.1'

Class Method Summary collapse

Class Method Details

.format_and_run_command(command) ⇒ Object



52
# File 'lib/sesh.rb', line 52

def self.format_and_run_command(command) `#{format_command(command)}`.strip end

.format_command(command) ⇒ Object



51
# File 'lib/sesh.rb', line 51

def self.format_command(command) command.gsub(/\ [ ]+/, ' ').strip end