usps-imis-api 0.11.22 → 0.11.23.pre.2
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 690eeab45bff9f7e01d7aed53bb7838e5f85a2c8a8444a7f2b4435413f8bd704
|
|
4
|
+
data.tar.gz: dadb92a170ff2ae738514db3f4d146e05ef4f83f1cbcaa687988ecc488f0c101
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 756bd8e335ad004d797d7d1d179c21e594758bc95299b127f2da951ac7ec37d6098449496e090f1a08a1b368f5af4e85bea9a549fedae8b970561a913e60ca25
|
|
7
|
+
data.tar.gz: 8cf3e0597d81b2b1b8beacc2fcc095fd6d86484f13faad52bb8ad2f6ba9303731a7584438c87831b618e51a52234b0d4d12dc3d14fc3c51cfb6807ae807af428
|
|
@@ -25,7 +25,7 @@ module Usps
|
|
|
25
25
|
|
|
26
26
|
def initialize(**)
|
|
27
27
|
@options = input_options.merge(**)
|
|
28
|
-
validate_options!
|
|
28
|
+
return if validate_options! # DEBUG
|
|
29
29
|
configure! if options[:config]
|
|
30
30
|
logging!
|
|
31
31
|
@logger ||= Imis.logger('CommandLine')
|
|
@@ -49,7 +49,7 @@ module Usps
|
|
|
49
49
|
|
|
50
50
|
# :nocov:
|
|
51
51
|
def input_options
|
|
52
|
-
if ENV.fetch('CI', false)
|
|
52
|
+
if ENV.fetch('CI', false) || ENV.fetch('TESTING', false)
|
|
53
53
|
defaults = {
|
|
54
54
|
raw: false,
|
|
55
55
|
quiet: false,
|
|
@@ -197,7 +197,7 @@ module Usps
|
|
|
197
197
|
def validate_options!
|
|
198
198
|
return unless options[:log_level] == 'info' && options.except(:log_level, :quiet).values.none?
|
|
199
199
|
|
|
200
|
-
|
|
200
|
+
true
|
|
201
201
|
end
|
|
202
202
|
end
|
|
203
203
|
end
|
|
@@ -99,6 +99,8 @@ module Usps
|
|
|
99
99
|
@options = parse_options.compact
|
|
100
100
|
@arguments = ARGV # Not currently used
|
|
101
101
|
|
|
102
|
+
Optimist.educate if ARGV.empty? && defaults?
|
|
103
|
+
|
|
102
104
|
# :nocov:
|
|
103
105
|
@options[:data] = read_stdin if stdin?
|
|
104
106
|
# :nocov:
|
|
@@ -126,6 +128,8 @@ module Usps
|
|
|
126
128
|
def stdin? = $stdin.wait_readable(0)
|
|
127
129
|
def read_stdin = $stdin.read.chomp
|
|
128
130
|
# :nocov:
|
|
131
|
+
|
|
132
|
+
def defaults? = options[:log_level] == 'info' && options.except(:log_level).values.none?
|
|
129
133
|
end
|
|
130
134
|
end
|
|
131
135
|
end
|
data/lib/usps/imis/version.rb
CHANGED