module Capistrano::DSL::Paths
Public Instance Methods
asset_timestamp()
click to toggle source
# File lib/capistrano/dsl/paths.rb, line 71 def asset_timestamp env.timestamp.strftime("%Y%m%d%H%M.%S") end
current_path()
click to toggle source
# File lib/capistrano/dsl/paths.rb, line 13 def current_path deploy_path.join("current") end
deploy_config_path()
click to toggle source
# File lib/capistrano/dsl/paths.rb, line 34 def deploy_config_path Pathname.new fetch(:deploy_config_path, "config/deploy.rb") end
deploy_path()
click to toggle source
# File lib/capistrano/dsl/paths.rb, line 9 def deploy_path Pathname.new(deploy_to) end
deploy_to()
click to toggle source
# File lib/capistrano/dsl/paths.rb, line 5 def deploy_to fetch(:deploy_to) end
join_paths(parent, paths)
click to toggle source
# File lib/capistrano/dsl/paths.rb, line 93 def join_paths(parent, paths) paths.map { |path| parent.join(path) } end
linked_dir_parents(parent)
click to toggle source
# File lib/capistrano/dsl/paths.rb, line 89 def linked_dir_parents(parent) map_dirnames(linked_dirs(parent)) end
linked_dirs(parent)
click to toggle source
# File lib/capistrano/dsl/paths.rb, line 75 def linked_dirs(parent) paths = fetch(:linked_dirs) join_paths(parent, paths) end
linked_file_dirs(parent)
click to toggle source
# File lib/capistrano/dsl/paths.rb, line 85 def linked_file_dirs(parent) map_dirnames(linked_files(parent)) end
linked_files(parent)
click to toggle source
# File lib/capistrano/dsl/paths.rb, line 80 def linked_files(parent) paths = fetch(:linked_files) join_paths(parent, paths) end
map_dirnames(paths)
click to toggle source
# File lib/capistrano/dsl/paths.rb, line 97 def map_dirnames(paths) paths.map(&:dirname).uniq end
now()
click to toggle source
# File lib/capistrano/dsl/paths.rb, line 67 def now env.timestamp.strftime("%Y%m%d%H%M%S") end
release_path()
click to toggle source
# File lib/capistrano/dsl/paths.rb, line 21 def release_path fetch(:release_path, current_path) end
releases_path()
click to toggle source
# File lib/capistrano/dsl/paths.rb, line 17 def releases_path deploy_path.join("releases") end
repo_path()
click to toggle source
# File lib/capistrano/dsl/paths.rb, line 55 def repo_path Pathname.new(fetch(:repo_path, ->() { deploy_path.join("repo") })) end
repo_url()
click to toggle source
# File lib/capistrano/dsl/paths.rb, line 38 def repo_url require "cgi" require "uri" if fetch(:git_http_username) && fetch(:git_http_password) URI.parse(fetch(:repo_url)).tap do |repo_uri| repo_uri.user = fetch(:git_http_username) repo_uri.password = CGI.escape(fetch(:git_http_password)) end.to_s elsif fetch(:git_http_username) URI.parse(fetch(:repo_url)).tap do |repo_uri| repo_uri.user = fetch(:git_http_username) end.to_s else fetch(:repo_url) end end
revision_log()
click to toggle source
# File lib/capistrano/dsl/paths.rb, line 63 def revision_log deploy_path.join("revisions.log") end
set_release_path(timestamp=now)
click to toggle source
# File lib/capistrano/dsl/paths.rb, line 25 def set_release_path(timestamp=now) set(:release_timestamp, timestamp) set(:release_path, releases_path.join(timestamp)) end
stage_config_path()
click to toggle source
# File lib/capistrano/dsl/paths.rb, line 30 def stage_config_path Pathname.new fetch(:stage_config_path, "config/deploy") end