Sha256: da0925cd9916e1acee2fc876d3982ed33d0003d5b7f35881b3e8ead802603abd

Contents?: true

Size: 973 Bytes

Versions: 1

Compression:

Stored size: 973 Bytes

Contents

require 'capistrano/dsl/task_enhancements'
require 'capistrano/dsl/paths'
require 'capistrano/dsl/stages'
require 'capistrano/dsl/env'

module Capistrano
  module DSL
    include TaskEnhancements
    include Env
    include Paths
    include Stages

    def invoke(task, *args)
      Rake::Task[task].invoke(*args)
    end

    def t(key, options={})
      I18n.t(key, options.merge(scope: :capistrano))
    end

    def scm
      fetch(:scm)
    end

    def sudo(*args)
      execute :sudo, *args
    end

    def revision_log_message
      fetch(:revision_log_message,
            t(:revision_log_message, branch: fetch(:branch), user: local_user, release: release_timestamp))
    end

    def rollback_log_message
      t(:rollback_log_message, user: local_user, release: release_timestamp)
    end

    def local_user
      `whoami`
    end

    def lock(locked_version)
      VersionValidator.new(locked_version).verify
    end

  end
end
self.extend Capistrano::DSL

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
capistrano-3.0.0.pre14 lib/capistrano/dsl.rb