Sha256: 11c0a52ef33d8ac5ca6bc92acf3f6ccec92a98d4248049cdfa105d819ace1e2b

Contents?: true

Size: 741 Bytes

Versions: 1

Compression:

Stored size: 741 Bytes

Contents

require "tinynews/version"
require 'tinynews/feeds'
require 'tinynews/cli_printer'
require 'tinynews/json_exporter'

module TinyNews

  def self.get_feed feed_symbol
    Feeds.new.generate( feed_symbol )
  end

  def self.feed_as_json feed_symbol
    JSONExporter.export( get_feed(feed_symbol) )
  end

  def self.print_to_cli feed_symbol
    CLIPrinter.print( get_feed(feed_symbol) )
  end

  def self.say_hello
    puts "Hello"
  end

  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

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tinynews-1.0.3 lib/tinynews.rb