[Groonga-commit] groonga/groonga at ef35217 [master] mrb: use class instance variable instead of class variable

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jan 11 00:12:42 JST 2016


Kouhei Sutou	2016-01-11 00:12:42 +0900 (Mon, 11 Jan 2016)

  New Revision: ef3521733d24a176f9bcf96e08f3522102d27451
  https://github.com/groonga/groonga/commit/ef3521733d24a176f9bcf96e08f3522102d27451

  Message:
    mrb: use class instance variable instead of class variable
    
    Because the current mruby has a bug of class variable.

  Modified files:
    lib/mrb/scripts/expression_rewriters.rb

  Modified: lib/mrb/scripts/expression_rewriters.rb (+4 -4)
===================================================================
--- lib/mrb/scripts/expression_rewriters.rb    2016-01-10 23:57:05 +0900 (980ceb9)
+++ lib/mrb/scripts/expression_rewriters.rb    2016-01-11 00:12:42 +0900 (1bce331)
@@ -1,10 +1,10 @@
 module Groonga
   module ExpressionRewriters
-    @@rewriters = {}
+    @rewriters = {}
 
     class << self
       def register(name, rewriter_class)
-        @@rewriters[name] = rewriter_class
+        @rewriters[name] = rewriter_class
       end
 
       def classes
@@ -16,11 +16,11 @@ module Groonga
         rewriters_table.collect do |id|
           record = Record.new(rewriters_table, id)
           name = record.key
-          rewriter = @@rewriters[name]
+          rewriter = @rewriters[name]
           if rewriter.nil?
             plugin_name = record.plugin_name.value
             require plugin_name
-            rewriter = @@rewriters[name]
+            rewriter = @rewriters[name]
             raise "unknown rewriter: <#{name}>:<#{plugin_name}>" if rewriter.nil?
           end
           rewriter
-------------- next part --------------
HTML����������������������������...
Download 



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