Module: LocalUtils
- Defined in:
- lib/capistrano-extensions/deploy.rb
Instance Method Summary collapse
- #current_timestamp ⇒ Object
- #local_content_backup_dir(args = {}) ⇒ Object
- #local_db_backup_file(args = {}) ⇒ Object
- #most_recent_local_backup(env, type) ⇒ Object
- #retrieve_local_files(env, type) ⇒ Object
Instance Method Details
#current_timestamp ⇒ Object
211 212 213 |
# File 'lib/capistrano-extensions/deploy.rb', line 211 def @current_timestamp ||= Time.now.to_i end |
#local_content_backup_dir(args = {}) ⇒ Object
221 222 223 224 225 |
# File 'lib/capistrano-extensions/deploy.rb', line 221 def local_content_backup_dir(args={}) env = args[:env] || rails_env = args[:timestamp] || "#{tmp_dir}/#{application}-#{env}-content-#{}" end |
#local_db_backup_file(args = {}) ⇒ Object
215 216 217 218 219 |
# File 'lib/capistrano-extensions/deploy.rb', line 215 def local_db_backup_file(args = {}) env = args[:env] || rails_env = args[:timestamp] || "#{tmp_dir}/#{application}-#{env}-db-#{}.sql" end |
#most_recent_local_backup(env, type) ⇒ Object
231 232 233 |
# File 'lib/capistrano-extensions/deploy.rb', line 231 def most_recent_local_backup(env, type) retrieve_local_files(env, type).first.to_i end |
#retrieve_local_files(env, type) ⇒ Object
227 228 229 |
# File 'lib/capistrano-extensions/deploy.rb', line 227 def retrieve_local_files(env, type) `ls -r #{tmp_dir} | awk -F"-" '{ if ($2 ~ /#{env}/ && $3 ~ /#{type}/) { print $4; } }'`.split(' ') end |