Class: Danger::CISource::Surf

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

Overview

Instance Attribute Summary

Attributes inherited from CI

#pull_request_id, #repo_slug, #repo_url

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CI

available_ci_sources, inherited, #supports?

Constructor Details

#initialize(env) ⇒ Surf

Returns a new instance of Surf.



15
16
17
18
19
20
21
22
# File 'lib/danger/ci_source/surf.rb', line 15

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

  self.repo_url = env["SURF_REPO"]
end

Class Method Details

.validates?(env) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/danger/ci_source/surf.rb', line 7

def self.validates?(env)
  return ["SURF_REPO", "SURF_NWO"].all? { |x| env[x] }
end

Instance Method Details

#supported_request_sourcesObject



11
12
13
# File 'lib/danger/ci_source/surf.rb', line 11

def supported_request_sources
  @supported_request_sources ||= [Danger::RequestSources::GitHub]
end