Class: Danger::CISource::Semaphore

Inherits:
CI
  • Object
show all
Defined in:
lib/danger/ci_source/semaphore.rb

Instance Attribute Summary

Attributes inherited from CI

#pull_request_id, #repo_slug

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ Semaphore

Returns a new instance of Semaphore.



10
11
12
13
14
15
# File 'lib/danger/ci_source/semaphore.rb', line 10

def initialize(env)
  self.repo_slug = env["SEMAPHORE_REPO_SLUG"]
  if env["PULL_REQUEST_NUMBER"].to_i > 0
    self.pull_request_id = env["PULL_REQUEST_NUMBER"]
  end
end

Class Method Details

.validates?(env) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/danger/ci_source/semaphore.rb', line 6

def self.validates?(env)
  return !env["SEMAPHORE"].nil?
end