mime-types-data 3.2021.0901 → 3.2022.0105

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f40bea4c5d709c148476efec495771821bc916cce98149c83d6c05eee7820a9e
4
- data.tar.gz: 94987bbb7faa5b7bc4487f6f62e429a12a0856e0ef13de60953f536a3ee775bb
3
+ metadata.gz: 329d601098ccd4e2d3978e6e323230a2ae19d2349f869711d899207c19b16994
4
+ data.tar.gz: 1dedab8c410c72bb0c84cb089000b87003a026ac109b9bf7cac165b102720fac
5
5
  SHA512:
6
- metadata.gz: c302a040acf34de1c21274f3ad6e5a0e0ec57f921c49f9b12786a2a50cab7d4a47f1dee7a2699beb38a33c5bbb68d938fc468e241e03b60e2f6a863f2e6ae88a
7
- data.tar.gz: f80d8d7ec405f9ec1655ab079fdde98b522bf76aa4df80ea5eb170f35ce092d31964d8b8c3a617e5be6765aeff0fd8c1dfbb185b479bc5847ac5f06cca7de4ad
6
+ metadata.gz: 1c2c164f48716aebc3caed14a571f783aea3397cb218b6bc494c960561304a593a8e13c7f6362e1d9abd900c3c6b7752fa2cc8bdae6fb41681178fa3186dddbe
7
+ data.tar.gz: 3272473043d3359581c716e0fff76225219302573f7a1c31c7755b6fce7a4ad40aa0f183889e55f61fb043133562ba2e682b214cb2843df5340bc5ad50b3b8a3
data/Code-of-Conduct.md CHANGED
@@ -4,10 +4,10 @@
4
4
 
5
5
  In the interest of fostering an open and welcoming environment, we as
6
6
  contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age,
8
- body size, disability, ethnicity, gender identity and expression, level of
9
- experience, nationality, personal appearance, race, religion, or sexual
10
- identity and orientation.
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of
9
+ experience, nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
11
 
12
12
  ## Our Standards
13
13
 
@@ -37,20 +37,20 @@ Project maintainers are responsible for clarifying the standards of acceptable
37
37
  behavior and are expected to take appropriate and fair corrective action in
38
38
  response to any instances of unacceptable behavior.
39
39
 
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
40
+ Project maintainers have the right and responsibility to remove, edit, or reject
41
+ comments, commits, code, wiki edits, issues, and other contributions that are
42
+ not aligned to this Code of Conduct, or to ban temporarily or permanently any
43
+ contributor for other behaviors that they deem inappropriate, threatening,
44
+ offensive, or harmful.
45
45
 
46
46
  ## Scope
47
47
 
48
48
  This Code of Conduct applies both within project spaces and in public spaces
49
49
  when an individual is representing the project or its community. Examples of
50
50
  representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an
52
- appointed representative at an online or offline event. Representation of a
53
- project may be further defined and clarified by project maintainers.
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
54
 
55
55
  ## Enforcement
56
56
 
data/Contributing.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ## Contributing
2
2
 
3
3
  Contributions to mime-types-data is encouraged in any form: a bug report, new
4
- MIME type defintions, or additional code to help manage the MIME types. As with
4
+ MIME type definitions, or additional code to help manage the MIME types. As with
5
5
  many of my projects, I have a few suggestions for improving the chance of
6
6
  acceptance of your code contributions:
7
7
 
@@ -26,12 +26,12 @@ other languages.
26
26
  The Ruby mime-types gem loads its data from files encoded in the `data`
27
27
  directory in this gem by loading `mime-types-data` and reading
28
28
  MIME::Types::Data::PATH. These files are compiled files from the collection of
29
- data in the `types` directory. Pull requests that include changes to these
30
- files will require amendment to revert these files.
29
+ data in the `types` directory. Pull requests that include changes to these files
30
+ will require amendment to revert these files.
31
31
 
32
32
  New or modified MIME types should be edited in the appropriate YAML file under
33
- `types`. The format is as shown below for the `application/xml` MIME type
34
- in `types/application.yml`.
33
+ `types`. The format is as shown below for the `application/xml` MIME type in
34
+ `types/application.yml`.
35
35
 
36
36
  ```yaml
37
37
  - !ruby/object:MIME::Type
@@ -43,7 +43,7 @@ in `types/application.yml`.
43
43
  references:
44
44
  - IANA
45
45
  - RFC3023
46
- xrefs: !ruby/hash:MIME::Types::Container
46
+ xrefs:
47
47
  rfc:
48
48
  - rfc3023
49
49
  registered: true
@@ -51,10 +51,10 @@ in `types/application.yml`.
51
51
 
52
52
  There are other fields that can be added, matching the fields discussed in the
53
53
  documentation for MIME::Type. Pull requests for MIME types should just contain
54
- the changes to the YAML files for the new or modified MIME types; I will
55
- convert the YAML files to JSON prior to a new release. I would rather not have
56
- to verify that the JSON matches the YAML changes, which is why it is not
57
- necessary to convert for the pull request.
54
+ the changes to the YAML files for the new or modified MIME types; I will convert
55
+ the YAML files to JSON prior to a new release. I would rather not have to verify
56
+ that the JSON matches the YAML changes, which is why it is not necessary to
57
+ convert for the pull request.
58
58
 
59
59
  If you are making a change for a private fork, use `rake convert:yaml:json` to
60
60
  convert the YAML to JSON, or `rake convert:yaml:columnar` to convert it to the
@@ -70,6 +70,21 @@ $ rake mime:iana
70
70
  $ rake mime:apache
71
71
  ```
72
72
 
73
+ ##### A Note on Provisional Types
74
+
75
+ The file `types/provisional-standard-types.yaml` contains the provisionally
76
+ registered types from IANA. Per IANA,
77
+
78
+ > This registry, unlike some other provisional IANA registries, is only for
79
+ > temporary use. Entries in this registry are either finalized and moved to the
80
+ > main media types registry or are abandoned and deleted. Entries in this
81
+ > registry are suitable for use for development and test purposes only.
82
+
83
+ The provisional types file is rewritten when updated, so pull requests to
84
+ manually promote or customize provisional types (such as with extensions). It is
85
+ recommended that any updates required to the data be performed in your
86
+ application if you require provisional types.
87
+
73
88
  ### Development Dependencies
74
89
 
75
90
  mime-types-data uses Ryan Davis’s {Hoe}[https://github.com/seattlerb/hoe] to
@@ -132,10 +147,10 @@ Here's the most direct way to get your work merged into the project:
132
147
  The release process needs automation; as it includes generating code and
133
148
  committing to the repository, it is not clear how this will happen safely.
134
149
 
135
- 1. Review any outstanding issues or pull requests to see if anything needs to
136
- be addressed. This is necessary because there is currently no automated
137
- source for extensions for the thousands of MIME entries. (Suggestions and/or
138
- pull requests for same would be deeply appreciated.)
150
+ 1. Review any outstanding issues or pull requests to see if anything needs to be
151
+ addressed. This is necessary because there is currently no automated source
152
+ for extensions for the thousands of MIME entries. (Suggestions and/or pull
153
+ requests for same would be deeply appreciated.)
139
154
  2. `bundle install`
140
155
  3. `bundle exec rake mime:apache`
141
156
  4. `bundle exec rake mime:iana`
@@ -145,18 +160,18 @@ committing to the repository, it is not clear how this will happen safely.
145
160
  category.)
146
161
  6. `bundle exec rake convert`
147
162
  7. `bundle exec rake update:version`
148
- 8. Write up the changes in History.md. If any PRs have been merged, these
149
- should be noted specifically.
163
+ 8. Write up the changes in History.md. If any PRs have been merged, these should
164
+ be noted specifically.
150
165
  9. Commit the changes and push to GitHub.
151
166
  10. `bundle exec rake release VERSION=newversion`
152
167
 
153
168
  ### Automating the Release
154
169
 
155
- If anyone wishes to provide suggestions on automation, this would be a
156
- two-phase process:
170
+ If anyone wishes to provide suggestions on automation, this would be a two-phase
171
+ process:
157
172
 
158
- 1. A system would need to periodically create PRs to the GitHub repository
159
- with the output of the following commands (steps 2, 3, and 4):
173
+ 1. A system would need to periodically create PRs to the GitHub repository with
174
+ the output of the following commands (steps 2, 3, and 4):
160
175
 
161
176
  ```sh
162
177
  bundle install
@@ -198,6 +213,7 @@ Thanks to everyone else who has contributed to mime-types:
198
213
  - Henrik Hodne
199
214
  - Jeremy Evans
200
215
  - John Gardner
216
+ - Jon Sneyers
201
217
  - Jonas Petersen
202
218
  - Juanito Fatas
203
219
  - Keerthi Siva
data/History.md CHANGED
@@ -2,11 +2,29 @@
2
2
 
3
3
  <!-- automatic-release -->
4
4
 
5
+ ## 3.2022.0105 / 2022-01-05
6
+
7
+ - Updated the Apache and IANA media registry entries as of release date.
8
+
9
+ - Fixed an incorrect definition of `image/bmp`, which had been marked obsolete
10
+ and later registered. Fixed [#48], found by William T. Nelson.
11
+
12
+ ## 3.2021.1115 / 2021-11-15
13
+
14
+ - Updated the Apache and IANA media registry entries as of release date.
15
+
16
+ - Added conversion utilities that support the `mini_mime` data format. These
17
+ have been ported from the [mini_mime] repository. [#47]
18
+
19
+ - Added IANA provisional media registries. Added some notes to Contributing.md
20
+ about the transient nature of the provisional registration data. This was
21
+ triggered in part by a pull request by Jon Sneyers. Thanks! [#45], [#43]
22
+
5
23
  ## 3.2021.0901 / 2021-09-01
6
24
 
7
25
  - Updated the Apache and IANA media registry entries as of release date.
8
26
 
9
- - Added file extension for WebVTT text format. [#46].
27
+ - Added file extension for WebVTT text format. [#46]
10
28
 
11
29
  ## 3.2021.0704 / 2021-07-04
12
30
 
@@ -16,7 +34,7 @@
16
34
 
17
35
  - Updated the Apache and IANA media registry entries as of release date.
18
36
 
19
- - Added file extension for AVIF video format. [#40].
37
+ - Added file extension for AVIF video format. [#40]
20
38
 
21
39
  ## 3.2021.0212 / 2021-02-12
22
40
 
@@ -31,47 +49,47 @@
31
49
 
32
50
  - Updated the IANA media registry entries as of release date.
33
51
 
34
- - Added `application/x-zip-compressed`. [#36].
52
+ - Added `application/x-zip-compressed`. [#36]
35
53
 
36
54
  - Updated the contributing guide to include information about the release
37
- process as described in [#18].
55
+ process as described in [#18]
38
56
 
39
- - Corrected a misspelling of Yoran Brondsema’s name. Sorry, Yoran. [#35].
57
+ - Corrected a misspelling of Yoran Brondsema’s name. Sorry, Yoran. [#35]
40
58
 
41
59
  ## 3.2020.0512 / 2020-05-12
42
60
 
43
61
  - Updated the IANA media registry entries as of release date.
44
62
 
45
- - Added file extensions for HEIC image types. [#34].
63
+ - Added file extensions for HEIC image types. [#34]
46
64
 
47
65
  ## 3.2020.0425 / 2020-04-25
48
66
 
49
67
  - Updated the IANA media registry entries as of release date.
50
68
 
51
69
  - Added several RAW image types based on data from GNOME RAW Thumbnailer.
52
- [#33] fixing [#32].
70
+ [#33] fixing [#32]
53
71
 
54
- - Added `audio/wav`. [#31].
72
+ - Added `audio/wav`. [#31]
55
73
 
56
- - Added a type for Smarttech notebook files. [#30].
74
+ - Added a type for Smarttech notebook files. [#30]
57
75
 
58
- - Added an alias for audio/m4a files. [#29].
76
+ - Added an alias for audio/m4a files. [#29]
59
77
 
60
- - Added application/x-ms-dos-executable. [#28].
78
+ - Added application/x-ms-dos-executable. [#28]
61
79
 
62
80
  ## 3.2019.1009 / 2019-10-09
63
81
 
64
82
  - Updated the IANA media registry entries as of release date.
65
83
 
66
84
  - Reordered the `.ai` extension so that it is not the preferred extension for
67
- `application/pdf` [#24].
85
+ `application/pdf` [#24]
68
86
 
69
87
  ## 3.2019.0904 / 2019-09-04
70
88
 
71
89
  - Updated the IANA media registry entries as of release date.
72
90
 
73
91
  - Moved the `.ai` extension from `application/postscript` to `application/pdf`.
74
- [#23] fixing [#22].
92
+ [#23] fixing [#22]
75
93
 
76
94
  ## 3.2019.0331 / 2019-03-31
77
95
 
@@ -474,6 +492,11 @@
474
492
  [#35]: https://github.com/mime-types/mime-types-data/pull/35
475
493
  [#36]: https://github.com/mime-types/mime-types-data/pull/36
476
494
  [#40]: https://github.com/mime-types/mime-types-data/pull/40
495
+ [#43]: https://github.com/mime-types/mime-types-data/pull/43
496
+ [#45]: https://github.com/mime-types/mime-types-data/pull/45
477
497
  [#46]: https://github.com/mime-types/mime-types-data/pull/46
498
+ [#47]: https://github.com/mime-types/mime-types-data/pull/47
499
+ [#48]: https://github.com/mime-types/mime-types-data/issues/48
478
500
  [rmt]: https://github.com/mime-types/ruby-mime-types
479
501
  [code of conduct]: Code-of-Conduct.md
502
+ [mini_mime]: https://github.com/discourse/mini_mime/issues/41
data/Licence.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## Licence
2
2
 
3
- - Copyright 2003–2020 Austin Ziegler and other contributors.
3
+ - Copyright 2003–2021 Austin Ziegler and other contributors.
4
4
 
5
5
  The software in this repository is made available under the MIT license.
6
6
 
@@ -9,17 +9,16 @@ The software in this repository is made available under the MIT license.
9
9
  Permission is hereby granted, free of charge, to any person obtaining a copy of
10
10
  this software and associated documentation files (the "Software"), to deal in
11
11
  the Software without restriction, including without limitation the rights to
12
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
13
- of the Software, and to permit persons to whom the Software is furnished to do
14
- so, subject to the following conditions:
12
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
13
+ the Software, and to permit persons to whom the Software is furnished to do so,
14
+ subject to the following conditions:
15
15
 
16
16
  The above copyright notice and this permission notice shall be included in all
17
17
  copies or substantial portions of the Software.
18
18
 
19
19
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
- SOFTWARE.
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
21
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
22
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
23
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Manifest.txt CHANGED
@@ -5,6 +5,8 @@ Licence.md
5
5
  Manifest.txt
6
6
  README.md
7
7
  Rakefile
8
+ data/content_type_mime.db
9
+ data/ext_mime.db
8
10
  data/mime-types.json
9
11
  data/mime.content_type.column
10
12
  data/mime.docs.column
@@ -26,6 +28,7 @@ types/image.yaml
26
28
  types/message.yaml
27
29
  types/model.yaml
28
30
  types/multipart.yaml
31
+ types/provisional-standard-types.yaml
29
32
  types/text.yaml
30
33
  types/video.yaml
31
34
  types/world.yaml
data/README.md CHANGED
@@ -24,7 +24,7 @@ contributions. It conforms to RFCs 2045 and 2231.
24
24
 
25
25
  ### Data Formats Supported in this Registry
26
26
 
27
- This registry contains the MIME media types in three formats:
27
+ This registry contains the MIME media types in four formats:
28
28
 
29
29
  - A YAML format matching the Ruby mime-types library objects (MIME::Type).
30
30
  This is the primary user-editable format for developers. It is _not_
@@ -38,6 +38,15 @@ This registry contains the MIME media types in three formats:
38
38
  substantially, resulting in a performance improvement at the cost of more
39
39
  complex code for loading the data on-demand. This is the default format for
40
40
  Ruby mime-types 3.0.
41
+ - An encoded text format for use with [`mini_mime`][] (as of 3.2021.1108). This
42
+ can be enabled with:
43
+
44
+ ```ruby
45
+ MiniMime::Configuration.ext_db_path =
46
+ File.join(MIME::Types::Data::PATH, "ext_mime.db")
47
+ MiniMime::Configuration.content_type_db_path =
48
+ File.join(MIME::Types::Data::PATH, "content_type_mime.db")
49
+ ```
41
50
 
42
51
  ## mime-types-data Modified Semantic Versioning
43
52
 
@@ -61,3 +70,4 @@ the date of the data update: `SCHEMA.YEAR.MONTHDAY`.
61
70
 
62
71
  [registry]: https://www.iana.org/assignments/media-types/media-types.xhtml
63
72
  [semantic versioning]: http://semver.org/
73
+ [`mini_mime`]: https://github.com/discourse/mini_mime
data/Rakefile CHANGED
@@ -1,140 +1,135 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rubygems'
4
- require 'hoe'
5
- require 'rake/clean'
3
+ require "rubygems"
4
+ require "hoe"
5
+ require "rake/clean"
6
6
 
7
7
  Hoe.plugin :doofus
8
8
  Hoe.plugin :gemspec2
9
9
  Hoe.plugin :git
10
10
  Hoe.plugin :travis
11
- Hoe.plugin :email unless ENV['CI'] or ENV['TRAVIS']
11
+ Hoe.plugin :email unless ENV["CI"] || ENV["TRAVIS"]
12
12
 
13
- Hoe.spec 'mime-types-data' do
14
- developer('Austin Ziegler', 'halostatue@gmail.com')
13
+ Hoe.spec "mime-types-data" do
14
+ developer("Austin Ziegler", "halostatue@gmail.com")
15
15
 
16
- require_ruby_version '>= 2.0'
16
+ require_ruby_version ">= 2.0"
17
17
 
18
- self.history_file = 'History.md'
19
- self.readme_file = 'README.md'
18
+ self.history_file = "History.md"
19
+ self.readme_file = "README.md"
20
20
 
21
- license 'MIT'
21
+ license "MIT"
22
22
 
23
- extra_dev_deps << [ 'nokogiri', '~> 1.6' ]
24
- extra_dev_deps << [ 'hoe-doofus', '~> 1.0' ]
25
- extra_dev_deps << [ 'hoe-gemspec2', '~> 1.1' ]
26
- extra_dev_deps << [ 'hoe-git', '~> 1.6' ]
27
- extra_dev_deps << [ 'hoe-rubygems', '~> 1.0' ]
28
- extra_dev_deps << [ 'rake', '>= 10.0', '< 14' ]
29
- extra_dev_deps << [ 'mime-types', '>= 3.2.1', '< 4' ]
23
+ extra_dev_deps << ["nokogiri", "~> 1.6"]
24
+ extra_dev_deps << ["hoe-doofus", "~> 1.0"]
25
+ extra_dev_deps << ["hoe-gemspec2", "~> 1.1"]
26
+ extra_dev_deps << ["hoe-git", "~> 1.6"]
27
+ extra_dev_deps << ["hoe-rubygems", "~> 1.0"]
28
+ extra_dev_deps << ["rake", ">= 10.0", "< 14"]
29
+ extra_dev_deps << ["mime-types", ">= 3.4.0", "< 4"]
30
+ extra_dev_deps << ["standardrb", "~> 1.0"]
31
+ extra_dev_deps << ["psych", "~> 3.0"]
30
32
  end
31
33
 
32
- $LOAD_PATH.unshift 'lib'
33
- $LOAD_PATH.unshift 'support'
34
+ $LOAD_PATH.unshift "lib"
35
+ $LOAD_PATH.unshift "support"
34
36
 
35
37
  def new_version
36
38
  version =
37
- IO.read('lib/mime/types/data.rb').scan(/VERSION = '(\d\.\d{4}\.\d{4})'/).flatten.first
39
+ IO.read("lib/mime/types/data.rb").scan(/VERSION = ['"](\d\.\d{4}\.\d{4})['"]/).flatten.first
38
40
 
39
41
  major = Gem::Version.new(version).canonical_segments.first
40
- minor = Date.today.strftime('%Y.%m%d')
42
+ minor = Date.today.strftime("%Y.%m%d")
41
43
 
42
44
  "#{major}.#{minor}"
43
45
  end
44
46
 
45
47
  def release_header
46
- "#{new_version} / #{Date.today.strftime('%Y-%m-%d')}"
48
+ "#{new_version} / #{Date.today.strftime("%Y-%m-%d")}"
47
49
  end
48
50
 
49
51
  namespace :mime do
50
- desc 'Download the current MIME type registrations from IANA.'
51
- task :iana, [ :destination ] do |_, args|
52
- require 'iana_registry'
52
+ desc "Download the current MIME type registrations from IANA."
53
+ task :iana, [:destination] do |_, args|
54
+ require "iana_registry"
53
55
  IANARegistry.download(to: args.destination)
54
56
  end
55
57
 
56
- desc 'Download the current MIME type configuration from Apache.'
57
- task :apache, [ :destination ] do |_, args|
58
- require 'apache_mime_types'
58
+ desc "Download the current MIME type configuration from Apache."
59
+ task :apache, [:destination] do |_, args|
60
+ require "apache_mime_types"
59
61
  ApacheMIMETypes.download(to: args.destination)
60
62
  end
61
63
  end
62
64
 
63
65
  namespace :release do
64
- task __pull: %w(mime:apache mime:iana convert)
65
- task __prepare: %w(update:version update:history git:manifest)
66
+ task __pull: %w[mime:apache mime:iana convert]
67
+ task __prepare: %w[update:version update:history git:manifest]
66
68
  task :__commit do
67
- history = IO.read('History.md')
69
+ history = IO.read("History.md")
68
70
  message = history.scan(%r{## (#{release_header}.+?)## \d\.\d{4}\.\d{4} /}m).flatten.first
69
71
 
70
- IO.popen('git commit -a -F -', 'w') { |commit|
72
+ IO.popen("git commit -a -F -", "w") { |commit|
71
73
  commit.puts message
72
74
  }
73
75
  end
74
76
 
75
- desc 'Prepare a new automatic release'
77
+ desc "Prepare a new automatic release"
76
78
  task automatic: :__pull do
77
- if system('git diff --quiet --exit-code') == false
78
- Rake::Task['release:__prepare'].invoke
79
- Rake::Task['gemspec'].invoke
80
- Rake::Task['release:__commit'].invoke
79
+ if system("git diff --quiet --exit-code") == false
80
+ Rake::Task["release:__prepare"].invoke
81
+ Rake::Task["gemspec"].invoke
82
+ Rake::Task["release:__commit"].invoke
81
83
  else
82
- warn 'No changes detected.'
84
+ warn "No changes detected."
83
85
  end
84
-
85
- # file = IO.read('History.md')
86
- # note = <<-NOTE
87
- # <!-- automatic-release -->
88
-
89
- # ## #{new_version} / #{Date.today.strftime('%Y-%m-%d')}
90
-
91
- # - Updated the IANA media registry entries as of release date.
92
- # NOTE
93
-
94
- # updated = file.sub(/<!-- automatic-release -->\n/, note)
95
-
96
- # IO.write('History.md', updated)
97
86
  end
98
87
  end
99
88
 
100
89
  namespace :convert do
101
90
  namespace :yaml do
102
- desc 'Convert from YAML to JSON'
103
- task :json, [ :source, :destination, :multiple_files ] => :support do |_, args|
104
- require 'convert'
91
+ desc "Convert from YAML to JSON"
92
+ task :json, [:source, :destination, :multiple_files] => :support do |_, args|
93
+ require "convert"
105
94
  Convert.from_yaml_to_json(args)
106
95
  end
107
96
 
108
- desc 'Convert from YAML to Columnar'
109
- task :columnar, [ :source, :destination ] => :support do |_, args|
110
- require 'convert/columnar'
97
+ desc "Convert from YAML to Columnar"
98
+ task :columnar, [:source, :destination] => :support do |_, args|
99
+ require "convert/columnar"
111
100
  Convert::Columnar.from_yaml_to_columnar(args)
112
101
  end
102
+
103
+ desc "Convert from YAML to mini_mime db format"
104
+ task :mini_mime, [:source, :destination] => :support do |_, args|
105
+ require "convert/mini_mime_db"
106
+ Convert::MiniMimeDb.from_yaml_to_mini_mime(args)
107
+ end
113
108
  end
114
109
 
115
110
  namespace :json do
116
- desc 'Convert from JSON to YAML'
117
- task :yaml, [ :source, :destination, :multiple_files ] => :support do |_, args|
118
- require 'convert'
111
+ desc "Convert from JSON to YAML"
112
+ task :yaml, [:source, :destination, :multiple_files] => :support do |_, args|
113
+ require "convert"
119
114
  Convert.from_json_to_yaml(args)
120
115
  end
121
116
  end
122
117
  end
123
118
 
124
119
  namespace :update do
125
- desc 'Update the release version'
120
+ desc "Update the release version"
126
121
  task :version do
127
- file = IO.read('lib/mime/types/data.rb')
128
- updated = file.sub(/VERSION = '[^']+'/, "VERSION = '#{new_version}'")
122
+ file = IO.read("lib/mime/types/data.rb")
123
+ updated = file.sub(/VERSION = ['"][.0-9]+['"]/, %Q(VERSION = "#{new_version}"))
129
124
 
130
- IO.write('lib/mime/types/data.rb', updated)
125
+ IO.write("lib/mime/types/data.rb", updated)
131
126
  end
132
127
 
133
- desc 'Update the history file with automatic release notes'
128
+ desc "Update the history file with automatic release notes"
134
129
  task :history do
135
- history = IO.read('History.md')
130
+ history = IO.read("History.md")
136
131
 
137
- if history !~ /^## #{release_header}$/
132
+ if !/^## #{release_header}$/.match?(history)
138
133
  note = <<-NOTE
139
134
  <!-- automatic-release -->
140
135
 
@@ -145,16 +140,16 @@ namespace :update do
145
140
 
146
141
  updated = history.sub(/<!-- automatic-release -->\n/, note)
147
142
 
148
- IO.write('History.md', updated)
143
+ IO.write("History.md", updated)
149
144
  end
150
145
  end
151
146
  end
152
147
 
153
- desc 'Default conversion from YAML to JSON and Columnar'
154
- task convert: [ 'convert:yaml:json', 'convert:yaml:columnar' ]
148
+ desc "Default conversion from YAML to JSON and Columnar"
149
+ task convert: ["convert:yaml:json", "convert:yaml:columnar", "convert:yaml:mini_mime"]
155
150
 
156
- Rake::Task['gem'].prerequisites.unshift('convert')
157
- Rake::Task['gem'].prerequisites.unshift('git:manifest')
158
- Rake::Task['gem'].prerequisites.unshift('gemspec')
151
+ Rake::Task["gem"].prerequisites.unshift("convert")
152
+ Rake::Task["gem"].prerequisites.unshift("git:manifest")
153
+ Rake::Task["gem"].prerequisites.unshift("gemspec")
159
154
 
160
155
  # vim: syntax=ruby