Parent

Included Modules

Files

Class/Module Index [+]

Quicksearch

Capistrano::Shell

The Capistrano::Shell class is the guts of the "shell" task. It implements an interactive REPL interface that users can employ to execute tasks and commands. It makes for a GREAT way to monitor systems, and perform quick maintenance on one or more machines.

Attributes

configuration[R]

The configuration instance employed by this shell

Public Class Methods

new(config) click to toggle source

Instantiate a new shell

# File lib/capistrano/shell.rb, line 33
def initialize(config)
  @configuration = config
end
run(config) click to toggle source

Instantiate a new shell and begin executing it immediately.

# File lib/capistrano/shell.rb, line 28
def self.run(config)
  new(config).run!
end

Public Instance Methods

read_and_execute() click to toggle source
# File lib/capistrano/shell.rb, line 57
def read_and_execute
  command = read_line

  case command
    when "?", "help" then help
    when "quit", "exit" then
      puts "exiting"
      return false
    when /^set -(\w)\s*(\S+)/
      set_option($1, $2)
    when /^(?:(with|on)\s*(\S+))?\s*(\S.*)?/
      process_command($1, $2, $3)
    else
      raise "eh?"
  end

  return true
end
run!() click to toggle source

Start the shell running. This method will block until the shell terminates.

# File lib/capistrano/shell.rb, line 39
def run!
  setup

  puts ====================================================================Welcome to the interactive Capistrano shell! This is an experimentalfeature, and is liable to change in future releases. Type 'help' fora summary of how to use the shell.--------------------------------------------------------------------

  loop do
    break if !read_and_execute
  end

  @bgthread.kill
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.