null+****@clear*****
null+****@clear*****
Wed Jun 13 16:44:12 JST 2012
SUZUKI Miho 2012-06-13 16:44:12 +0900 (Wed, 13 Jun 2012) New Revision: e0d5922215dd2db29bcb56530547bfc32c27cc4b https://github.com/logaling/logaling-command/commit/e0d5922215dd2db29bcb56530547bfc32c27cc4b Merged 7228757: Merge pull request #60 from logaling/refactor-structure Log: Use glossary object instead of glossary source when run delete command Modified files: lib/logaling/command/application.rb lib/logaling/glossary.rb Modified: lib/logaling/command/application.rb (+4 -2) =================================================================== --- lib/logaling/command/application.rb 2012-06-13 16:38:53 +0900 (28bdc62) +++ lib/logaling/command/application.rb 2012-06-13 16:44:12 +0900 (3ee4d4c) @@ -192,11 +192,13 @@ module Logaling::Command } @config.check_required_option(required_options) check_logaling_home_exists + project =****@repos*****_project(@config.glossary) + glossary = project.find_glossary(@config.source_language, @config.target_language) if target_term - glossary_source.delete(source_term, target_term) + glossary.delete(source_term, target_term) else - glossary_source.delete_all(source_term, options["force"]) + glossary.delete_all(source_term, options["force"]) end rescue Logaling::CommandFailed, Logaling::TermError => e say e.message Modified: lib/logaling/glossary.rb (+8 -0) =================================================================== --- lib/logaling/glossary.rb 2012-06-13 16:38:53 +0900 (de40472) +++ lib/logaling/glossary.rb 2012-06-13 16:44:12 +0900 (90ad735) @@ -55,6 +55,14 @@ module Logaling glossary_source.update(source_term, target_term, new_target_term, note) end + def delete(source_term, target_term) + glossary_source.delete(source_term, target_term) + end + + def delete_all(source_term, force=false) + glossary_source.delete_all(source_term, force) + end + private def index Logaling::GlossaryDB.open(@project.glossary_db_path, "utf8") do |db| -------------- next part -------------- An HTML attachment was scrubbed... 下載