aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2015-05-06 17:16:42 +0200
committerHarald Eilertsen <haraldei@anduin.net>2015-05-06 17:16:42 +0200
commit278fd98f68dc2d30b593ad30b56ae41f9306fcf4 (patch)
tree4c4d578d9788de1dcbca60749ece826b251587a3
parent6b719f2cb9285bfc09d8f8b4b4385fbdb5a0b395 (diff)
downloadrss2html-278fd98f68dc2d30b593ad30b56ae41f9306fcf4.tar.gz
rss2html-278fd98f68dc2d30b593ad30b56ae41f9306fcf4.tar.bz2
rss2html-278fd98f68dc2d30b593ad30b56ae41f9306fcf4.zip
Fetch config file from $HOME/.config/feed.yml
-rw-r--r--rss.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/rss.rb b/rss.rb
index ea1068c..4890fd4 100644
--- a/rss.rb
+++ b/rss.rb
@@ -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'))