Module: Cap::Git::Deploy

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

Constant Summary collapse

VERSION =
'0.1.2'

Class Method Summary collapse

Class Method Details

.current_branchObject

The name of the branch we are deploying



12
13
14
# File 'lib/cap-git-deploy.rb', line 12

def self.current_branch
  repo = `git rev-parse --abbrev-ref HEAD`.chomp
end

.current_userObject

The name of the current logged user



17
18
19
20
21
22
# File 'lib/cap-git-deploy.rb', line 17

def self.current_user
   = Etc.getlogin
  user  = Etc.getpwnam()
  host  = Socket.gethostname
  "<#{user}> #{}@#{host}"
end