Class: Cli
- Inherits:
-
Thor
- Object
- Thor
- Cli
- Defined in:
- lib/cli.rb
Instance Method Summary collapse
Instance Method Details
#__print_version ⇒ Object
15 16 17 |
# File 'lib/cli.rb', line 15 def __print_version puts version end |
#add(url) ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/cli.rb', line 22 def add(url) unless valid_url?(url) puts 'Invalid URL' return end LideoController.new.add(url, group()) end |
#feeds ⇒ Object
57 58 59 60 61 62 63 64 |
# File 'lib/cli.rb', line 57 def feeds url_to_remove = from_r_option() if url_to_remove.nil? list_feeds else remove_feed(url_to_remove) end end |
#fetch ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/cli.rb', line 45 def fetch headlines = LideoController.new.fetch(group()) puts 'No news for you this time' if headlines.empty? export_html(headlines) && return if [:to] && [:to].downcase == 'html' puts "#{}#{format_headlines_output(headlines)}" unless headlines.empty? || ![:to].nil? end |