Module: Achoo::RCLoader

Defined in:
lib/achoo/rc_loader.rb

Instance Method Summary collapse

Instance Method Details

#load_rc(rc_file = "#{ENV['HOME']}/.achoo") ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/achoo/rc_loader.rb', line 8

def load_rc(rc_file="#{ENV['HOME']}/.achoo")
  #create_empty_rc_if_not_exists(rc_file)
  file_permissions_secure?(rc_file)
  
  self.class.const_set(:RC, YAML.load_file(rc_file))
  if RC.is_a? String
    abort "Failed to parse rc file. Do you use the old format? Please convert it to YAML."
  end
  
  verify_rc_contents(rc_file)
end