Sha256: f21f5af73bd9011c4498b29248d26576021aded612fe1f81c465d4d5c10b2605
Contents?: true
Size: 838 Bytes
Versions: 3
Compression:
Stored size: 838 Bytes
Contents
# frozen_string_literal: true require_relative '../html2rss' require 'thor' module Html2rss ## # The Html2rss command line interface. class CLI < Thor def self.exit_on_failure? true end desc 'feed YAML_FILE [FEED_NAME] [param=value ...]', 'Print RSS built from the YAML_FILE file to stdout' ## # Prints the feed to STDOUT. # # @param yaml_file [String] Path to the YAML configuration file. # @param options [Array<String>] Additional options including feed name and parameters. # @return [nil] def feed(yaml_file, *options) raise "File '#{yaml_file}' does not exist" unless File.exist?(yaml_file) feed_name = options.shift params = options.to_h { |opt| opt.split('=', 2) } puts Html2rss.feed_from_yaml_config(yaml_file, feed_name, params:) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
html2rss-0.12.0 | lib/html2rss/cli.rb |
html2rss-0.11.0 | lib/html2rss/cli.rb |
html2rss-0.10.0 | lib/html2rss/cli.rb |