Class: AudioFeedManager::AddAudioFile

Inherits:
Command
  • Object
show all
Defined in:
lib/audio_feed_manager/cli/add_audio_file.rb

Instance Method Summary collapse

Methods inherited from Command

arguments, #arguments, arguments_specification

Instance Method Details

#run(feed:, files:) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/audio_feed_manager/cli/add_audio_file.rb', line 13

def run(feed:, files:)
  feed = feed_repository.fetch(feed)

  files.each do |file|
    add_file(feed, file)
  end

  rss_generator.generate(feed)
rescue FeedNotFound => e
  console.die(e)
rescue SystemCallError => e
  console.die(e)
end