[logaling-commit] logaling/logaling-command [improve-index] [#19] change version class-variable to constant

Back to archive index

null+****@clear***** null+****@clear*****
Mon Jan 23 17:25:14 JST 2012


SUZUKI Miho	2012-01-23 17:25:14 +0900 (Mon, 23 Jan 2012)

  New Revision: 202683f6cd374d52d367e8f852b1b1c23e7e7b84

  Log:
    [#19] change version class-variable to constant

  Modified files:
    lib/logaling/glossary_db.rb

  Modified: lib/logaling/glossary_db.rb (+3 -3)
===================================================================
--- lib/logaling/glossary_db.rb    2012-01-23 17:02:37 +0900 (28fd175)
+++ lib/logaling/glossary_db.rb    2012-01-23 17:25:14 +0900 (1344d45)
@@ -20,7 +20,7 @@ require 'cgi'
 
 module Logaling
   class GlossaryDB
-    @@version = 1
+    VERSION = 1
 
     def self.open(base_path, encoding, &blk)
       blk ? GlossaryDB.new.open(base_path, encoding, &blk) : GlossaryDB.new.open(base_path, encoding)
@@ -50,10 +50,10 @@ module Logaling
 
     def recreate_table
       version = Groonga["configurations"] ? get_config("version") : 0
-      if version.to_i != @@version
+      if version.to_i != VERSION
         remove_schema
         populate_schema
-        add_config("version", @@version.to_s)
+        add_config("version", VERSION.to_s)
       end
     end
 




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