commander 4.4.7 → 4.5.0
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 +4 -4
- data/.travis.yml +7 -8
- data/History.rdoc +5 -0
- data/lib/commander/runner.rb +1 -1
- data/lib/commander/version.rb +1 -1
- data/spec/runner_spec.rb +14 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01bdbd13d121e9ed4efc4a21970fd4465d3f2e516a6440499b67e6bd32868b0d
|
4
|
+
data.tar.gz: 6bd6e26d357bf26af390ebd4be9a33f7c1f1c91c3efc296b4d21cb138887ac15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c806f1a602eb89351344ff1f7209ec63f547a4659ee62678117cd77795bdc0e9579c8a3e3fecd34a0b167315ab4bdede104485be2e9682d05b2dcea34e170312
|
7
|
+
data.tar.gz: db8f3b2fc17a1a790533b6d6609bcd5a0904bfb426549a6e6de9707f1ac804ee552efa338c07ef48ec8b2634892858ba4522d0292793064be8cba1f486a78270
|
data/.travis.yml
CHANGED
data/History.rdoc
CHANGED
data/lib/commander/runner.rb
CHANGED
@@ -328,7 +328,6 @@ module Commander
|
|
328
328
|
# again for the command.
|
329
329
|
|
330
330
|
def remove_global_options(options, args)
|
331
|
-
# TODO: refactor with flipflop, please TJ ! have time to refactor me !
|
332
331
|
options.each do |option|
|
333
332
|
switches = option[:switches].dup
|
334
333
|
next if switches.empty?
|
@@ -341,6 +340,7 @@ module Commander
|
|
341
340
|
|
342
341
|
past_switch, arg_removed = false, false
|
343
342
|
args.delete_if do |arg|
|
343
|
+
break if arg == '--'
|
344
344
|
if switches.any? { |s| s[0, arg.length] == arg }
|
345
345
|
arg_removed = !switch_has_arg
|
346
346
|
past_switch = true
|
data/lib/commander/version.rb
CHANGED
data/spec/runner_spec.rb
CHANGED
@@ -643,4 +643,18 @@ describe Commander do
|
|
643
643
|
end.run!
|
644
644
|
end
|
645
645
|
end
|
646
|
+
|
647
|
+
describe 'with double dash' do
|
648
|
+
it 'should interpret the remainder as arguments' do
|
649
|
+
new_command_runner 'foo', '--', '-x' do
|
650
|
+
command('foo') do |c|
|
651
|
+
c.option '-x', 'Switch'
|
652
|
+
c.when_called do |args, options|
|
653
|
+
expect(args).to eq(%w(-x))
|
654
|
+
expect(options.x).to be_nil
|
655
|
+
end
|
656
|
+
end
|
657
|
+
end.run!
|
658
|
+
end
|
659
|
+
end
|
646
660
|
end
|
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
|
+
version: 4.5.0
|
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:
|
12
|
+
date: 2020-01-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: highline
|
@@ -156,8 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
156
|
- !ruby/object:Gem::Version
|
157
157
|
version: '0'
|
158
158
|
requirements: []
|
159
|
-
|
160
|
-
rubygems_version: 2.7.4
|
159
|
+
rubygems_version: 3.0.2
|
161
160
|
signing_key:
|
162
161
|
specification_version: 4
|
163
162
|
summary: The complete solution for Ruby command-line executables
|