bibliothecary 6.7.1 → 6.7.2
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/lib/bibliothecary/parsers/maven.rb +20 -6
- data/lib/bibliothecary/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 132a90ea8ed661b70e6709542f66d899eb5e35900905fd353b63f4e70b535ef8
|
4
|
+
data.tar.gz: 3803d75c592a1f338ea4ce0d054b1347d3a61d35db14098427a5f94031b29bfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26d770f760a52e56f7b51a04dadae781c87e73cac8e3f31d1f7cfd5d93c1a5597f079e609393146d7549b93a84bfb82a93801eacb92eb4cdf43f65e766e612ca
|
7
|
+
data.tar.gz: 1c8136abb0ad7b67a57b0e5e41f2e9a48e110e5c71b27baa6005c922f9fac30a69be173ec88aa20d3e494c96360986052210be0e07df0c652d15cc6f43affc34
|
@@ -109,16 +109,16 @@ module Bibliothecary
|
|
109
109
|
end.compact.uniq {|item| [item[:name], item[:requirement], item[:type]]}
|
110
110
|
end
|
111
111
|
|
112
|
-
def self.parse_pom_manifest(file_contents)
|
112
|
+
def self.parse_pom_manifest(file_contents, parent_properties = {})
|
113
113
|
manifest = Ox.parse file_contents
|
114
114
|
xml = manifest.respond_to?('project') ? manifest.project : manifest
|
115
115
|
[].tap do |deps|
|
116
116
|
['dependencies/dependency', 'dependencyManagement/dependencies/dependency'].each do |deps_xpath|
|
117
117
|
xml.locate(deps_xpath).each do |dep|
|
118
118
|
deps.push({
|
119
|
-
name: "#{extract_pom_dep_info(xml, dep, 'groupId')}:#{extract_pom_dep_info(xml, dep, 'artifactId')}",
|
120
|
-
requirement: extract_pom_dep_info(xml, dep, 'version'),
|
121
|
-
type: extract_pom_dep_info(xml, dep, 'scope') || 'runtime'
|
119
|
+
name: "#{extract_pom_dep_info(xml, dep, 'groupId', parent_properties)}:#{extract_pom_dep_info(xml, dep, 'artifactId', parent_properties)}",
|
120
|
+
requirement: extract_pom_dep_info(xml, dep, 'version', parent_properties),
|
121
|
+
type: extract_pom_dep_info(xml, dep, 'scope', parent_properties) || 'runtime'
|
122
122
|
})
|
123
123
|
end
|
124
124
|
end
|
@@ -141,16 +141,30 @@ module Bibliothecary
|
|
141
141
|
end.compact
|
142
142
|
end
|
143
143
|
|
144
|
-
def self.
|
144
|
+
def self.extract_pom_info(xml, location, parent_properties = {})
|
145
|
+
extract_pom_dep_info(xml, xml, location, parent_properties)
|
146
|
+
end
|
147
|
+
|
148
|
+
def self.extract_pom_dep_info(xml, dependency, name, parent_properties = {})
|
145
149
|
field = dependency.locate(name).first
|
146
150
|
return nil if field.nil?
|
147
151
|
value = field.nodes.first
|
148
152
|
match = value.match(/^\$\{(.+)\}/)
|
149
153
|
if match
|
150
|
-
|
154
|
+
# the xml root is <project> so lookup the non property name in the xml
|
155
|
+
# this converts ${project/group.id} -> ${group/id}
|
156
|
+
non_prop_name = match[1].gsub('.', '/').gsub('project/', '')
|
157
|
+
return value if !xml.respond_to?('properties') && parent_properties.empty? && !xml.locate(non_prop_name)
|
151
158
|
prop_field = xml.properties.locate(match[1]).first
|
159
|
+
parent_prop = parent_properties[match[1]]
|
152
160
|
if prop_field
|
153
161
|
return prop_field.nodes.first
|
162
|
+
elsif parent_prop
|
163
|
+
return parent_prop
|
164
|
+
elsif xml.locate(non_prop_name).first
|
165
|
+
# see if the value to look up is a field under the project
|
166
|
+
# examples are ${project.groupId} or ${project.version}
|
167
|
+
return xml.locate(non_prop_name).first.nodes.first
|
154
168
|
else
|
155
169
|
return value
|
156
170
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bibliothecary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.7.
|
4
|
+
version: 6.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Nesbitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: toml-rb
|
@@ -273,8 +273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
273
273
|
- !ruby/object:Gem::Version
|
274
274
|
version: '0'
|
275
275
|
requirements: []
|
276
|
-
|
277
|
-
rubygems_version: 2.7.6
|
276
|
+
rubygems_version: 3.0.3
|
278
277
|
signing_key:
|
279
278
|
specification_version: 4
|
280
279
|
summary: Find and parse manifests
|