Class: Capistrano::Application

### Home Classes Methods

### In Files

- lib/capistrano/application.rb

### Parent

Rake::Application

### Methods

- ::new
- #display_error_message
- #exit_because_of_exception
- #handle_options
- #name
- #run
- #sort_options
- #top_level_tasks

### Files

- Capfile
- Capfile

### Class/Module Index

Quicksearch

- Capistrano
- Capistrano::Application
- Capistrano::Configuration
- Capistrano::Configuration::Filter
- Capistrano::Configuration::Question
- Capistrano::Configuration::Server
- Capistrano::Configuration::Server::Properties
- Capistrano::Configuration::Servers
- Capistrano::DSL
- Capistrano::DSL::Env
- Capistrano::DSL::Paths
- Capistrano::DSL::Stages
- Capistrano::Git
- Capistrano::Git::DefaultStrategy
- Capistrano::Hg
- Capistrano::Hg::DefaultStrategy
- Capistrano::SCM
- Capistrano::Svn
- Capistrano::Svn::DefaultStrategy
- Capistrano::TaskEnhancements
- Capistrano::UploadTask
- Capistrano::VersionValidator
- Object

No matching classes.

# Capistrano::Application

### Public Class Methods

new() click to toggle source

    # File lib/capistrano/application.rb, line 4
    def initialize
      super
      @rakefiles = %{capfile Capfile capfile.rb Capfile.rb} << capfile
    end

### Public Instance Methods

display_error_message(ex) click to toggle source

    # File lib/capistrano/application.rb, line 64
    def display_error_message(ex)
      unless options.backtrace
        if loc = Rake.application.find_rakefile_location
          whitelist = (@imported.dup << loc[0]).map{|f| File.absolute_path(f, loc[1])}
          pattern = %^(?!#{whitelist.map{|p| Regexp.quote(p)}.join('|')})@
          Rake.application.options.suppress_backtrace_pattern = pattern
        end
        trace "(Backtrace restricted to imported tasks)"
      end
      super
    end

exit_because_of_exception(ex) click to toggle source

    # File lib/capistrano/application.rb, line 76
    def exit_because_of_exception(ex)
      if respond_to?(:deploying?) && deploying?
        exit_deploy_because_of_exception(ex)
      else
        super
      end
    end

handle_options() click to toggle source

    # File lib/capistrano/application.rb, line 27
    def handle_options
      options.rakelib = ['rakelib']
      options.trace_output = $stderr

      OptionParser.new do |opts|
        opts.banner = "See full documentation at http://capistranorb.com/."
        opts.separator ""
        opts.separator "Install capistrano in a project:"
        opts.separator "    bundle exec cap install [STAGES=qa,staging,production,...]"
        opts.separator ""
        opts.separator "Show available tasks:"
        opts.separator "    bundle exec cap -T"
        opts.separator ""
        opts.separator "Invoke (or simulate invoking) a task:"
        opts.separator "    bundle exec cap [--dry-run] STAGE TASK"
        opts.separator ""
        opts.separator "Advanced options:"

        opts.on_tail("-h", "--help", "-H", "Display this help message.") do
          puts opts
          exit
        end

        standard_rake_options.each { |args| opts.on(*args) }
        opts.environment('RAKEOPT')
      end.parse!
    end

name() click to toggle source

    # File lib/capistrano/application.rb, line 9
    def name
      "cap"
    end

run() click to toggle source

    # File lib/capistrano/application.rb, line 13
    def run
      Rake.application = self
      super
    end

sort_options(options) click to toggle source

    # File lib/capistrano/application.rb, line 18
    def sort_options(options)
      not_applicable_to_capistrano = %(quiet silent verbose)
      options.reject! do |(switch, *)|
        switch =~ /--#{Regexp.union(not_applicable_to_capistrano)}/
      end

      super.push(version, dry_run, roles, hostfilter)
    end

top_level_tasks() click to toggle source

    # File lib/capistrano/application.rb, line 56
    def top_level_tasks
      if tasks_without_stage_dependency.include?(@top_level_tasks.first)
        @top_level_tasks
      else
        @top_level_tasks.unshift(ensure_stage.to_s)
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.