Module: Capistrano::DSL::Paths
- Included in:
- Capistrano::DSL
- Defined in:
- lib/capistrano/dsl/paths.rb
Instance Method Summary collapse
- #asset_timestamp ⇒ Object
- #current_path ⇒ Object
- #deploy_config_path ⇒ Object
- #deploy_path ⇒ Object
- #deploy_to ⇒ Object
- #join_paths(parent, paths) ⇒ Object
- #linked_dir_parents(parent) ⇒ Object
- #linked_dirs(parent) ⇒ Object
- #linked_file_dirs(parent) ⇒ Object
- #linked_files(parent) ⇒ Object
- #map_dirnames(paths) ⇒ Object
- #now ⇒ Object
- #release_path ⇒ Object
- #releases_path ⇒ Object
- #repo_path ⇒ Object
- #repo_url ⇒ Object
- #revision_log ⇒ Object
- #set_release_path(timestamp = now) ⇒ Object
- #shared_path ⇒ Object
- #stage_config_path ⇒ Object
Instance Method Details
#asset_timestamp ⇒ Object
58 59 60 |
# File 'lib/capistrano/dsl/paths.rb', line 58 def env..strftime("%Y%m%d%H%M.%S") end |
#current_path ⇒ Object
13 14 15 |
# File 'lib/capistrano/dsl/paths.rb', line 13 def current_path deploy_path.join(fetch(:current_directory, "current")) end |
#deploy_config_path ⇒ Object
34 35 36 |
# File 'lib/capistrano/dsl/paths.rb', line 34 def deploy_config_path Pathname.new fetch(:deploy_config_path, "config/deploy.rb") end |
#deploy_path ⇒ Object
9 10 11 |
# File 'lib/capistrano/dsl/paths.rb', line 9 def deploy_path Pathname.new(deploy_to) end |
#deploy_to ⇒ Object
5 6 7 |
# File 'lib/capistrano/dsl/paths.rb', line 5 def deploy_to fetch(:deploy_to) end |
#join_paths(parent, paths) ⇒ Object
80 81 82 |
# File 'lib/capistrano/dsl/paths.rb', line 80 def join_paths(parent, paths) paths.map { |path| parent.join(path) } end |
#linked_dir_parents(parent) ⇒ Object
76 77 78 |
# File 'lib/capistrano/dsl/paths.rb', line 76 def linked_dir_parents(parent) map_dirnames(linked_dirs(parent)) end |
#linked_dirs(parent) ⇒ Object
62 63 64 65 |
# File 'lib/capistrano/dsl/paths.rb', line 62 def linked_dirs(parent) paths = fetch(:linked_dirs) join_paths(parent, paths) end |
#linked_file_dirs(parent) ⇒ Object
72 73 74 |
# File 'lib/capistrano/dsl/paths.rb', line 72 def linked_file_dirs(parent) map_dirnames(linked_files(parent)) end |
#linked_files(parent) ⇒ Object
67 68 69 70 |
# File 'lib/capistrano/dsl/paths.rb', line 67 def linked_files(parent) paths = fetch(:linked_files) join_paths(parent, paths) end |
#map_dirnames(paths) ⇒ Object
84 85 86 |
# File 'lib/capistrano/dsl/paths.rb', line 84 def map_dirnames(paths) paths.map(&:dirname).uniq end |
#now ⇒ Object
54 55 56 |
# File 'lib/capistrano/dsl/paths.rb', line 54 def now env..strftime("%Y%m%d%H%M%S") end |
#release_path ⇒ Object
21 22 23 |
# File 'lib/capistrano/dsl/paths.rb', line 21 def release_path fetch(:release_path) { current_path } end |
#releases_path ⇒ Object
17 18 19 |
# File 'lib/capistrano/dsl/paths.rb', line 17 def releases_path deploy_path.join(fetch(:releases_directory, "releases")) end |
#repo_path ⇒ Object
42 43 44 |
# File 'lib/capistrano/dsl/paths.rb', line 42 def repo_path Pathname.new(fetch(:repo_path, ->() { deploy_path.join("repo") })) end |
#repo_url ⇒ Object
38 39 40 |
# File 'lib/capistrano/dsl/paths.rb', line 38 def repo_url fetch(:repo_url) end |
#revision_log ⇒ Object
50 51 52 |
# File 'lib/capistrano/dsl/paths.rb', line 50 def revision_log deploy_path.join("revisions.log") end |
#set_release_path(timestamp = now) ⇒ Object
25 26 27 28 |
# File 'lib/capistrano/dsl/paths.rb', line 25 def set_release_path(=now) set(:release_timestamp, ) set(:release_path, releases_path.join()) end |
#shared_path ⇒ Object
46 47 48 |
# File 'lib/capistrano/dsl/paths.rb', line 46 def shared_path deploy_path.join(fetch(:shared_directory, "shared")) end |
#stage_config_path ⇒ Object
30 31 32 |
# File 'lib/capistrano/dsl/paths.rb', line 30 def stage_config_path Pathname.new fetch(:stage_config_path, "config/deploy") end |