answersengine 0.9.1 → 0.10.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a71f6315ab263a657c2930713228324c6dbdd88
4
- data.tar.gz: 8b4e43e3110245367182d2ac8b6b925301fe7046
3
+ metadata.gz: b3ed8df061a911c8fb80e5cba4201031b2bd2bae
4
+ data.tar.gz: ac6b34dd58ee67cb6023995432ff8335824bffcc
5
5
  SHA512:
6
- metadata.gz: 1ccb1d683e7f823d12e353d0bd658383a2466cffa5bd08062ae1db943e70171b7e42dd4d8d3bb211c25b55b9cf813e74473f0902757e28ff0b29f632c6f1a193
7
- data.tar.gz: 1a73d6ea5314573129c064d3e19167e7012c28ec5e59c0a1df31087b6c24ab6928eaaf031e738e100dca8b7f37bdb76fad9282d806c58231e276e9019a56fd01
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 "Would have saved #{log_msgs.last}#{page_dups_ignored}"
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 "Would have saved #{log_msgs.last}#{output_dups_ignored}"
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
- next unless save
288
- log_msg = "Saving #{log_msgs.join(' and ')}."
289
- puts "#{log_msg}"
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
- log_msg = "Saved."
301
- puts "#{log_msg}"
306
+ if save
307
+ log_msg = "Saved."
308
+ puts "#{log_msg}"
309
+ else
310
+ puts "Validation successful"
311
+ end
302
312
  else
303
- puts "Error: Unable to save Pages and/or Outputs to server: #{response.body}"
304
- raise "Unable to save Pages and/or Outputs to server: #{response.body}"
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
@@ -1,3 +1,3 @@
1
1
  module AnswersEngine
2
- VERSION = "0.9.1"
2
+ VERSION = "0.10.0"
3
3
  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.9.1
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-25 00:00:00.000000000 Z
11
+ date: 2019-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor