right_scraper 5.2.3 → 5.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/right_scraper-retrieve +4 -2
- data/bin/right_scraper-scan +3 -3
- data/lib/right_scraper/main.rb +5 -8
- data/lib/right_scraper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72742c44a4b3b388890b5b5cfeca507fd73f1378
|
4
|
+
data.tar.gz: a105f03f00ecfdda21074cfd95833555f4c8f8bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f7e803cab8c2a9bfe872e80280bf5aa3af99adbd9531b4a821f4ebc0e2c04db5db64bdca1970376ef967703977eb72a3f3216f6cf76695f60d1c907f139a8cd
|
7
|
+
data.tar.gz: fc00f4ecc3f8f9cdf53dc5d75c693a42abbf31f107b592f41ae49a01a667218210337b518141f85c2b7f6eb07668e4d85d0dfc3919f2e838ebc5c69c3eded083
|
data/bin/right_scraper-retrieve
CHANGED
@@ -69,14 +69,14 @@ begin
|
|
69
69
|
exit 0
|
70
70
|
rescue ::RightScraper::Error, ::RightGit::Shell::ShellError => e
|
71
71
|
# all explicitly raised scraper errors derive from these errors.
|
72
|
-
result = { errors: [e.message] }
|
72
|
+
result = { errors: [[e.class, :retreive, e.message]] }
|
73
73
|
$stderr.puts(::JSON.generate(result))
|
74
74
|
exit 3
|
75
75
|
rescue ::SystemExit => e
|
76
76
|
exit e.status
|
77
77
|
rescue ::Exception => e
|
78
78
|
result = {
|
79
|
-
errors: [
|
79
|
+
errors: [[e.class, :internal_error, e.message]],
|
80
80
|
unhandled_exception: {
|
81
81
|
class: e.class,
|
82
82
|
message: e.message,
|
@@ -88,3 +88,5 @@ rescue ::Exception => e
|
|
88
88
|
ensure
|
89
89
|
main.cleanup rescue nil if main
|
90
90
|
end
|
91
|
+
|
92
|
+
@logger.note_error($!, :available, "download retriever is unavailable")
|
data/bin/right_scraper-scan
CHANGED
@@ -65,7 +65,7 @@ begin
|
|
65
65
|
# CookbookMetadata. the reason is that we expect this scanner to only be
|
66
66
|
# called in unprivileged isolation followed by more scanners with more
|
67
67
|
# privileges and only the latter need to return fully resolved resources.
|
68
|
-
if main.scanners != [RightScraper::Scanners::CookbookMetadata]
|
68
|
+
if main.scanners != [::RightScraper::Scanners::CookbookMetadata]
|
69
69
|
result[:resources] = main.resources.map do |r|
|
70
70
|
# remove relational repository from each returned cookbook due to being
|
71
71
|
# the same for each resource and already known to caller.
|
@@ -83,14 +83,14 @@ begin
|
|
83
83
|
exit 0
|
84
84
|
rescue ::RightScraper::Error, ::RightGit::Shell::ShellError => e
|
85
85
|
# all explicitly raised scraper errors derive from these errors.
|
86
|
-
result = { errors: [e.message] }
|
86
|
+
result = { errors: [[e.class, :scan, e.message]] }
|
87
87
|
$stderr.puts(::JSON.generate(result))
|
88
88
|
exit 3
|
89
89
|
rescue ::SystemExit => e
|
90
90
|
exit e.status
|
91
91
|
rescue ::Exception => e
|
92
92
|
result = {
|
93
|
-
errors: [
|
93
|
+
errors: [[e.class, :internal_error, e.message]],
|
94
94
|
unhandled_exception: {
|
95
95
|
class: e.class,
|
96
96
|
message: e.message,
|
data/lib/right_scraper/main.rb
CHANGED
@@ -38,8 +38,7 @@ module RightScraper
|
|
38
38
|
# class functionality.
|
39
39
|
class Main
|
40
40
|
|
41
|
-
|
42
|
-
attr_reader :resources
|
41
|
+
attr_reader :logger, :resources
|
43
42
|
|
44
43
|
# Initialize scrape destination directory
|
45
44
|
#
|
@@ -61,7 +60,6 @@ module RightScraper
|
|
61
60
|
:scanners => nil,
|
62
61
|
:builders => nil,
|
63
62
|
).merge(options)
|
64
|
-
@old_logger_callback = nil
|
65
63
|
@temporary = !options.has_key?(:basedir)
|
66
64
|
options[:basedir] ||= Dir.mktmpdir
|
67
65
|
options[:logger] ||= ::RightScraper::Loggers::Default.new
|
@@ -110,12 +108,12 @@ module RightScraper
|
|
110
108
|
# === Raise
|
111
109
|
# 'Invalid repository type':: If repository type is not known
|
112
110
|
def scrape(repo, incremental=true, &callback)
|
113
|
-
|
111
|
+
old_logger_callback = @logger.callback
|
114
112
|
@logger.callback = callback
|
115
113
|
errorlen = errors.size
|
116
114
|
begin
|
117
|
-
if retrieved = retrieve(repo
|
118
|
-
scan(retrieved
|
115
|
+
if retrieved = retrieve(repo)
|
116
|
+
scan(retrieved)
|
119
117
|
end
|
120
118
|
rescue Exception
|
121
119
|
# legacy logger handles communication with the end user and appending
|
@@ -123,6 +121,7 @@ module RightScraper
|
|
123
121
|
# has no such guaranteed communication so the caller will decide how to
|
124
122
|
# handle errors, etc.
|
125
123
|
ensure
|
124
|
+
@logger.callback = old_logger_callback
|
126
125
|
cleanup
|
127
126
|
end
|
128
127
|
errors.size == errorlen
|
@@ -188,8 +187,6 @@ module RightScraper
|
|
188
187
|
|
189
188
|
# cleans up temporary files, etc.
|
190
189
|
def cleanup
|
191
|
-
@logger.callback = @old_logger_callback
|
192
|
-
@old_logger_callback = nil
|
193
190
|
::FileUtils.remove_entry_secure(base_dir) rescue nil if @temporary
|
194
191
|
end
|
195
192
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: right_scraper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.2.
|
4
|
+
version: 5.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Raphael Simon
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-03-
|
13
|
+
date: 2016-03-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: right_aws
|