Class: Sleet::FetchCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/sleet/fetch_command.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ FetchCommand

Returns a new instance of FetchCommand.



5
6
7
# File 'lib/sleet/fetch_command.rb', line 5

def initialize(config)
  @config = config
end

Instance Method Details

#do!Object

Raises:

  • (Thor::Error)


9
10
11
12
13
14
15
16
17
18
19
# 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