bibliothecary 6.8.4 → 6.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bibliothecary/parsers/nuget.rb +29 -0
- data/lib/bibliothecary/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b00a34285513502c8c94856b5007690cce35559d408ffec8f547f53167aa14ad
|
4
|
+
data.tar.gz: eee3030fc92c68909846803965ba632f0f28fdad103b9c4980016f43befde1b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7b10656917256013931bfe3798c479b6eb2e7146d3a55dfb6d7b2227dff5512939026ee28f129f7d803c05155bee26af9490938f142233f2ca9c053be2e6e85
|
7
|
+
data.tar.gz: 5c5f7232d4acd3e502d012e9a48835366dcdfd7af7f2b8ee56e75defdc7731e5a5b67e98c7318769d8d72500e42d0eec2f51feefec94c75b4ef53c387957e6d1
|
@@ -16,6 +16,10 @@ module Bibliothecary
|
|
16
16
|
kind: 'lockfile',
|
17
17
|
parser: :parse_project_lock_json
|
18
18
|
},
|
19
|
+
match_filename("packages.lock.json") => {
|
20
|
+
kind: 'lockfile',
|
21
|
+
parser: :parse_packages_lock_json
|
22
|
+
},
|
19
23
|
match_filename("packages.config") => {
|
20
24
|
kind: 'manifest',
|
21
25
|
parser: :parse_packages_config
|
@@ -47,6 +51,31 @@ module Bibliothecary
|
|
47
51
|
end
|
48
52
|
end
|
49
53
|
|
54
|
+
def self.parse_packages_lock_json(file_contents)
|
55
|
+
manifest = JSON.parse file_contents
|
56
|
+
|
57
|
+
frameworks = {}
|
58
|
+
manifest.fetch('dependencies',[]).each do |framework, deps|
|
59
|
+
frameworks[framework] = deps.map do |name, details|
|
60
|
+
{
|
61
|
+
name: name,
|
62
|
+
# 'resolved' has been set in all examples so far
|
63
|
+
# so fallback to requested is pure paranoia
|
64
|
+
requirement: details.fetch('resolved', details.fetch('requested', '*')),
|
65
|
+
type: 'runtime'
|
66
|
+
}
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
if frameworks.size > 0
|
71
|
+
# we should really return multiple manifests, but bibliothecary doesn't
|
72
|
+
# do that yet so at least pick deterministically.
|
73
|
+
frameworks[frameworks.keys.sort.last]
|
74
|
+
else
|
75
|
+
[]
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
50
79
|
def self.parse_packages_config(file_contents)
|
51
80
|
manifest = Ox.parse file_contents
|
52
81
|
manifest.packages.locate('package').map do |dependency|
|
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.
|
4
|
+
version: 6.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Nesbitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: toml-rb
|