Sha256: fdb8299ff3d01c1ccc801083f8336714ef2de84e3efaf9051318ae8e05494642

Contents?: true

Size: 625 Bytes

Versions: 2

Compression:

Stored size: 625 Bytes

Contents

#!/usr/bin/env ruby

require 'thor'
require 'yaml'
require 'tinynews'

module TinyNews

  SOURCES = TinyNews.sources_from_home

  class CLI < Thor

    default_task :news_from_source

    desc "list", "Lists the available news feeds."
    def list
      puts "List of news feed sources: "
      SOURCES.each do |symbol, source|
        puts "- #{source[:title]}"
      end
    end

    desc "--source NEWS_SOURCE", "Show news for NEWS_SOURCE"
    option :source, :required => true, :aliases => :s
    def news_from_source
      TinyNews.print_to_cli( options[:source].to_sym )
    end
  end

end

TinyNews::CLI.start( ARGV )

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tinynews-1.0.3 bin/tinynews
tinynews-1.0.2 bin/tinynews