commander-openflighthpc 1.1.0 → 1.1.1

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: 9244a36a96cd23607e4b23d95d63cde73ccad177b578c6634399379532c3490d
4
- data.tar.gz: e225760491eb6d17a4481500883ae97cf401adf4e65cc2a9f31d67b9b6efcd98
3
+ metadata.gz: 6c0a592cbb12504621312f36cdddf097c323c86a950e3f7d7c37a4562c4abbf1
4
+ data.tar.gz: 649c690cdc63d4a0d1ce417c25c99200be22f801b413cf0ec845fcb56c556c52
5
5
  SHA512:
6
- metadata.gz: b526cf9a75f0841eec29365ea8ebec7d256cc89801558e16e68c122149f0febec34b5419ab932551906c1422a8787c72ea5ca7faf9737c9bb523eefce7881026
7
- data.tar.gz: ed26d596f553496191a3f9235cec46db82ba46143d5151ef4508812b4fdb9db7b560ef76608762d022f2b9ec110cfe9fd1e32aad1aeaf5efbda504f16ea4c3ff
6
+ metadata.gz: fcb2dbdcf5e576bcdca50f36630112abb7fc0ca41d6571a24ae8712356f47c776bf0da0fda254c741d59e980b08d406e6bdd634d2a0bec131741237abada85de
7
+ data.tar.gz: 379386f9349b2db8d3745133101fef5971cc84e2013567fb439ec01cb3ceabe17150fc219e082a9207d499254b4ff29ebab0b33e90a3b85ad2aa200430643dc0
@@ -333,9 +333,19 @@ module Commander
333
333
  ##
334
334
  # Limit commands to those which are subcommands of the one that is active
335
335
  def limit_commands_to_subcommands(command)
336
- commands.reject! { |k, v|
337
- (k.to_s == command.name) ? true : !k.to_s.start_with?("#{command.name} ")
338
- }
336
+ commands.select! do |other_sym, _|
337
+ other = other_sym.to_s
338
+ # Do not match sub-sub commands (matches for a second space)
339
+ if /\A#{command.name}\s.*\s/.match?(other)
340
+ false
341
+ # Do match regular sub commands
342
+ elsif /\A#{command.name}\s/.match?(other)
343
+ true
344
+ # Do not match any other commands
345
+ else
346
+ false
347
+ end
348
+ end
339
349
  end
340
350
 
341
351
  ##
@@ -1,3 +1,3 @@
1
1
  module Commander
2
- VERSION = '1.1.0'.freeze
2
+ VERSION = '1.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commander-openflighthpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alces Flight Ltd
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-04-10 00:00:00.000000000 Z
13
+ date: 2019-09-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: highline
@@ -178,20 +178,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  - !ruby/object:Gem::Version
179
179
  version: '0'
180
180
  requirements: []
181
- rubyforge_project:
182
- rubygems_version: 2.7.6
181
+ rubygems_version: 3.0.3
183
182
  signing_key:
184
183
  specification_version: 4
185
184
  summary: The complete solution for Ruby command-line executables
186
- test_files:
187
- - spec/command_spec.rb
188
- - spec/configure_spec.rb
189
- - spec/core_ext/array_spec.rb
190
- - spec/core_ext/object_spec.rb
191
- - spec/help_formatters/terminal_compact_spec.rb
192
- - spec/help_formatters/terminal_spec.rb
193
- - spec/methods_spec.rb
194
- - spec/patches/validate_inputs_spec.rb
195
- - spec/runner_spec.rb
196
- - spec/spec_helper.rb
197
- - spec/ui_spec.rb
185
+ test_files: []