Class: Push2heroku::Git

Inherits:
Object
  • Object
show all
Defined in:
lib/push2heroku/git.rb

Instance Method Summary collapse

Instance Method Details

#current_branchObject



3
4
5
6
7
8
9
10
# File 'lib/push2heroku/git.rb', line 3

def current_branch
  result = %x{git branch}.split("\n")
  if result.empty?
    raise "It seems your app is not a git repo"
  else
    result.select { |b| b =~ /^\*/ }.first.split(" ").last.strip
  end
end

#current_userObject



12
13
14
# File 'lib/push2heroku/git.rb', line 12

def current_user
  `git config user.name`.chop!
end