-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #157 from mime-types/additional-columns
IANA Provisional Registration Support
- Loading branch information
Showing
14 changed files
with
134 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
# -*- ruby encoding: utf-8 -*- | ||
|
||
## | ||
module MIME; end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# -*- encoding: utf-8 -*- | ||
# stub: mime-types 3.3.1 ruby lib | ||
# stub: mime-types 3.4.0 ruby lib | ||
|
||
Gem::Specification.new do |s| | ||
s.name = "mime-types".freeze | ||
s.version = "3.3.1" | ||
s.version = "3.4.0" | ||
|
||
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= | ||
s.metadata = { "bug_tracker_uri" => "https://github.com/mime-types/ruby-mime-types/issues", "changelog_uri" => "https://github.com/mime-types/ruby-mime-types/blob/master/History.md", "homepage_uri" => "https://github.com/mime-types/ruby-mime-types/", "source_code_uri" => "https://github.com/mime-types/ruby-mime-types/" } if s.respond_to? :metadata= | ||
s.require_paths = ["lib".freeze] | ||
s.authors = ["Austin Ziegler".freeze] | ||
s.date = "2021-06-02" | ||
s.date = "2021-11-15" | ||
s.description = "The mime-types library provides a library and registry for information about\nMIME content type definitions. It can be used to determine defined filename\nextensions for MIME types, or to use filename extensions to look up the likely\nMIME type definitions.\n\nVersion 3.0 is a major release that requires Ruby 2.0 compatibility and removes\ndeprecated functions. The columnar registry format introduced in 2.6 has been\nmade the primary format; the registry data has been extracted from this library\nand put into {mime-types-data}[https://github.com/mime-types/mime-types-data].\nAdditionally, mime-types is now licensed exclusively under the MIT licence and\nthere is a code of conduct in effect. There are a number of other smaller\nchanges described in the History file.".freeze | ||
s.email = ["[email protected]".freeze] | ||
s.extra_rdoc_files = ["Code-of-Conduct.md".freeze, "Contributing.md".freeze, "History.md".freeze, "Licence.md".freeze, "Manifest.txt".freeze, "README.rdoc".freeze] | ||
|
@@ -38,7 +38,6 @@ Gem::Specification.new do |s| | |
s.add_development_dependency(%q<minitest-bonus-assertions>.freeze, ["~> 3.0"]) | ||
s.add_development_dependency(%q<minitest-hooks>.freeze, ["~> 1.4"]) | ||
s.add_development_dependency(%q<rake>.freeze, [">= 10.0", "< 14.0"]) | ||
s.add_development_dependency(%q<psych>.freeze, ["~> 3.0"]) | ||
s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.7"]) | ||
s.add_development_dependency(%q<rdoc>.freeze, [">= 4.0", "< 7"]) | ||
s.add_development_dependency(%q<hoe>.freeze, ["~> 3.23"]) | ||
|
@@ -55,7 +54,6 @@ Gem::Specification.new do |s| | |
s.add_dependency(%q<minitest-bonus-assertions>.freeze, ["~> 3.0"]) | ||
s.add_dependency(%q<minitest-hooks>.freeze, ["~> 1.4"]) | ||
s.add_dependency(%q<rake>.freeze, [">= 10.0", "< 14.0"]) | ||
s.add_dependency(%q<psych>.freeze, ["~> 3.0"]) | ||
s.add_dependency(%q<simplecov>.freeze, ["~> 0.7"]) | ||
s.add_dependency(%q<rdoc>.freeze, [">= 4.0", "< 7"]) | ||
s.add_dependency(%q<hoe>.freeze, ["~> 3.23"]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
require "net/http" | ||
require "json" | ||
|
||
class Deps | ||
def self.run(args) | ||
new.run(args) | ||
end | ||
|
||
def run(args) | ||
deps = rubygems_get(gem_name: "mime-types", endpoint: "reverse_dependencies") | ||
weighted_deps = {} | ||
|
||
deps.each do |name| | ||
downloads = gem_downloads(name) | ||
weighted_deps[name] = downloads if downloads | ||
rescue => e | ||
puts "#{name} #{e.message}" | ||
end | ||
|
||
weighted_deps | ||
.sort { |(_k1, v1), (_k2, v2)| v2 <=> v1 } | ||
.first(args.number || 50) | ||
.each_with_index do |(k, v), i| | ||
puts "#{i}) #{k}: #{v}" | ||
end | ||
end | ||
|
||
private | ||
|
||
def rubygems_get(gem_name: "", endpoint: "") | ||
path = File.join("/api/v1/gems/", gem_name, endpoint).chomp("/") + ".json" | ||
Net::HTTP.start("rubygems.org", use_ssl: true) do |http| | ||
JSON.parse(http.get(path).body) | ||
end | ||
end | ||
|
||
def gem_downloads(name) | ||
rubygems_get(gem_name: name)["downloads"] | ||
rescue => e | ||
puts "#{name} #{e.message}" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters