Class: Xambassador::BranchName

Inherits:
StatusCheck show all
Defined in:
lib/xambassador/status_checks/branch_name.rb

Overview

Check peer review status

Instance Method Summary collapse

Methods inherited from StatusCheck

#failure, #pending, #success

Constructor Details

#initialize(connection, pull_request) ⇒ BranchName

Returns a new instance of BranchName.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/xambassador/status_checks/branch_name.rb', line 11

def initialize(connection, pull_request)
  super(connection, pull_request, "Branch Name")

  branch_check = Renegade::BranchName.new
  @description_failure = branch_check.warning

  branch_name = pull_request['head']['ref']

  if branch_check.check_branch_name(branch_name)
    success
  else
    failure
  end
end