mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 13:28:42 -05:00
Abstract conf parsing to class
This commit is contained in:
parent
9b176a7bd5
commit
c738b0c566
2 changed files with 16 additions and 12 deletions
14
lib/vmfloaty/conf.rb
Normal file
14
lib/vmfloaty/conf.rb
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue