bibliothecary 6.10.6 → 6.10.7

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
  SHA256:
3
- metadata.gz: 1b8ae8af99a91ccccfdaaf8a18aa03ff134856f4ff0bd3579ef0955ff28bb6b6
4
- data.tar.gz: 7eeb154cbcc23edb621e3a1f332264bac5fe716d4e5026c20c072f14e60156b2
3
+ metadata.gz: 97884ae133cf8ff23366cfdfbd6a97382e200313693eaaca8ceae2e743897a72
4
+ data.tar.gz: 5cf10414b41b13552a692fa4802464eab0980489e9a1ce5a1e4f9601add8deb7
5
5
  SHA512:
6
- metadata.gz: 4fb19ca3ce60f786ee92a013ac6cddd2b29f8400ae7f3dce1258794360f90f3afd4b9bd594e9da34c4da2b2cae5ebc8936cc288ec0341710836ef0d13bffd210
7
- data.tar.gz: f9e7a66faa72e61b47dff0b73a6e80af515746a1de3e333eed4930560f2eff9519f785e303412c9774a812080a4926f317f5c8a895c9d568f768f6c78ff9f67f
6
+ metadata.gz: 58c47af966516baa1fb6c9586670cf8dc5d1a0831f2b6fa44b750d7e7f62471063b89083ce7306878fb2989cb8b073b3c9b105b68a90883f7f4f9ac86a111999
7
+ data.tar.gz: 2685dcd3c595d20c2d1fc5884dd1187079e2bdeddd6f354762b8ee3dfdb326fcb6574bcf4a15d3b7ea343f22847d188ee6093c4f7ccf6ae13c1b7d61794b6cce
@@ -205,8 +205,8 @@ module Bibliothecary
205
205
  json = JSON.parse(response.body)
206
206
  return [] unless json['dependencies']
207
207
  json['dependencies'].map do |dependency|
208
- name = [dependency["group"], dependency["name"]].join(':')
209
- next unless name =~ (/[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+(\.[A-Za-z0-9_-])?\:[A-Za-z0-9_-]/)
208
+ name = gradle_dependency_name(dependency["group"], dependency["name"])
209
+ next unless name =~ /[\w-]+\.[\w_-]+(\.[\w-])?\:[\w-]/
210
210
  {
211
211
  name: name,
212
212
  requirement: dependency["version"],
@@ -215,6 +215,20 @@ module Bibliothecary
215
215
  end.compact
216
216
  end
217
217
 
218
+ def self.gradle_dependency_name(group, name)
219
+ if group.empty? && name.include?(":")
220
+ group, name = name.split(":", 2)
221
+ end
222
+
223
+ # Strip comments, and single/doublequotes
224
+ [group, name].map do |part|
225
+ part
226
+ .gsub(/\s*\/\/.*$/, "") # Comments
227
+ .gsub(/^["']/, "") # Beginning single/doublequotes
228
+ .gsub(/["']$/, "") # Ending single/doublequotes
229
+ end.join(":")
230
+ end
231
+
218
232
  def self.extract_pom_info(xml, location, parent_properties = {})
219
233
  extract_pom_dep_info(xml, xml, location, parent_properties)
220
234
  end
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "6.10.6"
2
+ VERSION = "6.10.7"
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: 6.10.6
4
+ version: 6.10.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-06 00:00:00.000000000 Z
11
+ date: 2021-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: toml-rb