[Groonga-commit] groonga/fluent-plugin-groonga at 53ada80 [master] in out: simplify comfig_param style

Back to archive index

Kentaro Hayashi null+****@clear*****
Wed Apr 12 14:36:29 JST 2017


Kentaro Hayashi	2017-04-12 14:36:29 +0900 (Wed, 12 Apr 2017)

  New Revision: 53ada80884242bec8ac499e7a62f6a365d490ee7
  https://github.com/groonga/fluent-plugin-groonga/commit/53ada80884242bec8ac499e7a62f6a365d490ee7

  Merged 75211d0: Merge pull request #11 from groonga/fix-config-param-style

  Message:
    in out: simplify comfig_param style

  Modified files:
    lib/fluent/plugin/in_groonga.rb
    lib/fluent/plugin/out_groonga.rb

  Modified: lib/fluent/plugin/in_groonga.rb (+1 -8)
===================================================================
--- lib/fluent/plugin/in_groonga.rb    2017-04-04 15:41:23 +0900 (0082151)
+++ lib/fluent/plugin/in_groonga.rb    2017-04-12 14:36:29 +0900 (716c384)
@@ -33,14 +33,7 @@ module Fluent
       super
     end
 
-    config_param :protocol, :default => :http do |value|
-      case value
-      when "http", "gqtp"
-        value.to_sym
-      else
-        raise ConfigError, "must be http or gqtp: <#{value}>"
-      end
-    end
+    config_param :protocol, :enum, :list => [:http, :gqtp], :default => :http
 
     def configure(conf)
       super

  Modified: lib/fluent/plugin/out_groonga.rb (+1 -8)
===================================================================
--- lib/fluent/plugin/out_groonga.rb    2017-04-04 15:41:23 +0900 (8c842eb)
+++ lib/fluent/plugin/out_groonga.rb    2017-04-12 14:36:29 +0900 (35149de)
@@ -29,14 +29,7 @@ module Fluent
       super
     end
 
-    config_param :protocol, :default => :http do |value|
-      case value
-      when "http", "gqtp", "command"
-        value.to_sym
-      else
-        raise ConfigError, "must be http, gqtp or command: <#{value}>"
-      end
-    end
+    config_param :protocol, :enum, :list => [:http, :gqtp, :command], :default => :http
 
     # alias is just for backward compatibility
     config_param :store_table, :string, :default => nil, :alias => :table
-------------- next part --------------
HTML����������������������������...
Download 



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