[logaling-commit] logaling/logaling-command [master] Change parameter to GlossarySource object

Back to archive index

null+****@clear***** null+****@clear*****
Tue Jun 19 19:21:24 JST 2012


SUZUKI Miho	2012-06-19 19:21:24 +0900 (Tue, 19 Jun 2012)

  New Revision: e2f66697acb14819282207d3d699cc22705a38c1
  https://github.com/logaling/logaling-command/commit/e2f66697acb14819282207d3d699cc22705a38c1

  Merged 7228757: Merge pull request #60 from logaling/refactor-structure

  Log:
    Change parameter to GlossarySource object

  Modified files:
    lib/logaling/glossary.rb
    lib/logaling/glossary_db.rb
    lib/logaling/repository.rb

  Modified: lib/logaling/glossary.rb (+1 -1)
===================================================================
--- lib/logaling/glossary.rb    2012-06-19 19:12:50 +0900 (691fe4f)
+++ lib/logaling/glossary.rb    2012-06-19 19:21:24 +0900 (c235337)
@@ -84,7 +84,7 @@ module Logaling
       Logaling::GlossaryDB.open(@project.glossary_db_path, "utf8") do |db|
         db.recreate_table
         glossary_sources.each do |glossary_source|
-          unless db.glossary_source_exist?(glossary_source.source_path, glossary_source.mtime)
+          unless db.glossary_source_exist?(glossary_source)
             puts "now index #{@name}..."
             db.index_glossary_source(glossary_source)
           end

  Modified: lib/logaling/glossary_db.rb (+3 -3)
===================================================================
--- lib/logaling/glossary_db.rb    2012-06-19 19:12:50 +0900 (480ab24)
+++ lib/logaling/glossary_db.rb    2012-06-19 19:21:24 +0900 (542412b)
@@ -216,11 +216,11 @@ module Logaling
       records.expression.close
     end
 
-    def glossary_source_exist?(glossary_source, indexed_at)
+    def glossary_source_exist?(glossary_source)
       glossary = Groonga["glossary_sources"].select do |record|
         [
-          record.key == glossary_source,
-          record.indexed_at == indexed_at
+          record.key == glossary_source.source_path,
+          record.indexed_at == glossary_source.mtime
         ]
       end
       !glossary.size.zero?

  Modified: lib/logaling/repository.rb (+1 -1)
===================================================================
--- lib/logaling/repository.rb    2012-06-19 19:12:50 +0900 (0dcd1e3)
+++ lib/logaling/repository.rb    2012-06-19 19:21:24 +0900 (9d4f733)
@@ -96,7 +96,7 @@ module Logaling
         all_glossary_sources.each do |glossary_source|
           indexed_at = glossary_source.mtime
           glossary = glossary_source.glossary
-          unless db.glossary_source_exist?(glossary_source.source_path, indexed_at)
+          unless db.glossary_source_exist?(glossary_source)
             puts "now index #{glossary.name}..."
             db.index_glossary(glossary, glossary_source)
           end
-------------- next part --------------
An HTML attachment was scrubbed...
下載 



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