bibliothecary 8.4.5 → 8.4.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33e04a00975f760b9181b0abd40f0e95d16cd13be398a451b66fb23515df11fa
|
4
|
+
data.tar.gz: 697ee1d7cbebdb1a1cfbce80263ef1d3d9a7d68e154aca137988e14ba96a8c22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 792317a507641d26ec0903d59962c4e9949e253926346128c6c9d56c82a2716484163fe2c1cf626c10d967c19872c9c610fd12f9dcb7f2c5f27270be05a4ce29
|
7
|
+
data.tar.gz: 24795027d27690ea19467426cc9499ea93941d9eae184b02100900bfb6eb310f8f9de94e1baa24d2969e51f03b6a85c995bb16c53f5b77c4a011a9622309556e
|
@@ -17,8 +17,7 @@ module Bibliothecary
|
|
17
17
|
# file that's actually on the filesystem
|
18
18
|
nil
|
19
19
|
else
|
20
|
-
|
21
|
-
File.open(@full_path).read.sub(/^\xEF\xBB\xBF/, '')
|
20
|
+
contents = Bibliothecary.utf8_string(File.open(@full_path).read)
|
22
21
|
end
|
23
22
|
end
|
24
23
|
end
|
@@ -71,8 +71,7 @@ module Bibliothecary
|
|
71
71
|
|
72
72
|
def each_analysis_and_rfis
|
73
73
|
@multiple_file_entries.each do |file|
|
74
|
-
|
75
|
-
contents = File.read(File.join(@path, file)).sub(/^\xEF\xBB\xBF/, '')
|
74
|
+
contents = Bibliothecary.utf8_string(File.read(File.join(@path, file)))
|
76
75
|
analysis = @runner.analyse_file(file, contents)
|
77
76
|
rfis_for_file = @related_files_info_entries.find_all { |rfi| rfi.lockfiles.include?(file) }
|
78
77
|
|
data/lib/bibliothecary/runner.rb
CHANGED
@@ -116,8 +116,7 @@ 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
|
-
|
120
|
-
contents = contents.sub(/^\xEF\xBB\xBF/, '')
|
119
|
+
contents = Bibliothecary.utf8_string(contents)
|
121
120
|
|
122
121
|
package_managers.select { |pm| pm.match?(file_path, contents) }.map do |pm|
|
123
122
|
pm.analyse_contents(file_path, contents, options: @options)
|
data/lib/bibliothecary.rb
CHANGED
@@ -75,6 +75,12 @@ module Bibliothecary
|
|
75
75
|
configuration.ignored_files
|
76
76
|
end
|
77
77
|
|
78
|
+
def self.utf8_string(string)
|
79
|
+
string
|
80
|
+
.force_encoding("UTF-8") # treat all strings as utf8
|
81
|
+
.sub(/^\xEF\xBB\xBF/, '') # remove any Byte Order Marks so JSON, etc don't fail while parsing them.
|
82
|
+
end
|
83
|
+
|
78
84
|
class << self
|
79
85
|
attr_writer :configuration
|
80
86
|
alias analyze analyse
|
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.
|
4
|
+
version: 8.4.6
|
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-11-
|
11
|
+
date: 2022-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tomlrb
|