bibliothecary 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bibliothecary/parsers/maven.rb +11 -6
- data/lib/bibliothecary/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f67f5d779f4e9cffeca2c02a0ec6dd4546b511db
|
4
|
+
data.tar.gz: 30cceac90607ef0532fd6c0396be44639bc338ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0faa511796bb6f2ce2dd4c1bf646de7e97d9721a8bc7b994a998e330b48375b8d4cf70a854d8d5c38b57d2539ed84c1fc1e44e2a8f61478ada4732ff795270f2
|
7
|
+
data.tar.gz: 9c6aae89744bd18a4c56a9664f92a51c9f8bea75a956f7a2d8ef2109d2c49825ec1ef240f898152383bc4aaab86f24c5df5b289cd6231ed42efc84a01650d763
|
@@ -90,11 +90,16 @@ module Bibliothecary
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def self.parse_pom_manifest(manifest)
|
93
|
-
manifest.
|
93
|
+
if manifest.respond_to?('project')
|
94
|
+
xml = manifest.project
|
95
|
+
else
|
96
|
+
xml = manifest
|
97
|
+
end
|
98
|
+
xml.dependencies.locate('dependency').map do |dependency|
|
94
99
|
{
|
95
|
-
name: "#{extract_pom_dep_info(
|
96
|
-
requirement: extract_pom_dep_info(
|
97
|
-
type: extract_pom_dep_info(
|
100
|
+
name: "#{extract_pom_dep_info(xml, dependency, 'groupId')}:#{extract_pom_dep_info(xml, dependency, 'artifactId')}",
|
101
|
+
requirement: extract_pom_dep_info(xml, dependency, 'version'),
|
102
|
+
type: extract_pom_dep_info(xml, dependency, 'scope') || 'runtime'
|
98
103
|
}
|
99
104
|
end
|
100
105
|
end
|
@@ -116,12 +121,12 @@ module Bibliothecary
|
|
116
121
|
end.compact
|
117
122
|
end
|
118
123
|
|
119
|
-
def self.extract_pom_dep_info(
|
124
|
+
def self.extract_pom_dep_info(xml, dependency, name)
|
120
125
|
field = dependency.locate(name).first
|
121
126
|
return nil if field.nil?
|
122
127
|
value = field.nodes.first
|
123
128
|
if match = value.match(/^\$\{(.+)\}/)
|
124
|
-
prop_field =
|
129
|
+
prop_field = xml.properties.locate(match[1]).first
|
125
130
|
if prop_field
|
126
131
|
return prop_field.nodes.first
|
127
132
|
else
|
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: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Nesbitt
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: toml-rb
|