commander 4.4.5 → 4.4.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3a1cbc50f621accf022cc6ff4e1d753c897014b8
4
- data.tar.gz: e43562746b1399a48c7e106fdddff3a504659b23
2
+ SHA256:
3
+ metadata.gz: 584705d6b59c75d49df6d2369763f91b5a5dbc5013575dbb2be575983b040f60
4
+ data.tar.gz: 0bab3911300bcc194406717c08ab1718608c86fe62703f0219a16a645bded947
5
5
  SHA512:
6
- metadata.gz: 1102742dbd50e6d51804db0856a17311d34204c3131d66f8e11a53e7f3cee9ef564c3e093721118118ee44c1d327e67f8a7b5bf96b1e73a8a8c6104b10d23c24
7
- data.tar.gz: e0b816eb1a4bc45348c317455939e548d5386e0d20fa79380ec00ed265552f8cb030d316702dac5a0463741e0fcce90701c3202fa4a21c2f68011e7fd5168574
6
+ metadata.gz: 1bb1d5703d53f0c6a140e7f24e0d4c9f0e80283425b2daf49d80da554a78122d4eb731bb9ee817c11e0636732938ffab81367312f599b40c3c8f8dc036ab9604
7
+ data.tar.gz: 1da0b8c354a4b0fc744e170c6d6e3393ddbb759ae9fecf50cf06274ee1611dd48d1f9c69e0414c3b28d2d810d56e0a6348c17eec3c58b084dd14f594a7f9a3b4
@@ -1,3 +1,7 @@
1
+ === 4.4.6 / 2018-07-31
2
+
3
+ * Fix unexpected internal behavior change introduced in 4.4.5.
4
+
1
5
  === 4.4.5 / 2018-05-22
2
6
 
3
7
  * Make internal command state less mutable. (@doriantaylor)
@@ -161,6 +161,9 @@ module Commander
161
161
 
162
162
  def parse_options_and_call_procs(*args)
163
163
  return args if args.empty?
164
+ # empty proxy_options before populating via OptionParser
165
+ # prevents duplication of options if the command is run twice
166
+ proxy_options.clear
164
167
  @options.each_with_object(OptionParser.new) do |option, opts|
165
168
  opts.on(*option[:args], &option[:proc])
166
169
  opts
@@ -175,9 +178,6 @@ module Commander
175
178
  meth ||= :call
176
179
  options = proxy_option_struct
177
180
 
178
- # empty the proxy option stack before the next invocation
179
- proxy_options.clear
180
-
181
181
  case object
182
182
  when Proc then object.call(args, options)
183
183
  when Class then meth != :call ? object.new.send(meth, args, options) : object.new(args, options)
@@ -1,3 +1,3 @@
1
1
  module Commander
2
- VERSION = '4.4.5'.freeze
2
+ VERSION = '4.4.6'.freeze
3
3
  end
@@ -80,9 +80,11 @@ describe Commander::Command do
80
80
  expect(@command.run('twice')).to eql('test twice')
81
81
  end
82
82
 
83
- it 'should empty @proxy_options after running' do
83
+ it 'should not accumulate entries in @proxy_options when run twice' do
84
84
  expect(@command.run('--verbose')).to eql('test ')
85
- expect(@command.proxy_options.empty?).to be true
85
+ expect(@command.proxy_options).to eq([[:verbose, true]])
86
+ expect(@command.run('foo')).to eql('test foo')
87
+ expect(@command.proxy_options).to eq([])
86
88
  end
87
89
  end
88
90
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commander
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.5
4
+ version: 4.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - TJ Holowaychuk
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-05-22 00:00:00.000000000 Z
12
+ date: 2018-08-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: highline
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
157
  version: '0'
158
158
  requirements: []
159
159
  rubyforge_project:
160
- rubygems_version: 2.6.11
160
+ rubygems_version: 2.7.4
161
161
  signing_key:
162
162
  specification_version: 4
163
163
  summary: The complete solution for Ruby command-line executables