null+****@clear*****
null+****@clear*****
Sat Feb 18 21:26:39 JST 2012
SHIMADA Koji 2012-02-18 21:26:39 +0900 (Sat, 18 Feb 2012) New Revision: 000a0075438bc22a88dd14f1b0dee54f016f90c8 Log: Rename Config#merge to Config#merge! Modified files: lib/logaling/command/application.rb lib/logaling/config.rb Modified: lib/logaling/command/application.rb (+2 -2) =================================================================== --- lib/logaling/command/application.rb 2012-02-18 11:06:10 +0900 (1511c94) +++ lib/logaling/command/application.rb 2012-02-18 21:26:39 +0900 (88e88d0) @@ -36,7 +36,7 @@ module Logaling::Command @project_config_path = File.join(@dotfile_path, 'config') @config.load(@project_config_path) ensure - @config.merge(options) + @config.merge!(options) end map '-a' => :add, @@ -64,7 +64,7 @@ module Logaling::Command FileUtils.mkdir_p(File.join(logaling_config_path, "glossary")) config = Logaling::Config.new("glossary" => project_name, "source-language" => source_language) - config.merge("target-language" => target_language) if target_language + config.merge!("target-language" => target_language) if target_language config.save(File.join(logaling_config_path, "config")) register unless options["no-register"] Modified: lib/logaling/config.rb (+2 -2) =================================================================== --- lib/logaling/config.rb 2012-02-18 11:06:10 +0900 (953127d) +++ lib/logaling/config.rb 2012-02-18 21:26:39 +0900 (13eb538) @@ -33,7 +33,7 @@ module Logaling end end - def merge(config) + def merge!(config) keys.each do |key| @config[key] = config[key] if config[key] end @@ -51,7 +51,7 @@ module Logaling def add(key, value) raise Logaling::CommandFailed, "#{key} is unsupported option" unless support?(key) - merge(key => value) + merge!(key => value) end def save(config_path)