Abstract conf parsing to class

This commit is contained in:
Brian Cain 2015-10-01 23:32:17 -07:00
parent 9b176a7bd5
commit c738b0c566
2 changed files with 16 additions and 12 deletions

14
lib/vmfloaty/conf.rb Normal file
View file

@ -0,0 +1,14 @@
require 'yaml'
class Conf
def self.read_config
conf = {}
begin
conf = YAML.load_file("#{Dir.home}/.vmfloaty.yml")
rescue
STDERR.puts "WARNING: There was no config file at #{Dir.home}/.vmfloaty.yml"
end
conf
end
end