Module: Capistrano::DSL

Includes:
Env, Paths, Stages, TaskEnhancements
Defined in:
lib/capistrano/dsl.rb,
lib/capistrano/dsl/env.rb,
lib/capistrano/dsl/paths.rb,
lib/capistrano/dsl/stages.rb

Defined Under Namespace

Modules: Env, Paths, Stages

Instance Method Summary collapse

Methods included from Stages

#stage_set?, #stages

Methods included from Paths

#asset_timestamp, #current_path, #deploy_path, #deploy_to, #join_paths, #linked_dir_parents, #linked_dirs, #linked_file_dirs, #linked_files, #map_dirnames, #now, #release_path, #releases_path, #repo_path, #repo_url, #revision_log, #set_release_path, #shared_path

Methods included from Env

#any?, #ask, #asset_timestamp, #configure_backend, #delete, #env, #fetch, #primary, #release_timestamp, #role, #roles, #server, #set

Methods included from TaskEnhancements

#after, #before, #default_tasks, #define_remote_file_task, #ensure_stage, #remote_file, #tasks_without_stage_dependency

Instance Method Details

#invoke(task, *args) ⇒ Object



13
14
15
# File 'lib/capistrano/dsl.rb', line 13

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

#local_userObject



38
39
40
# File 'lib/capistrano/dsl.rb', line 38

def local_user
  `whoami`
end

#lock(locked_version) ⇒ Object



42
43
44
# File 'lib/capistrano/dsl.rb', line 42

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

#revision_log_messageObject



29
30
31
32
# File 'lib/capistrano/dsl.rb', line 29

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

#rollback_log_messageObject



34
35
36
# File 'lib/capistrano/dsl.rb', line 34

def rollback_log_message
  t(:rollback_log_message, user: local_user, release: fetch(:rollback_timestamp))
end

#scmObject



21
22
23
# File 'lib/capistrano/dsl.rb', line 21

def scm
  fetch(:scm)
end

#sudo(*args) ⇒ Object



25
26
27
# File 'lib/capistrano/dsl.rb', line 25

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

#t(key, options = {}) ⇒ Object



17
18
19
# File 'lib/capistrano/dsl.rb', line 17

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