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
-
.current_branch ⇒ Object
The name of the branch we are deploying.
-
.current_user ⇒ Object
The name of the current logged user.
Class Method Details
.current_branch ⇒ Object
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_user ⇒ Object
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 login = Etc.getlogin user = Etc.getpwnam(login) host = Socket.gethostname "<#{user}> #{login}@#{host}" end |