[Groonga-commit] droonga/fluent-plugin-droonga at 17863f8 [master] Validate farms

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Feb 12 14:24:55 JST 2014


YUKI Hiroshi	2014-02-12 14:24:55 +0900 (Wed, 12 Feb 2014)

  New Revision: 17863f8e4b0f49f884b582313df36cfffa1171a8
  https://github.com/droonga/fluent-plugin-droonga/commit/17863f8e4b0f49f884b582313df36cfffa1171a8

  Message:
    Validate farms

  Modified files:
    lib/droonga/catalog/base.rb

  Modified: lib/droonga/catalog/base.rb (+8 -1)
===================================================================
--- lib/droonga/catalog/base.rb    2014-02-12 14:21:52 +0900 (f04097d)
+++ lib/droonga/catalog/base.rb    2014-02-12 14:24:55 +0900 (e2b01cf)
@@ -60,6 +60,7 @@ module Droonga
         @path = path
         @base_path = File.dirname(path)
 
+        validate_farms
         validate_datasets
 
         @data["datasets"].each do |name, dataset|
@@ -189,11 +190,17 @@ module Droonga
         end
       end
 
+      def validate_farms
+        farms = @data["farms"]
+
+        raise MissingRequiredParameter.new("farms", @path) unless farms
+        validate_parameter_type(farms, "farms", Hash)
+      end
+
       def validate_datasets
         datasets = @data["datasets"]
 
         raise MissingRequiredParameter.new("datasets", @path) unless datasets
-
         validate_parameter_type(datasets, "datasets", Hash)
       end
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index