浏览代码

Revert "Raise error for unknown data sources"

This reverts commit 2a3d2ccf9c35a3ad60e3425ab91e0f4199310446.
Andrew Kane 8 年之前
父节点
当前提交
cbd92a3fbc
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 6 4
      lib/blazer.rb

+ 6 - 4
lib/blazer.rb

@@ -68,10 +68,12 @@ module Blazer
 
   def self.data_sources
     @data_sources ||= begin
-      ds = Hash.new { |hash, key| raise Blazer::Error, "Unknown data source: #{key}" }
-      settings["data_sources"].each do |id, s|
-        ds[id] = Blazer::DataSource.new(id, s)
-      end
+      ds = Hash[
+        settings["data_sources"].map do |id, s|
+          [id, Blazer::DataSource.new(id, s)]
+        end
+      ]
+      ds.default = ds.values.first
       ds
     end
   end