Explorar o código

Fixed error when installing - closes #25

Andrew Kane %!s(int64=9) %!d(string=hai) anos
pai
achega
34db8376a0
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      lib/blazer.rb

+ 8 - 1
lib/blazer.rb

@@ -23,7 +23,14 @@ module Blazer
   end
 
   def self.settings
-    @settings ||= YAML.load(ERB.new(File.read(Rails.root.join("config", "blazer.yml"))).result)
+    @settings ||= begin
+      path = Rails.root.join("config", "blazer.yml").to_s
+      if File.exist?(path)
+        YAML.load(ERB.new(File.read(path)).result)
+      else
+        {}
+      end
+    end
   end
 
   def self.data_sources