Module: Cap::Git::Deploy

Defined in:
lib/cap-git-deploy.rb,
lib/cap-git-deploy/version.rb

Constant Summary collapse

VERSION =
'0.1.0'

Class Method Summary collapse

Class Method Details

.current_branchObject

The name of the branch we are deploying



13
14
15
16
17
18
# File 'lib/cap-git-deploy.rb', line 13

def self.current_branch
  repo = Grit::Repo.new '.'
  branch = repo.head
  # if branch is nil, we are in a spurius commit, then we should use master
  branch && branch.name || 'master'
end

.current_userObject

The name of the current logged user



21
22
23
# File 'lib/cap-git-deploy.rb', line 21

def self.current_user
  "#{Etc.getlogin}@#{Socket.gethostname}"
end