commander 4.4.7 → 4.5.0

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
2
  SHA256:
3
- metadata.gz: 9bb88c28e0d43c3616cceb161661a306fbcb74ef6c68ce67bc5aee8e820498cd
4
- data.tar.gz: 9c5295c278179f4325c179b61a07182c45f3ed911b8228294cdf53e83cb6fe74
3
+ metadata.gz: 01bdbd13d121e9ed4efc4a21970fd4465d3f2e516a6440499b67e6bd32868b0d
4
+ data.tar.gz: 6bd6e26d357bf26af390ebd4be9a33f7c1f1c91c3efc296b4d21cb138887ac15
5
5
  SHA512:
6
- metadata.gz: 977685b95002c9e0dcaafd60da783473dc1e2d90f72eec6c1fc209d7ba6ff498f7941f2ac263244775d58d5f41b7bda7e57d7a39041963d8ec85852c20b99ee9
7
- data.tar.gz: 2c2eb1a834b1446b61d0ac7dbeb8f0575f80ab10e57d432a6710c4e37eb24eb870a6312655be5f27f3d4250505320f04fb46c763f91ef688b9e6c96fa573b45e
6
+ metadata.gz: c806f1a602eb89351344ff1f7209ec63f547a4659ee62678117cd77795bdc0e9579c8a3e3fecd34a0b167315ab4bdede104485be2e9682d05b2dcea34e170312
7
+ data.tar.gz: db8f3b2fc17a1a790533b6d6609bcd5a0904bfb426549a6e6de9707f1ac804ee552efa338c07ef48ec8b2634892858ba4522d0292793064be8cba1f486a78270
@@ -4,11 +4,10 @@ before_install:
4
4
  - gem update --system
5
5
  - gem update bundler
6
6
  rvm:
7
- - 1.9.3
8
- - 2.0.0
9
- - 2.1.10
10
- - 2.2.9
11
- - 2.3.6
12
- - 2.4.3
13
- - 2.5.0
14
- - jruby-19mode
7
+ - 2.3
8
+ - 2.4
9
+ - 2.5
10
+ - 2.6
11
+ - 2.7
12
+ - jruby
13
+ - ruby-head
@@ -1,3 +1,8 @@
1
+ === 4.5.0 / 2020-01-21
2
+
3
+ * Drop support for Ruby < 2.3.
4
+ * Fix bug parsing double dash (#75).
5
+
1
6
  === 4.4.7 / 2018-10-22
2
7
 
3
8
  * Update HighLine dependency to 2.0.0. (@rohitpaulk)
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Commander
2
- VERSION = '4.4.7'.freeze
2
+ VERSION = '4.5.0'.freeze
3
3
  end
@@ -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.7
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: 2018-10-22 00:00:00.000000000 Z
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
- rubyforge_project:
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