mime-types-data 3.2024.1203 → 3.2025.0220

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -4,51 +4,37 @@ require "rubygems"
4
4
  require "hoe"
5
5
  require "rake/clean"
6
6
 
7
- Hoe.plugin :doofus
8
- Hoe.plugin :gemspec2
9
- Hoe.plugin :git2
10
- Hoe.plugin :rubygems
7
+ $LOAD_PATH.unshift("lib")
8
+ $LOAD_PATH.unshift("support")
9
+
10
+ Hoe.plugin :halostatue
11
+
12
+ Hoe.plugins.delete :debug
13
+ Hoe.plugins.delete :newb
14
+ Hoe.plugins.delete :publish
15
+ Hoe.plugins.delete :signing
11
16
 
12
17
  Hoe.spec "mime-types-data" do
13
18
  developer("Austin Ziegler", "halostatue@gmail.com")
14
19
 
15
- self.history_file = "History.md"
16
- self.readme_file = "README.md"
17
-
18
- license "MIT"
20
+ self.trusted_release = ENV["rubygems_release_gem"] == "true"
19
21
 
20
22
  require_ruby_version ">= 2.0"
21
23
 
22
- spec_extras[:metadata] = ->(val) { val["rubygems_mfa_required"] = "true" }
24
+ license "MIT"
25
+
26
+ spec_extras[:metadata] = ->(val) {
27
+ val.merge!({"rubygems_mfa_required" => "true"})
28
+ }
23
29
 
24
30
  extra_dev_deps << ["hoe", "~> 4.0"]
25
- extra_dev_deps << ["hoe-doofus", "~> 1.0"]
26
- extra_dev_deps << ["hoe-gemspec2", "~> 1.1"]
27
- extra_dev_deps << ["hoe-git2", "~> 1.7"]
28
- extra_dev_deps << ["hoe-rubygems", "~> 1.0"]
31
+ extra_dev_deps << ["hoe-halostatue", "~> 2.0"]
29
32
  extra_dev_deps << ["mime-types", ">= 3.4.0", "< 4"]
30
33
  extra_dev_deps << ["nokogiri", "~> 1.6"]
31
34
  extra_dev_deps << ["rake", ">= 10.0", "< 14"]
32
35
  extra_dev_deps << ["standard", "~> 1.0"]
33
36
  end
34
37
 
35
- $LOAD_PATH.unshift "lib"
36
- $LOAD_PATH.unshift "support"
37
-
38
- def new_version
39
- version =
40
- IO.read("lib/mime/types/data.rb").scan(/VERSION = ['"](\d\.\d{4}\.\d{4}(?:\.\d+)?)['"]/).flatten.first
41
-
42
- major = Gem::Version.new(version).canonical_segments.first
43
- minor = Date.today.strftime("%Y.%m%d")
44
-
45
- "#{major}.#{minor}"
46
- end
47
-
48
- def release_header
49
- "#{new_version} / #{Date.today.strftime("%Y-%m-%d")}"
50
- end
51
-
52
38
  namespace :mime do
53
39
  desc "Download the current MIME type registrations from IANA."
54
40
  task :iana, [:destination] do |_, args|
@@ -63,105 +49,45 @@ namespace :mime do
63
49
  end
64
50
  end
65
51
 
52
+ task :version do
53
+ require "mime/types/data"
54
+ puts MIME::Types::Data::VERSION
55
+ end
56
+
66
57
  namespace :release do
67
- task __pull: %w[mime:apache mime:iana convert]
68
- task __prepare: %w[update:version update:history git:manifest]
69
- task :__commit do
70
- history = IO.read("History.md")
71
- message = history.scan(%r{## (#{release_header}.+?)## \d\.\d{4}\.\d{4} /}m).flatten.first
72
-
73
- IO.popen("git commit -a -F -", "w") { |commit|
74
- commit.puts message
75
- }
58
+ desc "Prepare a new release"
59
+ task :prepare do
60
+ require "prepare_release"
61
+
62
+ PrepareRelease.new
63
+ .download_and_convert
64
+ .write_updated_version
65
+ .write_updated_history
66
+ .rake_git_manifest
67
+ .rake_gemspec
76
68
  end
77
69
 
78
70
  desc "Prepare a new release for use with GitHub Actions"
79
71
  task :gha do
80
72
  require "prepare_release"
81
73
 
82
- pr = PrepareRelease.new
83
- pr.download_and_convert
84
- pr.write_updated_version
85
- pr.write_updated_history
86
- pr.rake_git_manifest
87
- pr.rake_gemspec
88
- pr.as_gha_vars
89
- end
90
-
91
- desc "Prepare a new automatic release"
92
- task automatic: :__pull do
93
- if system("git diff --quiet --exit-code") == false
94
- Rake::Task["release:__prepare"].invoke
95
- Rake::Task["gemspec"].invoke
96
- Rake::Task["release:__commit"].invoke
97
- else
98
- warn "No changes detected."
99
- end
74
+ PrepareRelease.new
75
+ .download_and_convert
76
+ .write_updated_version
77
+ .write_updated_history
78
+ .rake_git_manifest
79
+ .rake_gemspec
80
+ .as_gha_vars
100
81
  end
101
82
  end
102
83
 
103
- namespace :convert do
104
- namespace :yaml do
105
- desc "Convert from YAML to JSON"
106
- task :json, [:source, :destination, :multiple_files] do |_, args|
107
- require "convert"
108
- Convert.from_yaml_to_json(from: args.source, to: args.destination, multiple_files: args.multiple_files)
109
- end
110
-
111
- desc "Convert from YAML to Columnar"
112
- task :columnar, [:source, :destination] do |_, args|
113
- require "convert/columnar"
114
- Convert::Columnar.from_yaml_to_columnar(from: args.source, to: args.destination)
115
- end
116
-
117
- desc "Convert from YAML to mini_mime db format"
118
- task :mini_mime, [:source, :destination] do |_, args|
119
- require "convert/mini_mime_db"
120
- Convert::MiniMimeDb.from_yaml_to_mini_mime(from: args.source, to: args.destination)
121
- end
122
- end
123
-
124
- namespace :json do
125
- desc "Convert from JSON to YAML"
126
- task :yaml, [:source, :destination, :multiple_files] do |_, args|
127
- require "convert"
128
- Convert.from_json_to_yaml(from: args.source, to: args.destination, multiple_files: args.multiple_files)
129
- end
130
- end
131
- end
132
-
133
- namespace :update do
134
- desc "Update the release version"
135
- task :version do
136
- file = IO.read("lib/mime/types/data.rb")
137
- updated = file.sub(/VERSION = ['"][.0-9]+['"]/, %(VERSION = "#{new_version}"))
138
-
139
- IO.write("lib/mime/types/data.rb", updated)
140
- end
141
-
142
- desc "Update the history file with automatic release notes"
143
- task :history do
144
- history = IO.read("History.md")
145
-
146
- if !/^## #{release_header}$/.match?(history)
147
- note = <<-NOTE
148
- <!-- automatic-release -->
149
-
150
- ## #{release_header}
151
-
152
- - Updated the Apache and IANA media registry entries as of release date.
153
- NOTE
154
-
155
- updated = history.sub("<!-- automatic-release -->\n", note)
84
+ desc "Default conversion from YAML to JSON and Columnar"
85
+ task :convert do
86
+ require "prepare_release"
156
87
 
157
- IO.write("History.md", updated)
158
- end
159
- end
88
+ PrepareRelease.new.convert_types
160
89
  end
161
90
 
162
- desc "Default conversion from YAML to JSON and Columnar"
163
- task convert: ["convert:yaml:json", "convert:yaml:columnar", "convert:yaml:mini_mime"]
164
-
165
91
  Rake::Task["gem"].prerequisites.unshift("convert")
166
92
  Rake::Task["gem"].prerequisites.unshift("git:manifest")
167
93
  Rake::Task["gem"].prerequisites.unshift("gemspec")
data/SECURITY.md CHANGED
@@ -1,4 +1,4 @@
1
- # mime-types Security
1
+ # mime-types-data Security
2
2
 
3
3
  ## Security contact information
4
4