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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f6d0c75dace8b988d53e7b6620e7c1c8aad139ddf4aebbc1497c1428b4bda09
4
- data.tar.gz: ea3e235adc6e425269eb29fda38694555be29b54bcb5cdc7ec8b455ac06b554c
3
+ metadata.gz: b00a34285513502c8c94856b5007690cce35559d408ffec8f547f53167aa14ad
4
+ data.tar.gz: eee3030fc92c68909846803965ba632f0f28fdad103b9c4980016f43befde1b9
5
5
  SHA512:
6
- metadata.gz: 191203c29364c6fb45bf9228fa49a1ae3e8f176ec1e7331c07e3bf731688ac896220d49a4271773703ec48a240cdb0fdfc555fd887ed14cd459d2788a285339c
7
- data.tar.gz: 185c27f488fd30d3026447193396637b90a46c286c7cbf02b207ce0dd1ff30d576c73b5a39262f61ad3fe7bf7975f9df0ef20cfb61701ac532cc969733ef26f2
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|
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "6.8.4"
2
+ VERSION = "6.8.5"
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.4
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-01 00:00:00.000000000 Z
11
+ date: 2019-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: toml-rb