Class: Html2rss::CLI
- Inherits:
-
Thor
- Object
- Thor
- Html2rss::CLI
- Defined in:
- lib/html2rss/cli.rb
Overview
The Html2rss command line interface.
Class Method Summary collapse
Instance Method Summary collapse
-
#feed(yaml_file, *options) ⇒ nil
Prints the feed to STDOUT.
Class Method Details
.exit_on_failure? ⇒ Boolean
10 11 12 |
# File 'lib/html2rss/cli.rb', line 10 def self.exit_on_failure? true end |
Instance Method Details
#feed(yaml_file, *options) ⇒ nil
Prints the feed to STDOUT.
21 22 23 24 25 26 27 |
# File 'lib/html2rss/cli.rb', line 21 def feed(yaml_file, *) raise "File '#{yaml_file}' does not exist" unless File.exist?(yaml_file) feed_name = .shift params = .to_h { |opt| opt.split('=', 2) } puts Html2rss.feed_from_yaml_config(yaml_file, feed_name, params:) end |