bibliothecary 7.3.1 → 7.3.2
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/npm.rb +12 -0
- data/lib/bibliothecary/related_files_info.rb +3 -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: 5dece4dd0ba501561d36353606c81211a31727e01168effc7bbfdf0dc9ceec19
|
4
|
+
data.tar.gz: 4aa63636cf6e4697e9c35c2965f7cfe16bbe82f408d28f37c10fed678a1e893f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e3aa9619424e7ddc658a61779463d92a21ce7c80b364c61da52c4e05ae82f00aa3e792385f3552dbf5be0a240a4ae5cdee1b413b6b5412ffc2c038cd69a82c9
|
7
|
+
data.tar.gz: df88033afb288b0dcff8babb62eccda691aebc74aa1f19f209c6407c6cdddab4caf39420b23d012c51540988f7f7ffc9a81aa562724cf0dfe5eb6465e3801524
|
@@ -97,6 +97,18 @@ module Bibliothecary
|
|
97
97
|
transform_tree_to_array(manifest.fetch('dependencies', {}))
|
98
98
|
end
|
99
99
|
|
100
|
+
def self.lockfile_preference_order(file_infos)
|
101
|
+
files = file_infos.each_with_object({}) do |file_info, obj|
|
102
|
+
obj[File.basename(file_info.full_path)] = file_info
|
103
|
+
end
|
104
|
+
|
105
|
+
if files["npm-shrinkwrap.json"]
|
106
|
+
[files["npm-shrinkwrap.json"]] + files.values.reject { |fi| File.basename(fi.full_path) == "npm-shrinkwrap.json" }
|
107
|
+
else
|
108
|
+
files.values
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
100
112
|
private_class_method def self.transform_tree_to_array(deps_by_name)
|
101
113
|
deps_by_name.map do |name, metadata|
|
102
114
|
[
|
@@ -19,6 +19,9 @@ module Bibliothecary
|
|
19
19
|
|
20
20
|
def initialize(file_infos)
|
21
21
|
package_manager = file_infos.first.package_manager
|
22
|
+
if package_manager.respond_to?(:lockfile_preference_order)
|
23
|
+
file_infos = package_manager.lockfile_preference_order(file_infos)
|
24
|
+
end
|
22
25
|
@platform = package_manager.platform_name
|
23
26
|
@path = Pathname.new(File.dirname(file_infos.first.relative_path)).cleanpath.to_path
|
24
27
|
# `package_manager.determine_kind_from_info(info)` can be an Array, so use include? which also works for string
|
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: 7.3.
|
4
|
+
version: 7.3.2
|
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-
|
11
|
+
date: 2021-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tomlrb
|