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 +5 -5
- data/History.rdoc +4 -0
- data/lib/commander/command.rb +3 -3
- data/lib/commander/version.rb +1 -1
- data/spec/command_spec.rb +4 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 584705d6b59c75d49df6d2369763f91b5a5dbc5013575dbb2be575983b040f60
|
4
|
+
data.tar.gz: 0bab3911300bcc194406717c08ab1718608c86fe62703f0219a16a645bded947
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bb1d5703d53f0c6a140e7f24e0d4c9f0e80283425b2daf49d80da554a78122d4eb731bb9ee817c11e0636732938ffab81367312f599b40c3c8f8dc036ab9604
|
7
|
+
data.tar.gz: 1da0b8c354a4b0fc744e170c6d6e3393ddbb759ae9fecf50cf06274ee1611dd48d1f9c69e0414c3b28d2d810d56e0a6348c17eec3c58b084dd14f594a7f9a3b4
|
data/History.rdoc
CHANGED
data/lib/commander/command.rb
CHANGED
@@ -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)
|
data/lib/commander/version.rb
CHANGED
data/spec/command_spec.rb
CHANGED
@@ -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
|
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
|
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.
|
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-
|
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.
|
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
|