usps-imis-api 0.11.23.pre.4 → 0.11.23

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: 261fda1440a95cbd6be8cbcfc30c3c21d79dfeb43ea949a2eb389c274d40ae53
4
- data.tar.gz: a512730b2a2cd470337a79ea6afe44dfdc5beb141c7fdca790661fef6f9d948a
3
+ metadata.gz: 9f2842977f938199479a756b99cdf0a9849fa4b006940debfb08a576b92e389e
4
+ data.tar.gz: 485c9ed5663f2f538896e563d15991f59a1f8d810728d99b9465078321ecc657
5
5
  SHA512:
6
- metadata.gz: f0ca1499cbf0d6ce28318b9d009b1529244539facc14a5037347454ff8432d815b711f6e60d665d1dcde15d6a9efea97f71ebe71c6c83cececd5b7302eef35b4
7
- data.tar.gz: 5d5db43713e59826fd1bb5841b4150094b12030b29888225ca277c1194aa4a3b99005ea1769ec766827ac2a1a6c8122102dbe9ea3c447df8f6ae618366651a64
6
+ metadata.gz: 0ad85e740f53e024400bb491c9d818d48185d6dd2bd8dfdbc2a6befc09096034d57d580d96461cd552f5967b5c4b861db733ea352316c29ef8124cb14a7fa5d5
7
+ data.tar.gz: 0cbc1a0d52f8dd83bd1a7e2ec04db2963446b804c717cdcd6fbb820ad1bb1e02cb21de49bbfcae05bdd66eb789604213f482e66dd14fa91966d8f79895e7aaf0
@@ -25,7 +25,8 @@ module Usps
25
25
 
26
26
  def initialize(**)
27
27
  @options = input_options.merge(**)
28
- validate_options!
28
+ options[:version] = true if default_options?
29
+
29
30
  configure! if options[:config]
30
31
  logging!
31
32
  @logger ||= Imis.logger('CommandLine')
@@ -117,6 +118,8 @@ module Usps
117
118
  in auth_token: true then api.auth_token
118
119
 
119
120
  in certificate: then api.imis_id
121
+
122
+ in version: true then "#{Interface::NAME} (v#{Imis::VERSION})"
120
123
  end
121
124
  rescue NoMatchingPatternError => e
122
125
  raise Errors::CommandLineError, "Unable to match pattern from options: #{e.message}"
@@ -194,11 +197,7 @@ module Usps
194
197
  end
195
198
  end
196
199
 
197
- def validate_options!
198
- return unless options[:log_level] == 'info' && options.except(:log_level, :quiet).values.none?
199
-
200
- options[:version] = true
201
- end
200
+ def default_options? = options[:log_level] == 'info' && options.except(:log_level).values.none?
202
201
  end
203
202
  end
204
203
  end
@@ -99,7 +99,7 @@ module Usps
99
99
  @options = parse_options.compact
100
100
  @arguments = ARGV # Not currently used
101
101
 
102
- Optimist.educate if ARGV.empty? && defaults?
102
+ Optimist.educate if ARGV.empty? && defaults? # DEV: This shadows setting the --version flag by default
103
103
 
104
104
  # :nocov:
105
105
  @options[:data] = read_stdin if stdin?
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Usps
4
4
  module Imis
5
- VERSION = '0.11.23-4'
5
+ VERSION = '0.11.23'
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.23.pre.4
4
+ version: 0.11.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Fiander