Module: Capistrano::TaskEnhancements

### Home Classes Methods

### In Files

- lib/capistrano/dsl/task_enhancements.rb

### Methods

- #after
- #before
- #default_tasks
- #define_remote_file_task
- #deploying?
- #ensure_stage
- #exit_deploy_because_of_exception
- #remote_file
- #tasks_without_stage_dependency

### 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::TaskEnhancements

### Public Instance Methods

after(task, post_task, *args, &block) click to toggle source

    # File lib/capistrano/dsl/task_enhancements.rb, line 10
    def after(task, post_task, *args, &block)
      Rake::Task.define_task(post_task, *args, &block) if block_given?
      post_task = Rake::Task[post_task]
      Rake::Task[task].enhance do
        post_task.invoke
      end
    end

before(task, prerequisite, *args, &block) click to toggle source

    # File lib/capistrano/dsl/task_enhancements.rb, line 5
    def before(task, prerequisite, *args, &block)
      prerequisite = Rake::Task.define_task(prerequisite, *args, &block) if block_given?
      Rake::Task[task].enhance [prerequisite]
    end

default_tasks() click to toggle source

    # File lib/capistrano/dsl/task_enhancements.rb, line 51
    def default_tasks
      %{install}
    end

define_remote_file_task(task, target_roles) click to toggle source

    # File lib/capistrano/dsl/task_enhancements.rb, line 23
    def define_remote_file_task(task, target_roles)
      Capistrano::UploadTask.define_task(task) do |t|
        prerequisite_file = t.prerequisites.first
        file = shared_path.join(t.name)

        on roles(target_roles) do
          unless test "[ -f #{file.to_s.shellescape} ]"
            info "Uploading #{prerequisite_file} to #{file}"
            upload! File.open(prerequisite_file), file
          end
        end

      end
    end

deploying?() click to toggle source

    # File lib/capistrano/dsl/task_enhancements.rb, line 61
    def deploying?
      fetch(:deploying, false)
    end

ensure_stage() click to toggle source

    # File lib/capistrano/dsl/task_enhancements.rb, line 38
    def ensure_stage
      Rake::Task.define_task(:ensure_stage) do
        unless stage_set?
          puts t(:stage_not_set)
          exit 1
        end
      end
    end

exit_deploy_because_of_exception(ex) click to toggle source

    # File lib/capistrano/dsl/task_enhancements.rb, line 55
    def exit_deploy_because_of_exception(ex)
      warn t(:deploy_failed, ex: ex.message)
      invoke 'deploy:failed'
      exit(false)
    end

remote_file(task) click to toggle source

    # File lib/capistrano/dsl/task_enhancements.rb, line 18
    def remote_file(task)
      target_roles = task.delete(:roles) { :all }
      define_remote_file_task(task, target_roles)
    end

tasks_without_stage_dependency() click to toggle source

    # File lib/capistrano/dsl/task_enhancements.rb, line 47
    def tasks_without_stage_dependency
      stages + default_tasks
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.