bibliothecary 8.6.0 → 8.6.2

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: 69baa22eeba713511d022a85df1280b987885810f25e421f8d7eecf8af795317
4
- data.tar.gz: c663614b9e7c5aee6613a403a14aa2faccbbe07bf69d3cb68a92faa09449803c
3
+ metadata.gz: 86361a7bec7e2b16e6d15548c35ce460a39378f241d010b42f743f9aee761dc6
4
+ data.tar.gz: b6b44dd4064c686006932e77abe0c3d8e792bb132f15b0ae2876bd054c38d43c
5
5
  SHA512:
6
- metadata.gz: 27bc063ab4832d89e65673935169d9ad78fb13a48bacaf4d8a640781f8bc5a1f4a486da73e7e7409e64eb721246695997471f342e966d9434d576f480238c253
7
- data.tar.gz: aea0d2e9eea3a8e9dec803d040ea14299febdf52528d58a7479240e6e65def97a5e24c60a0c0955ee72929140698ae78f6ca6ecbe44c1d1b7240f64d90d6570a
6
+ metadata.gz: b371453204d2523671442fc45ec512f83f45eafb73f429f0a1b743fe5edc6bc23f65fc90c7110aadcb4ed24e7e50ed1b81863f50736355ac9068a274a242ca56
7
+ data.tar.gz: d94e3f5986f4d080d0b02d9a0349686220b4b3e9b96f91bd64050ad05dd6785cfbf823a2216b49ec78cec040f48bd3705212894e338efa2382da19ea848db833
@@ -268,11 +268,15 @@ module Bibliothecary
268
268
  [].tap do |deps|
269
269
  ['dependencies/dependency', 'dependencyManagement/dependencies/dependency'].each do |deps_xpath|
270
270
  xml.locate(deps_xpath).each do |dep|
271
- deps.push({
271
+ dep_hash = {
272
272
  name: "#{extract_pom_dep_info(xml, dep, 'groupId', parent_properties)}:#{extract_pom_dep_info(xml, dep, 'artifactId', parent_properties)}",
273
273
  requirement: extract_pom_dep_info(xml, dep, 'version', parent_properties),
274
- type: extract_pom_dep_info(xml, dep, 'scope', parent_properties) || 'runtime'
275
- })
274
+ type: extract_pom_dep_info(xml, dep, 'scope', parent_properties) || 'runtime',
275
+ }
276
+ # optional field is, itself, optional, and will be either "true" or "false"
277
+ optional = extract_pom_dep_info(xml, dep, 'optional', parent_properties)
278
+ dep_hash[:optional] = optional == "true" unless optional.nil?
279
+ deps.push(dep_hash)
276
280
  end
277
281
  end
278
282
  end
@@ -8,6 +8,7 @@ module Bibliothecary
8
8
 
9
9
  NAME_VERSION = '(?! )(.*?)(?: \(([^-]*)(?:-(.*))?\))?'.freeze
10
10
  NAME_VERSION_4 = /^ {4}#{NAME_VERSION}$/
11
+ BUNDLED_WITH = /BUNDLED WITH/
11
12
 
12
13
  def self.mapping
13
14
  {
@@ -35,14 +36,20 @@ module Bibliothecary
35
36
  def self.parse_gemfile_lock(file_contents, options: {})
36
37
  file_contents.lines(chomp: true).map do |line|
37
38
  match = line.match(NAME_VERSION_4)
38
- next unless match
39
- name = match[1]
40
- version = match[2].gsub(/\(|\)/,'')
41
- {
42
- name: name,
43
- requirement: version,
44
- type: 'runtime'
45
- }
39
+ bundler_match = line.match(BUNDLED_WITH)
40
+ next unless match || bundler_match
41
+
42
+ if match
43
+ name = match[1]
44
+ version = match[2].gsub(/\(|\)/,'')
45
+ {
46
+ name: name,
47
+ requirement: version,
48
+ type: 'runtime'
49
+ }
50
+ else
51
+ parse_bundler(file_contents)
52
+ end
46
53
  end.compact
47
54
  end
48
55
 
@@ -55,6 +62,19 @@ module Bibliothecary
55
62
  manifest = Gemnasium::Parser.send(:gemspec, file_contents)
56
63
  parse_ruby_manifest(manifest)
57
64
  end
65
+
66
+ def self.parse_bundler(file_contents)
67
+ bundled_with_index = file_contents.lines(chomp: true).find_index { |line| line.match(BUNDLED_WITH) }
68
+ version = file_contents.lines(chomp: true).fetch(bundled_with_index + 1)&.strip
69
+
70
+ return nil unless version
71
+
72
+ {
73
+ name: 'bundler',
74
+ requirement: version,
75
+ type: 'runtime'
76
+ }
77
+ end
58
78
  end
59
79
  end
60
80
  end
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "8.6.0"
2
+ VERSION = "8.6.2"
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: 8.6.0
4
+ version: 8.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-06 00:00:00.000000000 Z
11
+ date: 2023-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tomlrb
@@ -248,7 +248,7 @@ dependencies:
248
248
  - - ">="
249
249
  - !ruby/object:Gem::Version
250
250
  version: '0'
251
- description:
251
+ description:
252
252
  email:
253
253
  - andrewnez@gmail.com
254
254
  executables:
@@ -324,7 +324,7 @@ homepage: https://github.com/librariesio/bibliothecary
324
324
  licenses:
325
325
  - AGPL-3.0
326
326
  metadata: {}
327
- post_install_message:
327
+ post_install_message:
328
328
  rdoc_options: []
329
329
  require_paths:
330
330
  - lib
@@ -339,8 +339,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
339
339
  - !ruby/object:Gem::Version
340
340
  version: '0'
341
341
  requirements: []
342
- rubygems_version: 3.3.22
343
- signing_key:
342
+ rubygems_version: 3.1.6
343
+ signing_key:
344
344
  specification_version: 4
345
345
  summary: Find and parse manifests
346
346
  test_files: []