eac_cli 0.27.5 → 0.27.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 938ea5f13a60ee96410614ad3a2467e1ee172f0edbbf8a853169f0c563f61fc6
4
- data.tar.gz: ac6f3fde9506adc953a59e96b8c152037233c7609e8194e65a70534dd2f2e358
3
+ metadata.gz: 8074cfe9580c8103db140e84f6a32fbfbea63c06007d4a08bc46bc705b4c56a3
4
+ data.tar.gz: 5db658ef64ca76d926d3c24f1107e9686d95870b2157eab051973c429d34955e
5
5
  SHA512:
6
- metadata.gz: fc0d1c69a1f274767b42dcd34456c004edf0896623c7791bc87e1d23fdfd92df65b5ce960e84c1341897b196ba4337de16d1c6e517966d0e6340e86059c2ff9c
7
- data.tar.gz: f9dd8eb35bb94e9cdf58d78021ef07f7fea1a9437c57300085bc8a835505100bfaa582fdf7d1f76b97a5cf959d3266bd980a33a38e6f6511f6a0cd5b77be7fee
6
+ metadata.gz: 3cbcd651d6f18e653ddf3d6773b7d432a5c8d104894b5e3fded7636070fee14838d79ef5aca22e8f1d240c8ee4d8a5d0b591d4b3a0e5ba8071375760d75f4c08
7
+ data.tar.gz: 1b79c22c71d73174c25eeeb8015f21bb63b8d2c99a677969a3f1fad830bbe5ecc575d801214732dece245454fae1ee6450f22815f5572c1bf49674fed769985a
data/Gemfile CHANGED
@@ -3,3 +3,6 @@
3
3
  source 'https://rubygems.org'
4
4
 
5
5
  gemspec
6
+
7
+ local_gemfile = ::File.join(::File.dirname(__FILE__), 'Gemfile.local')
8
+ eval_gemfile local_gemfile if ::File.exist?(local_gemfile)
@@ -12,6 +12,14 @@ module EacCli
12
12
  def runner?(object)
13
13
  ::EacCli::Runner.runner?(object)
14
14
  end
15
+
16
+ # @return [Hash<String, EacCli::Runner>]
17
+ def subcommands_from_module(a_module)
18
+ a_module.constants
19
+ .map { |name| [name.to_s.underscore.gsub('_', '-'), a_module.const_get(name)] }
20
+ .select { |c| runner?(c[1]) }
21
+ .to_h.with_indifferent_access
22
+ end
15
23
  end
16
24
 
17
25
  common_concern do
@@ -26,11 +34,9 @@ module EacCli
26
34
  @available_subcommands ||= available_subcommands_auto.merge(available_subcommands_extra)
27
35
  end
28
36
 
37
+ # @return [Hash<String, EacCli::Runner>]
29
38
  def available_subcommands_auto
30
- self.class.constants
31
- .map { |name| [name.to_s.underscore.gsub('_', '-'), self.class.const_get(name)] }
32
- .select { |c| ::EacCli::RunnerWith::Subcommands.runner?(c[1]) }
33
- .to_h.with_indifferent_access
39
+ ::EacCli::RunnerWith::Subcommands.subcommands_from_module(self.class)
34
40
  end
35
41
 
36
42
  def available_subcommands_extra
@@ -41,6 +47,10 @@ module EacCli
41
47
  end
42
48
  end
43
49
 
50
+ def available_subcommands_to_s
51
+ available_subcommands.keys.sort.join(', ')
52
+ end
53
+
44
54
  def help_extra_text
45
55
  (['Subcommands:'] + available_subcommands.keys.sort.map { |s| " #{s}" })
46
56
  .map { |v| "#{v}\n" }.join
@@ -95,7 +105,7 @@ module EacCli
95
105
  raise(::EacCli::Parser::Error.new(
96
106
  self.class.runner_definition, runner_context.argv,
97
107
  "Subcommand \"#{subcommand_name}\" not found " \
98
- "(Available: #{available_subcommands.keys})"
108
+ "(Available: #{available_subcommands_to_s})"
99
109
  ))
100
110
  end
101
111
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacCli
4
- VERSION = '0.27.5'
4
+ VERSION = '0.27.8'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.5
4
+ version: 0.27.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-21 00:00:00.000000000 Z
11
+ date: 2022-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize