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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eee3f05283c3cbba1a10f3a156b753c88a24c677
4
- data.tar.gz: 3ece01befaf1d08f314edaf35db031b2819f2d55
3
+ metadata.gz: f67f5d779f4e9cffeca2c02a0ec6dd4546b511db
4
+ data.tar.gz: 30cceac90607ef0532fd6c0396be44639bc338ee
5
5
  SHA512:
6
- metadata.gz: 92709fddf36ec030c321f7dbc8644880db2a0d7a953c04c4940205346d4dbc98c2ae3b48a112787f31b6ed4d8f5648700f44d217dea5de2d1184cb27e21f4619
7
- data.tar.gz: 34fc86ed2f88031d5b44e04d4a1b162e661a39477a07a1291946dcefbbb4c0df4a64bbea6c428f2dd36be76bd1d8771ecc89b33f32d34991b5f61d447729642e
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.project.dependencies.locate('dependency').map do |dependency|
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(manifest, dependency, 'groupId')}:#{extract_pom_dep_info(manifest, dependency, 'artifactId')}",
96
- requirement: extract_pom_dep_info(manifest, dependency, 'version'),
97
- type: extract_pom_dep_info(manifest, dependency, 'scope') || 'runtime'
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(manifest, dependency, name)
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 = manifest.project.properties.locate(match[1]).first
129
+ prop_field = xml.properties.locate(match[1]).first
125
130
  if prop_field
126
131
  return prop_field.nodes.first
127
132
  else
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "1.4.0"
2
+ VERSION = "1.4.1"
3
3
  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: 1.4.0
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-16 00:00:00.000000000 Z
11
+ date: 2016-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: toml-rb