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
- #auto(url) ⇒ Object
-
#feed(yaml_file, *options) ⇒ nil
Prints the feed to STDOUT.
Class Method Details
.exit_on_failure? ⇒ Boolean
15 16 17 |
# File 'lib/html2rss/cli.rb', line 15 def self.exit_on_failure? true end |
Instance Method Details
#auto(url) ⇒ Object
35 36 37 |
# File 'lib/html2rss/cli.rb', line 35 def auto(url) puts Html2rss.auto_source(url) end |
#feed(yaml_file, *options) ⇒ nil
Prints the feed to STDOUT.
26 27 28 29 30 31 32 |
# File 'lib/html2rss/cli.rb', line 26 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 |