Class: Inq::Sources::CI::Appveyor
- Inherits:
-
Object
- Object
- Inq::Sources::CI::Appveyor
- Defined in:
- lib/inq/sources/ci/appveyor.rb
Overview
Fetches metadata about CI builds from appveyor.com.
Instance Method Summary collapse
-
#builds ⇒ Hash
Fetches builds for the default branch.
-
#default_branch ⇒ String
The default branch name.
-
#initialize(config, start_date, end_date, cache) ⇒ Appveyor
constructor
A new instance of Appveyor.
Constructor Details
#initialize(config, start_date, end_date, cache) ⇒ Appveyor
Returns a new instance of Appveyor.
19 20 21 22 23 24 25 26 |
# File 'lib/inq/sources/ci/appveyor.rb', line 19 def initialize(config, start_date, end_date, cache) @config = config @cache = cache @repository = config["repository"] @start_date = DateTime.parse(start_date) @end_date = DateTime.parse(end_date) @default_branch = Okay.default end |
Instance Method Details
#builds ⇒ Hash
Fetches builds for the default branch.
40 41 42 43 44 45 46 47 48 |
# File 'lib/inq/sources/ci/appveyor.rb', line 40 def builds @builds ||= fetch_builds["builds"] \ .map(&method(:normalize_build)) \ .select(&method(:in_date_range?)) rescue Net::HTTPServerException # It's not elegant, but it works™. [] end |
#default_branch ⇒ String
Returns The default branch name.
29 30 31 32 33 34 35 |
# File 'lib/inq/sources/ci/appveyor.rb', line 29 def default_branch return @default_branch unless @default_branch.nil? contributions = Sources::GitHub::Contributions.new(@config, nil, nil) @default_branch = contributions.default_branch end |