purl 1.5.2 → 1.7.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/README.md +221 -1
- data/exe/purl +128 -17
- data/lib/purl/advisory.rb +134 -0
- data/lib/purl/advisory_formatter.rb +160 -0
- data/lib/purl/download_url.rb +266 -0
- data/lib/purl/lookup.rb +54 -13
- data/lib/purl/lookup_formatter.rb +75 -19
- data/lib/purl/package_url.rb +17 -0
- data/lib/purl/version.rb +1 -1
- data/lib/purl.rb +15 -0
- metadata +5 -2
data/lib/purl.rb
CHANGED
|
@@ -4,8 +4,11 @@ require_relative "purl/version"
|
|
|
4
4
|
require_relative "purl/errors"
|
|
5
5
|
require_relative "purl/package_url"
|
|
6
6
|
require_relative "purl/registry_url"
|
|
7
|
+
require_relative "purl/download_url"
|
|
7
8
|
require_relative "purl/lookup"
|
|
8
9
|
require_relative "purl/lookup_formatter"
|
|
10
|
+
require_relative "purl/advisory"
|
|
11
|
+
require_relative "purl/advisory_formatter"
|
|
9
12
|
|
|
10
13
|
# The main PURL (Package URL) module providing functionality to parse,
|
|
11
14
|
# validate, and generate package URLs according to the PURL specification.
|
|
@@ -100,6 +103,17 @@ module Purl
|
|
|
100
103
|
RegistryURL.supported_reverse_types
|
|
101
104
|
end
|
|
102
105
|
|
|
106
|
+
# Returns types that have download URL support
|
|
107
|
+
#
|
|
108
|
+
# @return [Array<String>] sorted array of types that can generate download URLs
|
|
109
|
+
#
|
|
110
|
+
# @example
|
|
111
|
+
# types = Purl.download_supported_types
|
|
112
|
+
# puts types.include?("gem") # true if gem has download URL support
|
|
113
|
+
def self.download_supported_types
|
|
114
|
+
DownloadURL.supported_types
|
|
115
|
+
end
|
|
116
|
+
|
|
103
117
|
# Check if a type is known/valid
|
|
104
118
|
#
|
|
105
119
|
# @param type [String, Symbol] the type to check
|
|
@@ -138,6 +152,7 @@ module Purl
|
|
|
138
152
|
examples: type_examples(normalized_type),
|
|
139
153
|
registry_url_generation: RegistryURL.supports?(normalized_type),
|
|
140
154
|
reverse_parsing: RegistryURL.supported_reverse_types.include?(normalized_type),
|
|
155
|
+
download_url_generation: DownloadURL.supports?(normalized_type),
|
|
141
156
|
route_patterns: RegistryURL.route_patterns_for(normalized_type)
|
|
142
157
|
}
|
|
143
158
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: purl
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Nesbitt
|
|
@@ -43,6 +43,9 @@ files:
|
|
|
43
43
|
- SECURITY.md
|
|
44
44
|
- exe/purl
|
|
45
45
|
- lib/purl.rb
|
|
46
|
+
- lib/purl/advisory.rb
|
|
47
|
+
- lib/purl/advisory_formatter.rb
|
|
48
|
+
- lib/purl/download_url.rb
|
|
46
49
|
- lib/purl/errors.rb
|
|
47
50
|
- lib/purl/lookup.rb
|
|
48
51
|
- lib/purl/lookup_formatter.rb
|
|
@@ -72,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
72
75
|
- !ruby/object:Gem::Version
|
|
73
76
|
version: '0'
|
|
74
77
|
requirements: []
|
|
75
|
-
rubygems_version:
|
|
78
|
+
rubygems_version: 4.0.1
|
|
76
79
|
specification_version: 4
|
|
77
80
|
summary: Parse and convert package urls (purls)
|
|
78
81
|
test_files: []
|