bibliothecary 8.7.1 → 8.7.3
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: 9d0f05bf5e90424caec70a51181e2fcdeef5ad3ba8ab03109cd765f2ea2943b0
|
4
|
+
data.tar.gz: e40d4ab5813287042f421c719df563869f2a6b3b8647d038e666b4e2bfc830c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 279dd423656e36ce95d8ef56f4c6377019b8f101d2d57c71c8fcecba09c62bb2bb50deb0b98f996045f79f798021ef0eadaae351b2cfc5ca3ca9ad8b78fc80f4
|
7
|
+
data.tar.gz: 52e317e720768a405d9f2c77e1f855a025274da31b8460784524cff825715f19b58be1f158505de099c026e8ed292bd7008ec8a468bb733bba1e7787294e248b
|
@@ -42,7 +42,7 @@ module Bibliothecary
|
|
42
42
|
|
43
43
|
dependencies_to_analysis(info, kind, dependencies)
|
44
44
|
rescue Bibliothecary::FileParsingError => e
|
45
|
-
Bibliothecary::Analyser::create_error_analysis(platform_name, info.relative_path, kind, e.message)
|
45
|
+
Bibliothecary::Analyser::create_error_analysis(platform_name, info.relative_path, kind, e.message, e.location)
|
46
46
|
end
|
47
47
|
alias analyze_contents_from_info analyse_contents_from_info
|
48
48
|
|
@@ -84,7 +84,10 @@ module Bibliothecary
|
|
84
84
|
|
85
85
|
rescue Exception => e # default is StandardError but C bindings throw Exceptions
|
86
86
|
# the C xml parser also puts a newline at the end of the message
|
87
|
-
|
87
|
+
location = e.backtrace_locations[0]
|
88
|
+
.to_s
|
89
|
+
.then { |l| l =~ /bibliothecary\// ? l.split("bibliothecary/").last : l.split("gems/").last }
|
90
|
+
raise Bibliothecary::FileParsingError.new(e.message.strip, filename, location)
|
88
91
|
end
|
89
92
|
|
90
93
|
private
|
@@ -4,14 +4,15 @@ require_relative './analyser/analysis.rb'
|
|
4
4
|
|
5
5
|
module Bibliothecary
|
6
6
|
module Analyser
|
7
|
-
def self.create_error_analysis(platform_name, relative_path, kind, message)
|
7
|
+
def self.create_error_analysis(platform_name, relative_path, kind, message, location=nil)
|
8
8
|
{
|
9
9
|
platform: platform_name,
|
10
10
|
path: relative_path,
|
11
11
|
dependencies: nil,
|
12
12
|
kind: kind,
|
13
13
|
success: false,
|
14
|
-
error_message: message
|
14
|
+
error_message: message,
|
15
|
+
error_location: location,
|
15
16
|
}
|
16
17
|
end
|
17
18
|
|
@@ -8,9 +8,10 @@ module Bibliothecary
|
|
8
8
|
end
|
9
9
|
|
10
10
|
class FileParsingError < StandardError
|
11
|
-
attr_accessor :filename
|
12
|
-
def initialize(msg, filename)
|
11
|
+
attr_accessor :filename, :location
|
12
|
+
def initialize(msg, filename, location=nil)
|
13
13
|
@filename = filename
|
14
|
+
@location = location # source code location of the error, e.g. "lib/hi.rb:34"
|
14
15
|
msg = "#{filename}: #{msg}" unless msg.include?(filename)
|
15
16
|
super("#{msg}")
|
16
17
|
end
|
@@ -254,6 +254,10 @@ module Bibliothecary
|
|
254
254
|
end
|
255
255
|
|
256
256
|
def self.parse_resolved_dep_line(line)
|
257
|
+
# filter out anything that doesn't look like a
|
258
|
+
# resolved dep line
|
259
|
+
return unless line[/ .*:[^-]+-- /]
|
260
|
+
|
257
261
|
dep_parts = line.strip.split(":")
|
258
262
|
return unless dep_parts.length == 5
|
259
263
|
# org.springframework.boot:spring-boot-starter-web:jar:2.0.3.RELEASE:compile[36m -- module spring.boot.starter.web[0;1m [auto][m
|
@@ -365,6 +369,8 @@ module Bibliothecary
|
|
365
369
|
|
366
370
|
value = field.nodes.first
|
367
371
|
value = value.value if value.is_a?(Ox::CData)
|
372
|
+
# whitespace in dependency tags should be ignored
|
373
|
+
value = value&.strip
|
368
374
|
match = value&.match(MAVEN_PROPERTY_REGEX)
|
369
375
|
if match
|
370
376
|
return extract_property(xml, match[1], value, parent_properties)
|
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.7.
|
4
|
+
version: 8.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Nesbitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tomlrb
|