Kouhei Sutou
null+****@clear*****
Fri Jan 3 23:23:33 JST 2014
Kouhei Sutou 2014-01-03 23:23:33 +0900 (Fri, 03 Jan 2014) New Revision: 31a9c6011e3e1912726456673efeb4af4ca0ef3a https://github.com/ranguba/chupa-text/commit/31a9c6011e3e1912726456673efeb4af4ca0ef3a Message: Add Configuration.default that loads the default chupa-text.conf Modified files: lib/chupa-text/command/chupa-text.rb lib/chupa-text/configuration.rb Modified: lib/chupa-text/command/chupa-text.rb (+1 -3) =================================================================== --- lib/chupa-text/command/chupa-text.rb 2014-01-03 23:23:07 +0900 (e2f16b8) +++ lib/chupa-text/command/chupa-text.rb 2014-01-03 23:23:33 +0900 (c38fde8) @@ -28,12 +28,10 @@ module ChupaText def initialize @input = nil - @configuration = Configuration.new + @configuration = Configuration.default end def run(*arguments) - load_configuration("chupa-text.conf") - return false unless parse_arguments(arguments) Decomposers.load Modified: lib/chupa-text/configuration.rb (+14 -0) =================================================================== --- lib/chupa-text/configuration.rb 2014-01-03 23:23:07 +0900 (ff6d18a) +++ lib/chupa-text/configuration.rb 2014-01-03 23:23:33 +0900 (16e9771) @@ -16,6 +16,20 @@ module ChupaText class Configuration + class << self + def default + @default ||= create_default + end + + private + def create_default + configuration = new + loader = ConfigurationLoader.new(configuration) + loader.load("chupa-text.conf") + configuration + end + end + attr_reader :decomposer attr_accessor :mime_type_registry def initialize -------------- next part -------------- HTML����������������������������...Download