class TpCommandLine::Config
Public Instance Methods
file_set()
click to toggle source
# File lib/config.rb, line 6 def file_set Valise::Set.define do ro "." ro "config/" ro "~/.timepulse" ro "~/" ro "/usr/share/timepulse" ro "/etc/timepulse" handle "*.yml", :yaml, :hash_merge handle "*.yaml", :yaml, :hash_merge end end
load_config()
click to toggle source
# File lib/config.rb, line 20 def load_config @config_hash = file_set.contents("timepulse.yml") missing_fields = ['timepulse_url', 'project_id', 'login', 'authorization'].find_all {|k| !@config_hash.keys.include? k} unless missing_fields.empty? puts "Missing necessary parameter/s: #{missing_fields.join(", ")}" exit end return @config_hash end