Class: PRSS::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/prss/cli.rb

Instance Method Summary collapse

Instance Method Details

#download(passkey, output) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/prss/cli.rb', line 17

def download(passkey, output)
  Downloader.verify!(output)

  feed = Feed.new(passkey)
  downloaded = feed.download_to(output)

  puts "Downloaded #{downloaded.count} files to #{output}."
  puts "Files:", *downloaded unless downloaded.empty?
end

#watch(passkey, output) ⇒ Object



9
10
11
12
13
14
# File 'lib/prss/cli.rb', line 9

def watch(passkey, output)
  Downloader.verify!(output)
  feed = Feed.new(passkey)
  watcher = Watcher.new(feed)
  watcher.start(options[:interval], output)
end