usps-imis-api 0.11.33 → 0.11.34

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
  SHA256:
3
- metadata.gz: 3e3d6c99a4d3e83f82c970bea0e58ff9d1a5e4cdb1b6ad7625ba98d01d0a50a1
4
- data.tar.gz: 4909a61b655fe2dfd71506fe392c724de2c7a591cd5f5ea1538bbeb14bb9b206
3
+ metadata.gz: 898b26512f82544ff037e289bfe2466ac375bfa481a0c7ebf77d5d6c2d9ecf96
4
+ data.tar.gz: 1a01816c119999a2ca2e8b01ae75c83df028a9d2cc1542b174b23a2e49f2877e
5
5
  SHA512:
6
- metadata.gz: 75d864666dd5b275ea067d5b17e27faefc647bfb122c891cb487154820474fd1772262cdc571dabf14634e2e4bdf8ef0c5f1babfc42b0ea1daef1e90a9338804
7
- data.tar.gz: bd15a8b0e3039697cdc27f726fcf973b57255d311251deba67a0c76c3992b88f4e8937fa03779f0a1dd324b0793973ce099db48566445fd036c132f61c759d82
6
+ metadata.gz: 89ff926322610bc6eefaf4aa605d7ecc498d1240f577a39e8a3267ab923d744f6364c73da84afeb65eb8672114d315a043c7a5d3d492b10f788c5734f1be13b4
7
+ data.tar.gz: 5858b73de1805cc9ee93527964b9220c2bd3c7b91075913103adff9a36994e018f8ac2c40404e80d8afeda314c3e7d4e6ab6e5ea4ba82c12022d67347c3a6bd3
@@ -126,7 +126,15 @@ module Usps
126
126
  return
127
127
  end
128
128
 
129
- puts JSON.dump(yield) if block_given?
129
+ return unless block_given?
130
+
131
+ value = yield
132
+
133
+ if value.is_a?(Array) && @options[:jsonl]
134
+ puts(value.map { JSON.dump(it) })
135
+ else
136
+ puts JSON.dump(value)
137
+ end
130
138
  end
131
139
  # :nocov:
132
140
 
@@ -39,6 +39,7 @@ module Usps
39
39
  config: ['Path to the JSON/YAML config file to use', { type: :string, short: :C }],
40
40
  raw: ['Return raw JSON output, rather than simplified data', { short: :R }],
41
41
  include_ids: ["Include any #{'iMIS ID'.yellow} and #{'Ordinal'.yellow} properties in returned data"],
42
+ jsonl: ['Format array output as JSONL', { short: :j }],
42
43
  quiet: ["Suppress logging to #{'STDERR'.red}"],
43
44
  log: ["Redirect logging to #{'STDOUT'.red}"],
44
45
  log_level: ['Set the logging level', { type: :string, default: 'info', short: :L }]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Usps
4
4
  module Imis
5
- VERSION = '0.11.33'
5
+ VERSION = '0.11.34'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usps-imis-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.33
4
+ version: 0.11.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Fiander