diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2015-05-06 17:16:42 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2015-05-06 17:16:42 +0200 |
commit | 278fd98f68dc2d30b593ad30b56ae41f9306fcf4 (patch) | |
tree | 4c4d578d9788de1dcbca60749ece826b251587a3 | |
parent | 6b719f2cb9285bfc09d8f8b4b4385fbdb5a0b395 (diff) | |
download | rss2html-278fd98f68dc2d30b593ad30b56ae41f9306fcf4.tar.gz rss2html-278fd98f68dc2d30b593ad30b56ae41f9306fcf4.tar.bz2 rss2html-278fd98f68dc2d30b593ad30b56ae41f9306fcf4.zip |
Fetch config file from $HOME/.config/feed.yml
-rw-r--r-- | rss.rb | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -20,7 +20,14 @@ require_relative 'lib/feed' require 'yaml' require 'erb' -feeds = YAML.load(IO.read('feeds.yml')) +config_file = File.expand_path('~/.config/feeds.yml') + +unless File.exists?(config_file) + puts "Config file #{config_file} not found. Please create it!" + exit +end + +feeds = YAML.load(IO.read(config_file)) items = [] feed_header = ERB.new(IO.read('lib/views/feed_header.html.erb')) |