Class: Danger::CISource::TeamCity

Inherits:
CI
  • Object
show all
Defined in:
lib/danger/ci_source/teamcity.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) ⇒ TeamCity

Returns a new instance of TeamCity.



13
14
15
16
17
18
19
20
# File 'lib/danger/ci_source/teamcity.rb', line 13

def initialize(env)
  # NB: Unfortunately TeamCity doesn't provide these variables
  # automatically so you have to add these variables manually to your
  # project or build configuration
  self.repo_slug       = env["GITHUB_REPO_SLUG"]
  self.pull_request_id = env["GITHUB_PULL_REQUEST_ID"].to_i
  self.repo_url        = env["GITHUB_REPO_URL"]
end

Class Method Details

.validates?(env) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/danger/ci_source/teamcity.rb', line 5

def self.validates?(env)
  env.key? "TEAMCITY_VERSION"
end

Instance Method Details

#supported_request_sourcesObject



9
10
11
# File 'lib/danger/ci_source/teamcity.rb', line 9

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