bibliothecary 6.9.7 → 6.10.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/console +2 -2
- data/lib/bibliothecary/parsers/maven.rb +23 -0
- data/lib/bibliothecary/parsers/nuget.rb +7 -1
- data/lib/bibliothecary/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0fe6cf7ec6515474ae77b8675dce1e61fc29d66a7f01603cbd3d47da401810f
|
4
|
+
data.tar.gz: cd9653505a89fe19e9524d980e845046c043e3d6147f9139a77f24f206ad5496
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3260f87303449999f892cb1f7a860eed43755800310772f2e4a2a55676f54a3170e2099da31a373ab1a3be31640101f2a830e76556552e8e16dd857337a290e
|
7
|
+
data.tar.gz: 9d11c0d38c59222971e4515089f7a44e5e90379e9317d4176a54d6303131d8d30ff90ac23b069533f5b1556f11cf2bf5a9c53b867ebf5f088b44ea283d5f4c4b
|
data/bin/console
CHANGED
@@ -60,6 +60,10 @@ module Bibliothecary
|
|
60
60
|
match_filename("sbt-update-full.txt", case_insensitive: true) => {
|
61
61
|
kind: 'lockfile',
|
62
62
|
parser: :parse_sbt_update_full
|
63
|
+
},
|
64
|
+
match_filename("maven-dependency-tree.txt", case_insensitive: true) => {
|
65
|
+
kind: 'lockfile',
|
66
|
+
parser: :parse_maven_tree
|
63
67
|
}
|
64
68
|
}
|
65
69
|
end
|
@@ -148,6 +152,25 @@ module Bibliothecary
|
|
148
152
|
.compact
|
149
153
|
.uniq
|
150
154
|
end
|
155
|
+
def self.parse_maven_tree(file_contents)
|
156
|
+
file_contents = file_contents.gsub(/\r\n?/, "\n")
|
157
|
+
captures = file_contents.scan(/^\[INFO\](?:(?:\+-)|\||(?:\\-)|\s)+((?:[\w\.-]+:)+[\w\.\-]+)/).flatten.uniq
|
158
|
+
captures.map do |item|
|
159
|
+
parts = item.split(":")
|
160
|
+
case parts.count
|
161
|
+
when 4
|
162
|
+
version = parts[-1]
|
163
|
+
type = parts[-2]
|
164
|
+
when 5..6
|
165
|
+
version, type = parts[-2..]
|
166
|
+
end
|
167
|
+
{
|
168
|
+
name: parts[0..1].join(":"),
|
169
|
+
requirement: version,
|
170
|
+
type: type
|
171
|
+
}
|
172
|
+
end
|
173
|
+
end
|
151
174
|
|
152
175
|
def self.parse_resolved_dep_line(line)
|
153
176
|
dep_parts = line.strip.split(":")
|
@@ -93,10 +93,16 @@ module Bibliothecary
|
|
93
93
|
|
94
94
|
def self.parse_csproj(file_contents)
|
95
95
|
manifest = Ox.parse file_contents
|
96
|
+
|
96
97
|
packages = manifest.locate('ItemGroup/PackageReference').map do |dependency|
|
98
|
+
requirement = (dependency.Version if dependency.respond_to? "Version") || "*"
|
99
|
+
if requirement.is_a?(Ox::Element)
|
100
|
+
requirement = dependency.nodes.detect{ |n| n.value == "Version" }&.text
|
101
|
+
end
|
102
|
+
|
97
103
|
{
|
98
104
|
name: dependency.Include,
|
99
|
-
requirement:
|
105
|
+
requirement: requirement,
|
100
106
|
type: 'runtime'
|
101
107
|
}
|
102
108
|
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.
|
4
|
+
version: 6.10.4
|
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-
|
11
|
+
date: 2021-03-19 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.
|
291
|
+
rubygems_version: 3.0.3
|
292
292
|
signing_key:
|
293
293
|
specification_version: 4
|
294
294
|
summary: Find and parse manifests
|