[logaling-commit] logaling/logaling-command [master] Extract GlossaryYamlSource#initialize_source

Back to archive index

SHIMADA Koji null+****@clear*****
Mon Aug 13 12:31:56 JST 2012


SHIMADA Koji	2012-08-13 12:31:56 +0900 (Mon, 13 Aug 2012)

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

  Merged 3c178f5: Merge pull request #74 from logaling/loga-new-no-project

  Log:
    Extract GlossaryYamlSource#initialize_source

  Modified files:
    lib/logaling/glossary_sources/glossary_yaml_source.rb

  Modified: lib/logaling/glossary_sources/glossary_yaml_source.rb (+5 -1)
===================================================================
--- lib/logaling/glossary_sources/glossary_yaml_source.rb    2012-08-13 11:37:41 +0900 (b2e7f16)
+++ lib/logaling/glossary_sources/glossary_yaml_source.rb    2012-08-13 12:31:56 +0900 (07ca46b)
@@ -34,7 +34,7 @@ module Logaling::GlossarySources
     end
 
     def add(source_term, target_term, note)
-      dump_glossary_source([]) unless File.exist?(source_path)
+      initialize_source unless File.exist?(source_path)
 
       glossary_source = self.load
       glossary_source << build_term(source_term, target_term, note)
@@ -88,6 +88,10 @@ module Logaling::GlossarySources
       end
     end
 
+    def initialize_source
+      dump_glossary_source([])
+    end
+
     private
     def build_term(source_term, target_term, note)
       note ||= ''
-------------- next part --------------
An HTML attachment was scrubbed...
Download 



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