Class: LetItCrash::Matchers::GitLabCI

Inherits:
Base
  • Object
show all
Defined in:
lib/letitcrash/matchers/gitlab_ci.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from LetItCrash::Matchers::Base

Instance Method Details

#branchObject



11
12
13
# File 'lib/letitcrash/matchers/gitlab_ci.rb', line 11

def branch
  environment['CI_BUILD_REF_NAME'] || environment['CI_COMMIT_REF_NAME']
end

#matches?Boolean

This method performs a :reek:NilCheck.

Returns:

  • (Boolean)


7
8
9
# File 'lib/letitcrash/matchers/gitlab_ci.rb', line 7

def matches?
  !environment['GITLAB_CI'].nil?
end

#shaObject



15
16
17
# File 'lib/letitcrash/matchers/gitlab_ci.rb', line 15

def sha
  environment['CI_BUILD_REF'] || environment['CI_COMMIT_SHA']
end