Module: Hatchet

Defined in:
lib/hatchet.rb,
lib/hatchet.rb,
lib/hatchet/app.rb,
lib/hatchet/config.rb,
lib/hatchet/reaper.rb,
lib/hatchet/git_app.rb,
lib/hatchet/version.rb,
lib/hatchet/test_run.rb,
lib/hatchet/anvil_app.rb,
lib/hatchet/heroku_run.rb,
lib/hatchet/init_project.rb,
lib/hatchet/reaper/app_age.rb,
lib/hatchet/shell_throttle.rb,
lib/hatchet/reaper/reaper_throttle.rb

Defined Under Namespace

Classes: AnvilApp, App, BadRepoName, BashResult, Config, FailedTestError, GitApp, HerokuRun, InitProject, MissingConfig, ParserError, Reaper, ShellThrottle, TestRun

Constant Summary collapse

APP_PREFIX =
(ENV['HATCHET_APP_PREFIX'] || "hatchet-t-")
RETRIES =
Integer(ENV['HATCHET_RETRIES']   || 1)
Runner =
Hatchet::GitApp
VERSION =
"8.0.4"

Class Method Summary collapse

Class Method Details

.git_branchObject



51
52
53
54
55
56
57
58
59
60
61
# File 'lib/hatchet.rb', line 51

def self.git_branch
  branch = DefaultCIBranch.new.call

  if branch
    branch
  else
    out = `git rev-parse --abbrev-ref HEAD`.strip
    raise "Attempting to find current branch name. Error: Cannot describe git: #{out}" unless $?.success?
    out
  end
end