class Sleet::FetchCommand

Attributes

config[R]

Public Class Methods

new(config) click to toggle source
# File lib/sleet/fetch_command.rb, line 5
def initialize(config)
  @config = config
end

Public Instance Methods

do!() click to toggle source
# File lib/sleet/fetch_command.rb, line 9
def do!
  error_messages = []
  fetchers.map do |fetcher|
    begin
      fetcher.do!
    rescue Sleet::Error => e
      error_messages << e.message
    end
  end
  raise Thor::Error, error_messages.join("\n") unless error_messages.empty?
end

Private Instance Methods

fetchers() click to toggle source
# File lib/sleet/fetch_command.rb, line 25
def fetchers
  job_name_to_output_files.map do |job_name, output_filename|
    Sleet::JobFetcher.new(
      config: config,
      output_filename: output_filename,
      repo: repo,
      job_name: job_name
    )
  end
end
job_name_to_output_files() click to toggle source
# File lib/sleet/fetch_command.rb, line 36
def job_name_to_output_files
  config.workflows || { nil => config.output_file }
end
repo() click to toggle source
# File lib/sleet/fetch_command.rb, line 40
def repo
  @repo ||= Sleet::Repo.from_config(config)
end