Kouhei Sutou
null+****@clear*****
Sun Jan 5 15:03:12 JST 2014
Kouhei Sutou 2014-01-05 15:03:12 +0900 (Sun, 05 Jan 2014) New Revision: 84d7d5478dfd0d13937abf94716bb6d79052d452 https://github.com/ranguba/chupa-text/commit/84d7d5478dfd0d13937abf94716bb6d79052d452 Message: configuration: add "s" to "mime_type" mime_type["EXTENSION"] = "MIME type" mime_types["EXTENSION"] = "MIME type" + Modified files: data/mime-types.conf doc/text/command-line.md lib/chupa-text/configuration-loader.rb Modified: data/mime-types.conf (+11 -11) =================================================================== --- data/mime-types.conf 2014-01-05 15:00:03 +0900 (415315f) +++ data/mime-types.conf 2014-01-05 15:03:12 +0900 (f4e9251) @@ -1,19 +1,19 @@ # -*- ruby -*- -mime_type["txt"] = "text/plain" +mime_types["txt"] = "text/plain" -mime_type["gz"] = "application/x-gzip" -mime_type["tgz"] = "application/x-gtar-compressed" +mime_types["gz"] = "application/x-gzip" +mime_types["tgz"] = "application/x-gtar-compressed" -mime_type["tar"] = "application/x-tar" +mime_types["tar"] = "application/x-tar" -mime_type["htm"] = "text/html" -mime_type["html"] = "text/html" -mime_type["xhtml"] = "application/xhtml+xml" +mime_types["htm"] = "text/html" +mime_types["html"] = "text/html" +mime_types["xhtml"] = "application/xhtml+xml" -mime_type["xml"] = "text/xml" +mime_types["xml"] = "text/xml" -mime_type["css"] = "text/css" +mime_types["css"] = "text/css" -mime_type["csv"] = "text/csv" -mime_type["tsv"] = "text/tab-separated-values" +mime_types["csv"] = "text/csv" +mime_types["tsv"] = "text/tab-separated-values" Modified: doc/text/command-line.md (+2 -2) =================================================================== --- doc/text/command-line.md 2014-01-05 15:00:03 +0900 (68a256d) +++ doc/text/command-line.md 2014-01-05 15:03:12 +0900 (99384a8) @@ -123,14 +123,14 @@ command. You can use glob pattern for decomposer name such as The default is `["*"]`. It means that all installed decomposers are used. -`mime_type["<extension>"] = "<MIME type>"` +`mime_types["<extension>"] = "<MIME type>"` It specifies a map to a MIME type from path extension. Here is an example that maps `"html"` to `"text/html"`: ``` -mime_type["html"] = "text/html" +mime_types["html"] = "text/html" ``` Th default configuration file registers popular MIME types. Modified: lib/chupa-text/configuration-loader.rb (+3 -3) =================================================================== --- lib/chupa-text/configuration-loader.rb 2014-01-05 15:00:03 +0900 (7c9452b) +++ lib/chupa-text/configuration-loader.rb 2014-01-05 15:03:12 +0900 (6b9a532) @@ -19,11 +19,11 @@ require "pathname" module ChupaText class ConfigurationLoader attr_reader :decomposer - attr_reader :mime_type + attr_reader :mime_types def initialize(configuration) @configuration = configuration @decomposer = DecomposerLoader.new(@configuration.decomposer) - @mime_type = MIMETypeLoader.new(@configuration.mime_type_registry) + @mime_types = MIMETypesLoader.new(@configuration.mime_type_registry) @load_paths = [] data_dir = File.join(File.dirname(__FILE__), "..", "..", "data") @load_paths << File.expand_path(data_dir) @@ -82,7 +82,7 @@ module ChupaText end end - class MIMETypeLoader + class MIMETypesLoader def initialize(registry) @registry = registry end -------------- next part -------------- HTML����������������������������... Download