answersengine 0.9.1 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/answersengine/scraper/executor.rb +24 -9
- data/lib/answersengine/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: b3ed8df061a911c8fb80e5cba4201031b2bd2bae
|
4
|
+
data.tar.gz: ac6b34dd58ee67cb6023995432ff8335824bffcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80e120af141c6b5ea9ba2e99fa91ce2c5ea1b7a82eb27b8993385c4f1944b4f75c3cf5ee8ec3b469afccedbbe593690bbd46244c5ac2d5695d3ccae92eaeadad
|
7
|
+
data.tar.gz: a643e4f625da20bfa43d5a739e9cf53b70dcebf5babd582282cb00be5b6777092ff76780c2bbb13561a30613a69ea10be4369b6c56def836a9fae5feecb89854
|
@@ -267,9 +267,10 @@ module AnswersEngine
|
|
267
267
|
unless pages_slice.empty?
|
268
268
|
page_dups_ignored = pages_dup_count > 0 ? " (#{pages_dup_count} dups ignored)" : ''
|
269
269
|
log_msgs << "#{pages_slice.count} out of #{total_pages} Pages#{page_dups_ignored}"
|
270
|
+
|
270
271
|
unless save
|
271
272
|
puts '----------------------------------------'
|
272
|
-
puts "
|
273
|
+
puts "Trying to validate #{log_msgs.last}#{page_dups_ignored}"
|
273
274
|
puts JSON.pretty_generate pages_slice
|
274
275
|
end
|
275
276
|
end
|
@@ -277,16 +278,21 @@ module AnswersEngine
|
|
277
278
|
unless outputs_slice.empty?
|
278
279
|
output_dups_ignored = outputs_dup_count > 0 ? " (#{outputs_dup_count} dups ignored)" : ''
|
279
280
|
log_msgs << "#{outputs_slice.count} out of #{total_outputs} Outputs#{output_dups_ignored}"
|
281
|
+
|
280
282
|
unless save
|
281
283
|
puts '----------------------------------------'
|
282
|
-
puts "
|
284
|
+
puts "Trying to validate #{log_msgs.last}#{output_dups_ignored}"
|
283
285
|
puts JSON.pretty_generate outputs_slice
|
284
286
|
end
|
285
287
|
end
|
286
288
|
|
287
|
-
|
288
|
-
|
289
|
-
|
289
|
+
# behave differently if it is a real save
|
290
|
+
if save
|
291
|
+
log_msg = "Saving #{log_msgs.join(' and ')}."
|
292
|
+
puts "#{log_msg}"
|
293
|
+
else
|
294
|
+
status = "#{status}_try"
|
295
|
+
end
|
290
296
|
|
291
297
|
# saving to server
|
292
298
|
response = update_to_server(
|
@@ -297,11 +303,20 @@ module AnswersEngine
|
|
297
303
|
status: status)
|
298
304
|
|
299
305
|
if response.code == 200
|
300
|
-
|
301
|
-
|
306
|
+
if save
|
307
|
+
log_msg = "Saved."
|
308
|
+
puts "#{log_msg}"
|
309
|
+
else
|
310
|
+
puts "Validation successful"
|
311
|
+
end
|
302
312
|
else
|
303
|
-
|
304
|
-
|
313
|
+
if save
|
314
|
+
puts "Error: Unable to save Pages and/or Outputs to server: #{response.body}"
|
315
|
+
raise "Unable to save Pages and/or Outputs to server: #{response.body}"
|
316
|
+
else
|
317
|
+
puts "Error: Invalid Pages and/or Outputs: #{response.body}"
|
318
|
+
raise "Invalid Pages and/or Outputs: #{response.body}"
|
319
|
+
end
|
305
320
|
end
|
306
321
|
end
|
307
322
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: answersengine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Parama Danoesubroto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09
|
11
|
+
date: 2019-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|