class DeployNotes::Cap
Class for capistrano deployments
Public Instance Methods
branch_name()
click to toggle source
# File lib/deploy_notes/cap.rb, line 8 def branch_name `tail -1 #{current}/../../revisions.log | cut -d' ' -f2` end
commit_info()
click to toggle source
# File lib/deploy_notes/cap.rb, line 17 def commit_info `git --git-dir=#{repo} --work-tree #{current} log #{revision} -n1 --pretty=format:[%ae:%s][%cr][%h]` end
deploy_time()
click to toggle source
# File lib/deploy_notes/cap.rb, line 12 def deploy_time deploy_time = `stat -c '%y' #{current}/REVISION` deploy_time.to_time.to_s(:db) end
get()
click to toggle source
# File lib/deploy_notes/cap.rb, line 4 def get "[#{branch_name}] - [#{deploy_time}] - [#{commit_info}]" end
Private Instance Methods
current()
click to toggle source
# File lib/deploy_notes/cap.rb, line 23 def current Rails.root.to_s end
repo()
click to toggle source
# File lib/deploy_notes/cap.rb, line 27 def repo "#{current}/../../repo" end
revision()
click to toggle source
# File lib/deploy_notes/cap.rb, line 31 def revision `cat #{current}/REVISION | tr -d '\n'` end