class Sleet::ArtifactDownloader

Attributes

artifacts[R]
circle_ci_token[R]
file_name[R]

Public Class Methods

new(circle_ci_token:, artifacts:, file_name:) click to toggle source
# File lib/sleet/artifact_downloader.rb, line 5
def initialize(circle_ci_token:, artifacts:, file_name:)
  @circle_ci_token = circle_ci_token
  @artifacts = artifacts
  @file_name = file_name
end

Public Instance Methods

files() click to toggle source
# File lib/sleet/artifact_downloader.rb, line 11
def files
  @files ||= urls.map do |url|
    Sleet::CircleCi.get(url, circle_ci_token)
  end.map(&:body)
end

Private Instance Methods

rspec_artifacts() click to toggle source
# File lib/sleet/artifact_downloader.rb, line 25
def rspec_artifacts
  artifacts.select { |x| x['path'].end_with?(file_name) }
end
urls() click to toggle source
# File lib/sleet/artifact_downloader.rb, line 21
def urls
  rspec_artifacts.map { |x| x['url'] }
end