module TinyNews
Constants
- VERSION
Public Class Methods
feed_as_json(feed_symbol)
click to toggle source
# File lib/tinynews.rb, line 12 def self.feed_as_json feed_symbol JSONExporter.export( get_feed(feed_symbol) ) end
get_feed(feed_symbol)
click to toggle source
# File lib/tinynews.rb, line 8 def self.get_feed feed_symbol Feeds.new.generate( feed_symbol ) end
print_to_cli(feed_symbol)
click to toggle source
# File lib/tinynews.rb, line 16 def self.print_to_cli feed_symbol CLIPrinter.print( get_feed(feed_symbol) ) end
say_hello()
click to toggle source
# File lib/tinynews.rb, line 20 def self.say_hello puts "Hello" end
sources_from_home()
click to toggle source
# File lib/tinynews.rb, line 24 def self.sources_from_home source_file = File.expand_path('~/.tinynews.yml') unless File.file?( source_file ) File.open( source_file, "w") do |f| f.write( File.open("../sources.yml", "r").read ) end end f = open(source_file, "r").read YAML::load( f ) end
Public Instance Methods
sources_from_home()
click to toggle source
# File lib/tinynews/sources.rb, line 3 def sources_from_home f = open(File.expand_path('~/.tinynews.yml')).read YAML::load( f ) end