bibliothecary 6.8.9 → 6.9.3

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: c655fc14eb58f419b202c25b3b28d22f041c840ceda3d527aaf21b122d5663fe
4
- data.tar.gz: 43b452b2ec6411d409aff5a479fd3d89d2bdf7eeb253b253b5a76849b8990b1a
3
+ metadata.gz: eddf54931d180a739e69e33150ff5b105994976ff9436eae7765a88d7a5d7169
4
+ data.tar.gz: 8f53292f1e7c7be586f9810dc723fb39dd145b8f436b6d82c6eb984cf7a726da
5
5
  SHA512:
6
- metadata.gz: 921763c07b4ae50a14a905e5eed87a558631495500150ac732763a9456b081007b6e05dac4eabfec13f06ed3d3a6b38cdc30436e828204f389a627ab64fbc38b
7
- data.tar.gz: daf4e977c0c46daec88c6e9cfc0dd41b0e4ce842266716bb40aa3da10effcd5d5ee291ca034f1509f8e0233bd4a6e08ed6ab00896f7cfe4dd66ca5bbe2a859d3
6
+ metadata.gz: bc54928770a24ef0214a11ca1cb9400875cf752ce28c907651cdc1ac879736e2e1c3860f71a5ebfda275d860dff4c495fcafb2f44cfd6c2b3f8f252b404dc7bc
7
+ data.tar.gz: 9886c713649ec7503b7106c91fb1b5242d898ccb1fbd65462494c4d80b56186f08b536fa321fba6658e4c7ba183d624cc974e20c29b7e4bd6ffd3e8c3756661d
@@ -1 +1 @@
1
- 2.6.6
1
+ 2.7.1
data/README.md CHANGED
@@ -140,6 +140,7 @@ All available config options are in: https://github.com/librariesio/bibliothecar
140
140
  - Gopkg.lock
141
141
  - go.mod
142
142
  - go.sum
143
+ - go-resolved-dependencies.json
143
144
  - Elm
144
145
  - elm-package.json
145
146
  - elm_dependencies.json
@@ -57,7 +57,11 @@ module Bibliothecary
57
57
  match_filename("Gopkg.lock") => {
58
58
  kind: 'lockfile',
59
59
  parser: :parse_dep_lockfile
60
- }
60
+ },
61
+ match_filename("go-resolved-dependencies.json") => {
62
+ kind: 'lockfile',
63
+ parser: :parse_go_resolved
64
+ },
61
65
  }
62
66
  end
63
67
 
@@ -140,6 +144,12 @@ module Bibliothecary
140
144
  deps.uniq
141
145
  end
142
146
 
147
+ def self.parse_go_resolved(file_contents)
148
+ JSON.parse(file_contents)
149
+ .select { |dep| dep["Main"] != "true" }
150
+ .map { |dep| { name: dep["Path"], requirement: dep["Version"], type: 'runtime' } }
151
+ end
152
+
143
153
  def self.map_dependencies(manifest, attr_name, dep_attr_name, version_attr_name, type)
144
154
  manifest.fetch(attr_name,[]).map do |dependency|
145
155
  {
@@ -124,8 +124,9 @@ module Bibliothecary
124
124
  split = gradle_dep_match.captures[0]
125
125
 
126
126
  # org.springframework.boot:spring-boot-starter-web:2.1.0.M3 (*)
127
- # Lines can end with (n) or (*) to indicate that something was not resolved (n) or resolved previously (*).
128
- dep = line.split(split)[1].sub(/\(n\)$/, "").sub(/\(\*\)$/,"").strip.split(":")
127
+ # Lines can end with (c), (n), or (*)
128
+ # to indicate that something was a dependency constraint (c), not resolved (n), or resolved previously (*).
129
+ dep = line.split(split)[1].sub(/(\((c|n|\*)\))$/, "").strip.split(":")
129
130
  version = dep[-1]
130
131
  version = version.split("->")[-1].strip if line.include?("->")
131
132
  {
@@ -228,7 +229,7 @@ module Bibliothecary
228
229
  # the xml root is <project> so lookup the non property name in the xml
229
230
  # this converts ${project/group.id} -> ${group/id}
230
231
  non_prop_name = property_name.gsub(".", "/").gsub("project/", "")
231
- return value if !xml.respond_to?("properties") && parent_properties.empty? && !xml.locate(non_prop_name)
232
+ return "${#{property_name}}" if !xml.respond_to?("properties") && parent_properties.empty? && xml.locate(non_prop_name).empty?
232
233
 
233
234
  prop_field = xml.properties.locate(property_name).first
234
235
  parent_prop = parent_properties[property_name]
@@ -70,6 +70,7 @@ module Bibliothecary
70
70
  {
71
71
  name: dep[:name],
72
72
  requirement: dep[:version],
73
+ lockfile_requirement: dep[:requirement],
73
74
  type: dep[:type]
74
75
  }
75
76
  end
@@ -31,6 +31,14 @@ module Bibliothecary
31
31
  match_filename("Pipfile.lock") => {
32
32
  kind: 'lockfile',
33
33
  parser: :parse_pipfile_lock
34
+ },
35
+ match_filename("pyproject.toml") => {
36
+ kind: 'manifest',
37
+ parser: :parse_poetry
38
+ },
39
+ match_filename("poetry.lock") => {
40
+ kind: 'lockfile',
41
+ parser: :parse_poetry_lock
34
42
  }
35
43
  }
36
44
  end
@@ -40,6 +48,11 @@ module Bibliothecary
40
48
  map_dependencies(manifest['packages'], 'runtime') + map_dependencies(manifest['dev-packages'], 'develop')
41
49
  end
42
50
 
51
+ def self.parse_poetry(file_contents)
52
+ manifest = TomlRB.parse(file_contents)['tool']['poetry']
53
+ map_dependencies(manifest['dependencies'], 'runtime') + map_dependencies(manifest['dev-dependencies'], 'develop')
54
+ end
55
+
43
56
  def self.map_dependencies(packages, type)
44
57
  return [] unless packages
45
58
  packages.map do |name, info|
@@ -82,6 +95,27 @@ module Bibliothecary
82
95
  deps
83
96
  end
84
97
 
98
+ def self.parse_poetry_lock(file_contents)
99
+ manifest = TomlRB.parse(file_contents)
100
+ deps = []
101
+ manifest["package"].each do |package|
102
+ # next if group == "_meta"
103
+ group = case package['category']
104
+ when 'main'
105
+ 'runtime'
106
+ when 'dev'
107
+ 'develop'
108
+ end
109
+
110
+ deps << {
111
+ name: package['name'],
112
+ requirement: map_requirements(package),
113
+ type: group
114
+ }
115
+ end
116
+ deps
117
+ end
118
+
85
119
  def self.parse_setup_py(manifest)
86
120
  match = manifest.match(INSTALL_REGEXP)
87
121
  return [] unless match
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "6.8.9"
2
+ VERSION = "6.9.3"
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.8.9
4
+ version: 6.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-16 00:00:00.000000000 Z
11
+ date: 2020-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: toml-rb
@@ -288,7 +288,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
288
288
  - !ruby/object:Gem::Version
289
289
  version: '0'
290
290
  requirements: []
291
- rubygems_version: 3.0.3
291
+ rubygems_version: 3.1.2
292
292
  signing_key:
293
293
  specification_version: 4
294
294
  summary: Find and parse manifests