[Groonga-commit] droonga/fluent-plugin-droonga at 8a5a364 [master] Add validation for zones

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Feb 12 16:05:40 JST 2014


YUKI Hiroshi	2014-02-12 16:05:40 +0900 (Wed, 12 Feb 2014)

  New Revision: 8a5a36461d3b5a05e9f6eb240d49020639a41a97
  https://github.com/droonga/fluent-plugin-droonga/commit/8a5a36461d3b5a05e9f6eb240d49020639a41a97

  Message:
    Add validation for zones

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

  Modified: lib/droonga/catalog/base.rb (+12 -0)
===================================================================
--- lib/droonga/catalog/base.rb    2014-02-12 16:05:26 +0900 (c8832e5)
+++ lib/droonga/catalog/base.rb    2014-02-12 16:05:40 +0900 (6d2a970)
@@ -60,6 +60,7 @@ module Droonga
         @path = path
         @base_path = File.dirname(path)
 
+        validate_zones
         validate_farms
         validate_datasets
 
@@ -209,6 +210,17 @@ module Droonga
         end
       end
 
+      def validate_zones
+        zones = @data["zones"]
+
+        raise MissingRequiredParameter.new("zones", @path) unless zones
+        validate_parameter_type(Array, zones, "zones")
+
+        zones.each_with_index do |value, index|
+          validate_parameter_type(String, value, "zones[#{index}]")
+        end
+      end
+
       def validate_farms
         farms = @data["farms"]
 
-------------- next part --------------
HTML����������������������������...
Download 



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