Class: Rssly::CLI
- Inherits:
-
Thor
- Object
- Thor
- Rssly::CLI
- Defined in:
- lib/rssly/cli.rb
Overview
The rssly CLI
Instance Method Summary collapse
Instance Method Details
#fetch(*feed_urls) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/rssly/cli.rb', line 28 def fetch(*feed_urls) Rssly::CONFIG[:summary_ratio] = [:summary_ratio] Rssly::CONFIG[:discover_feeds] = [:discover] Rssly::CONFIG[:verbose] = [:verbose] feeds = feed_urls.map { |url| Rssly::Feed.new url: url } collection = Rssly::Collection.create_from_feeds(*feeds) serializer = case [:format] when 'text' then Rssly::Serializers::Text when 'html' then Rssly::Serializers::HTML when 'json' then Rssly::Serializers::JSON else fail "Serializer #{[:format]} not found." end $stdout.puts serializer.new(collection).perform end |