[logaling-commit] logaling/logaling-command [master] Return [] if exception occures when trying to load empty yaml file

Zurück zum Archiv-Index

null+****@clear***** null+****@clear*****
Thu Jun 28 18:24:25 JST 2012


SUZUKI Miho	2012-06-28 18:24:25 +0900 (Thu, 28 Jun 2012)

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

  Merged 53b8b7d: Merge pull request #61 from logaling/catch-load-file-exception

  Log:
    Return [] if exception occures when trying to load empty yaml file

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

  Modified: lib/logaling/glossary_sources/glossary_yaml_source.rb (+2 -0)
===================================================================
--- lib/logaling/glossary_sources/glossary_yaml_source.rb    2012-06-28 12:01:18 +0900 (2fa0110)
+++ lib/logaling/glossary_sources/glossary_yaml_source.rb    2012-06-28 18:24:25 +0900 (7650721)
@@ -29,6 +29,8 @@ module Logaling::GlossarySources
   class GlossaryYamlSource < Base
     def load
       YAML::load_file(source_path) || []
+    rescue
+      []
     end
 
     def add(source_term, target_term, note)
-------------- next part --------------
An HTML attachment was scrubbed...
Download 



More information about the logaling-commit mailing list
Zurück zum Archiv-Index