Module: Embarista::Git

Extended by:
Git
Included in:
Git
Defined in:
lib/embarista/git.rb

Constant Summary collapse

BRANCH_TO_DEPLOY_FROM =
'master'

Instance Method Summary collapse

Instance Method Details

#can_deploy_from_curren_branch?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/embarista/git.rb', line 14

def can_deploy_from_curren_branch?
  git_branches =~ /\A\* #{BRANCH_TO_DEPLOY_FROM}.*origin\/#{BRANCH_TO_DEPLOY_FROM}: (ahead|behind)/
end

#git_branchesObject



10
11
12
# File 'lib/embarista/git.rb', line 10

def git_branches
  `git branch --no-color -vv`
end

#is_dirty?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/embarista/git.rb', line 6

def is_dirty?
  not `git status --porcelain`.empty?
end