bibliothecary 8.4.3 → 8.4.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: 27a0df595a08d1414ee9e6a119f4dbb82f6b7d5601a82c03121a3c1a456977ec
4
- data.tar.gz: 1a81bfd9393e69be750950a1d6b382c1bc8c45b0d4b9191bdaf551b4af7e5725
3
+ metadata.gz: f96049ef42a355a057a20317490f01d21221f7404f2902ba6a79553bf747bfaf
4
+ data.tar.gz: ae2d328f4518584aba8c7b7f4da20f6e57dbf1bd0537114c2415eaf87c99f3f9
5
5
  SHA512:
6
- metadata.gz: 9773287184bc08731228578b3f88218eaa261a462a89ae823222300c71a6276e23331acaef7ee1f2cace14b14e95f5b4d3fcce836bd51ebff35844d6547aee50
7
- data.tar.gz: 5ffc87d102724e5a1f0d6d930f094a2591de23ff921aaee6670fb4d54988a10ffedd4d968477113e8acc44ac7d64e07d68a2906a91f32d19e3e0f43503b72ef5
6
+ metadata.gz: f2f081d723f5bce1294f82de0300af497ea1b94ffa932567f5d74cd3b382578f576f4272648d2144c68aea7ca9eae49d835fd1e884786a820bef9659c54f5baf
7
+ data.tar.gz: 58d93cbf354ed74b1d1c0e93ab3a4f6f8231ac8ce72060856147ce5eff5f6e830b2a01bdc0964be0d1c04f1d8b93acdc08ece1657dc1d4deb6f7cb8711870a8e
@@ -17,7 +17,8 @@ module Bibliothecary
17
17
  # file that's actually on the filesystem
18
18
  nil
19
19
  else
20
- File.open(@full_path).read
20
+ # Remove any Byte Order Marks so JSON, etc don't fail while parsing them.
21
+ File.open(@full_path).read.sub(/^\xEF\xBB\xBF/, '')
21
22
  end
22
23
  end
23
24
  end
@@ -209,8 +209,6 @@ module Bibliothecary
209
209
  end
210
210
  end
211
211
  .compact
212
- # Prefer duplicate deps with the aliased ones first, so we don't lose the aliases in the next uniq step.
213
- .sort_by { |dep| dep.key?(:original_name) || dep.key?(:original_requirement) ? 0 : 1 }
214
212
  .uniq { |item| item.values_at(:name, :requirement, :type, :original_name, :original_requirement) }
215
213
  end
216
214
 
@@ -71,7 +71,9 @@ module Bibliothecary
71
71
 
72
72
  def each_analysis_and_rfis
73
73
  @multiple_file_entries.each do |file|
74
- analysis = @runner.analyse_file(file, File.read(File.join(@path, file)))
74
+ # Remove any Byte Order Marks so JSON, etc don't fail while parsing them.
75
+ contents = File.read(File.join(@path, file)).sub(/^\xEF\xBB\xBF/, '')
76
+ analysis = @runner.analyse_file(file, contents)
75
77
  rfis_for_file = @related_files_info_entries.find_all { |rfi| rfi.lockfiles.include?(file) }
76
78
 
77
79
  yield analysis, rfis_for_file
@@ -116,6 +116,9 @@ module Bibliothecary
116
116
 
117
117
  # Read a manifest file and extract the list of dependencies from that file.
118
118
  def analyse_file(file_path, contents)
119
+ # Remove any Byte Order Marks so JSON, etc don't fail while parsing them.
120
+ contents = contents.sub(/^\xEF\xBB\xBF/, '')
121
+
119
122
  package_managers.select { |pm| pm.match?(file_path, contents) }.map do |pm|
120
123
  pm.analyse_contents(file_path, contents, options: @options)
121
124
  end.flatten.uniq.compact
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "8.4.3"
2
+ VERSION = "8.4.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: 8.4.3
4
+ version: 8.4.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: 2022-08-22 00:00:00.000000000 Z
11
+ date: 2022-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tomlrb
@@ -339,7 +339,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
339
339
  - !ruby/object:Gem::Version
340
340
  version: '0'
341
341
  requirements: []
342
- rubygems_version: 3.1.6
342
+ rubygems_version: 3.3.22
343
343
  signing_key:
344
344
  specification_version: 4
345
345
  summary: Find and parse manifests