Method: Generator::Util#load_file

Defined in:
lib/fusegen/util.rb

#load_file(file, options = {}) ⇒ Object



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/fusegen/util.rb', line 51

def load_file(file, options={})
  begin
    cfg = {}
    if file =~ /~/
      file[0] = ''
      file = File.expand_path('~') + file
    end

    if options[:name]
      file = options[:name] + '/' + file
    end
    cfg = YAML.load_file(file)
  rescue Exception => e        
  end
  cfg
end