SUZUKI Miho
null+****@clear*****
Tue Oct 30 11:22:59 JST 2012
SUZUKI Miho 2012-10-30 11:22:59 +0900 (Tue, 30 Oct 2012) New Revision: 5b17c6fb31185910aa64e098e922a61f5efcfeae https://github.com/logaling/logaling-command/commit/5b17c6fb31185910aa64e098e922a61f5efcfeae Merged 2e9a0db: Merge pull request #86 from logaling/add-index-interface Log: Fix indent Modified files: lib/logaling/command/application.rb Modified: lib/logaling/command/application.rb (+19 -19) =================================================================== --- lib/logaling/command/application.rb 2012-10-29 11:31:03 +0900 (be9b160) +++ lib/logaling/command/application.rb 2012-10-30 11:22:59 +0900 (0af57d2) @@ -158,25 +158,25 @@ module Logaling::Command say "#{@config.glossary} is not yet registered." end - desc 'config [KEY] [VALUE] [--global(optional)]', 'Set config.' - method_option "global", type: :boolean, default: false - def config(key, value) - if options["global"] - unless File.exist?(@logaling_home) - FileUtils.mkdir_p(@logaling_home) rescue raise Logaling::CommandFailed, "Input existing directory as logaling-home." - end - config_path = File.join(@logaling_home, "config") - else - raise Logaling::CommandFailed, "Can't found .logaling" unless @project_config_path - config_path = @project_config_path - end - config = Logaling::Config.load(config_path) - config.add(key, value) - config.save(config_path) - say "Successfully set config." - rescue Logaling::CommandFailed => e - say e.message - end + desc 'config [KEY] [VALUE] [--global(optional)]', 'Set config.' + method_option "global", type: :boolean, default: false + def config(key, value) + if options["global"] + unless File.exist?(@logaling_home) + FileUtils.mkdir_p(@logaling_home) rescue raise Logaling::CommandFailed, "Input existing directory as logaling-home." + end + config_path = File.join(@logaling_home, "config") + else + raise Logaling::CommandFailed, "Can't found .logaling" unless @project_config_path + config_path = @project_config_path + end + config = Logaling::Config.load(config_path) + config.add(key, value) + config.save(config_path) + say "Successfully set config." + rescue Logaling::CommandFailed => e + say e.message + end desc 'add [SOURCE TERM] [TARGET TERM] [NOTE(optional)]', 'Add term to glossary.' def add(source_term, target_term, note='') -------------- next part -------------- An HTML attachment was scrubbed... ダウンロード