[logaling-commit] logaling/logaling-command [do-index-when-change-glossary] [#38937341] Index when glossary changed

Back to archive index

SUZUKI Miho null+****@clear*****
Mon Nov 5 11:04:53 JST 2012


SUZUKI Miho	2012-11-05 11:04:53 +0900 (Mon, 05 Nov 2012)

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

  Log:
    [#38937341] Index when glossary changed

  Modified files:
    lib/logaling/command/application.rb
    spec/logaling/command_spec.rb

  Modified: lib/logaling/command/application.rb (+3 -1)
===================================================================
--- lib/logaling/command/application.rb    2012-10-30 14:57:02 +0900 (cade1d2)
+++ lib/logaling/command/application.rb    2012-11-05 11:04:53 +0900 (fc666d8)
@@ -204,6 +204,7 @@ module Logaling::Command
       glossary = project.glossary(@config.source_language, @config.target_language)
 
       glossary.add(source_term, target_term, note)
+      glossary.index!
     rescue Logaling::CommandFailed => e
       say e.message
     rescue Logaling::TermError => e
@@ -234,6 +235,7 @@ module Logaling::Command
       else
         glossary.delete_all(source_term, options["force"])
       end
+      glossary.index!
     rescue Logaling::CommandFailed, Logaling::TermError => e
       say e.message
     rescue Logaling::GlossaryNotFound => e
@@ -257,6 +259,7 @@ module Logaling::Command
       glossary = project.glossary(@config.source_language, @config.target_language)
 
       glossary.update(source_term, target_term, new_target_term, note)
+      glossary.index!
     rescue Logaling::CommandFailed => e
       say e.message
     rescue Logaling::TermError => e
@@ -276,7 +279,6 @@ module Logaling::Command
     method_option "fixed", type: :boolean, default: false
     def lookup(source_term)
       check_logaling_home_exists
-      @repository.index
       if****@confi*****
         project =****@repos*****_project(@config.glossary)
         raise Logaling::ProjectNotFound unless project

  Modified: spec/logaling/command_spec.rb (+1 -0)
===================================================================
--- spec/logaling/command_spec.rb    2012-10-30 14:57:02 +0900 (9fba53a)
+++ spec/logaling/command_spec.rb    2012-11-05 11:04:53 +0900 (a062e06)
@@ -576,6 +576,7 @@ describe Logaling::Command::Application do
       before do
         project = repository.find_project('spec')
         repository.unregister(project)
+        repository.index
         command.options = base_options.merge("no-pager" => true)
         @stdout = capture(:stdout) {command.list}
       end
-------------- next part --------------
An HTML attachment was scrubbed...
Descargar 



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