From 278fd98f68dc2d30b593ad30b56ae41f9306fcf4 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Wed, 6 May 2015 17:16:42 +0200 Subject: Fetch config file from $HOME/.config/feed.yml --- rss.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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')) -- cgit v1.2.3