eac_cli 0.27.0 → 0.27.3

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: 69e935a30736bec1a2d26e0d19e69017df9c47867e5ef46684e5a5b1ee921f43
4
- data.tar.gz: 763f811f75dcc03426dd46680de4d40f0caf27ba29515759004c0658fcca3002
3
+ metadata.gz: 13923176efdc8317f5f39295cb3e11e4735d66e7997580af8a5f3c8f2f0c03f4
4
+ data.tar.gz: 2f9edad2f2ea7484c88e9948f6c5ff47635b13ddfc2809fa2af481ebd0c347c9
5
5
  SHA512:
6
- metadata.gz: 027aa306152c1151fec35f16ba8a6c837f33c33cf7f11d424332c134377fa3176c3109d7db5020573bab573f8619c318c4126194c4e1f4296ce1f307e5baa5ed
7
- data.tar.gz: af8f7bb85efa509757d26fec255122ca7f6ede9056b0fdea3057149b0e4d3bd640b00be31c86c6bb29c73124e4342f051a654166f0ffdb8f472666c15329d1b4
6
+ metadata.gz: '0918b4794d0ced61971d2f308bb92a731b2c70130774a4e3b68db807fcb94e4a3addaa78488b1a1ab4a38e76557f1bf7fd0a1b5198dc545eefbeecfc5db5b593'
7
+ data.tar.gz: 6feb7e12b85ded5683858a2943390f95f092b79b4023f193c3792f24d3ed6e6294ea111f82c667c65dce50ccb005abea0c5db8233dadc6736442ab21c548c75f
@@ -17,7 +17,7 @@ module EacCli
17
17
  ::EacConfig::PathsHash.parse_entry_key(entry_key)
18
18
  end
19
19
  path.join('_').gsub(/[^a-z0-9_]/i, '').gsub(/\A_+/, '').gsub(/_+\z/, '')
20
- .gsub(/_{2,}/, '_').upcase
20
+ .gsub(/_{2,}/, '_').upcase
21
21
  end
22
22
  end
23
23
 
@@ -8,7 +8,7 @@ module EacCli
8
8
  enable_simple_cache
9
9
  common_constructor :options do
10
10
  self.options = options.to_h.symbolize_keys
11
- .assert_valid_keys(DEFAULT_VALUES.keys).freeze
11
+ .assert_valid_keys(DEFAULT_VALUES.keys).freeze
12
12
  end
13
13
 
14
14
  DEFAULT_VALUES = {
@@ -19,12 +19,12 @@ module EacCli
19
19
 
20
20
  def alternatives_parsed(error)
21
21
  alternatives.select { |a| error == a.error? }.map(&:parsed).reverse
22
- .inject(::EacRubyUtils::Struct.new) { |a, e| a.merge(e) }
22
+ .inject(::EacRubyUtils::Struct.new) { |a, e| a.merge(e) }
23
23
  end
24
24
 
25
25
  def alternatives_uncached
26
26
  definition.alternatives
27
- .map { |alternative| ::EacCli::Parser::Alternative.new(alternative, argv) }
27
+ .map { |alternative| ::EacCli::Parser::Alternative.new(alternative, argv) }
28
28
  end
29
29
 
30
30
  def first_error_uncached
@@ -23,6 +23,10 @@ module EacCli
23
23
  raise ::NameError, "No method \"#{method_name}\" found in #{runner} or in its ancestors"
24
24
  end
25
25
 
26
+ def respond_to_call?((method_name))
27
+ parent.respond_to?(:runner_context) && parent.runner_context.respond_to_call?(method_name)
28
+ end
29
+
26
30
  protected
27
31
 
28
32
  def parent_call(method_name, *args)
@@ -39,14 +39,13 @@ module EacCli
39
39
  end
40
40
 
41
41
  def respond_to_missing?(method, include_all = false)
42
- runner_context.parent.if_present(false) { |v| v.respond_to?(method, include_all) } ||
43
- super
42
+ runner_context.respond_to_call?(method) || super
44
43
  end
45
44
 
46
45
  def method_missing(method, *args, &block)
47
- return super if runner_context.parent.blank? || !runner_context.parent.respond_to?(method)
46
+ return super unless runner_context.respond_to_call?(method)
48
47
 
49
- runner_context.parent.send(method, *args, &block)
48
+ runner_context.call(method, *args, &block)
50
49
  end
51
50
  end
52
51
  end
@@ -54,7 +54,7 @@ module EacCli
54
54
  def options_section
55
55
  "Options:\n" +
56
56
  definition.alternatives.flat_map(&:options)
57
- .map { |option| IDENT + option_definition(option) + "\n" }.join
57
+ .map { |option| IDENT + option_definition(option) + "\n" }.join
58
58
  end
59
59
 
60
60
  def usage_section
@@ -17,7 +17,7 @@ module EacCli
17
17
  common_concern do
18
18
  include ::EacCli::Runner
19
19
  runner_definition.singleton_class
20
- .include(::EacCli::RunnerWith::Subcommands::DefinitionConcern)
20
+ .include(::EacCli::RunnerWith::Subcommands::DefinitionConcern)
21
21
  end
22
22
 
23
23
  EXTRA_AVAILABLE_SUBCOMMANDS_METHOD_NAME = :extra_available_subcommands
@@ -28,9 +28,9 @@ module EacCli
28
28
 
29
29
  def available_subcommands_auto
30
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
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
34
34
  end
35
35
 
36
36
  def available_subcommands_extra
@@ -95,7 +95,7 @@ module EacCli
95
95
  raise(::EacCli::Parser::Error.new(
96
96
  self.class.runner_definition, runner_context.argv,
97
97
  "Subcommand \"#{subcommand_name}\" not found " \
98
- "(Available: #{available_subcommands.keys}"
98
+ "(Available: #{available_subcommands.keys})"
99
99
  ))
100
100
  end
101
101
 
@@ -32,8 +32,8 @@ module EacCli
32
32
 
33
33
  def key_to_module(key)
34
34
  namespace_set.lazy
35
- .map { |namespace| key_to_module_in_namespace(namespace, key) }
36
- .find(&:present?) ||
35
+ .map { |namespace| key_to_module_in_namespace(namespace, key) }
36
+ .find(&:present?) ||
37
37
  raise("Not module found with key \"#{key}\" (Namespaces: #{namespace_set})")
38
38
  end
39
39
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacCli
4
- VERSION = '0.27.0'
4
+ VERSION = '0.27.3'
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.0
4
+ version: 0.27.3
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-03-01 00:00:00.000000000 Z
11
+ date: 2022-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.3'
61
+ version: 0.5.1
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.3'
68
+ version: 0.5.1
69
69
  description:
70
70
  email:
71
71
  executables: []