Class: Danger::CISource::Drone

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

Returns a new instance of Drone.



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

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

Class Method Details

.validates?(env) ⇒ Boolean

Returns:

  • (Boolean)


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

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