eac_cli 0.45.0 → 0.47.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e7dfc71f934fde7f3dd043951cddaa4df5b4c82645e1711d892a5e0ede457ecb
4
- data.tar.gz: d11d44025c04b4f910a3d9e4579783f62bc4b92cd754559a81d643255e5b30ad
3
+ metadata.gz: b103f559a5e998c87f383a57e13ece78c32d667304c5eb23d1f7a4ced5a911bf
4
+ data.tar.gz: 003003314c01960993d67eb43f9fb434b0bfc446b38f40558ac77d7f7f8821f0
5
5
  SHA512:
6
- metadata.gz: 799c470b77e41ae0701690b5b72a4c1198da34bc113e8a10e5cb8bf1c20c70d1ba61bea2c7836da9a01c7b86c7ea17f740998b83b68e0b3e2e01e2bc7f950ee6
7
- data.tar.gz: 5c0a6f5c1a312aec19dc389cf6d44f2eaf90c330d6b95447b450428aac9bbbf11a4c1d4297d4030a3e55c630f09a71dbd37e141393e49f2f5ff8d2013bf6e011
6
+ metadata.gz: f8c56048566cce312b629197d04eae57256f7c5f282d208b1009f279199d51fb879726478a368c51326ea582ef90ae95c7e77914e00a8b344424970253be6c3b
7
+ data.tar.gz: 5bbeec3b88ec65a374ce56ed86497f63892cb4eea6590a51d74e42ed3d4ad6c8d5c696f031763cde7a31d579ce812b713c5d2bab9a3c88db3f22d39510311c30
@@ -15,8 +15,8 @@ module EacCli
15
15
  end
16
16
 
17
17
  # @raise [EacCli::Definition::Error]
18
- def raise(*args)
19
- ::Kernel.raise ::EacCli::Definition::Error, *args
18
+ def raise(*)
19
+ ::Kernel.raise(::EacCli::Definition::Error, *)
20
20
  end
21
21
 
22
22
  # @return [Boolean]
@@ -15,13 +15,13 @@ module EacCli
15
15
  end
16
16
 
17
17
  # @return [EacCli::Definition::Alternative]
18
- def alt(key = nil, &block)
18
+ def alt(key = nil, &)
19
19
  key ||= new_alternative_key
20
20
  raise(::EacCli::Definition::Error, "A alternative with key=\"#{key}\" already exists") if
21
21
  key.present? && alternatives_set.key?(key)
22
22
 
23
23
  r = ::EacCli::Definition::Alternative.new
24
- r.instance_eval(&block)
24
+ r.instance_eval(&)
25
25
  alternatives_set[key] = r
26
26
  r
27
27
  end
@@ -5,7 +5,7 @@ module EacCli
5
5
  class Alternative
6
6
  module LongOptions
7
7
  LONG_OPTION_PREFIX = '--'
8
- OPTION_WITH_ARGUMENT_PATTERN = /\A([^=]+)(?:=(.*))\z/.freeze
8
+ OPTION_WITH_ARGUMENT_PATTERN = /\A([^=]+)(?:=(.*))\z/
9
9
 
10
10
  private
11
11
 
@@ -5,7 +5,7 @@ module EacCli
5
5
  class Alternative
6
6
  module ShortOptions
7
7
  SHORT_OPTION_PREFIX = '-'
8
- SHORT_OPTION_CHAR_PATTERN = /\A[0-9a-zA-Z]\z/.freeze
8
+ SHORT_OPTION_CHAR_PATTERN = /\A[0-9a-zA-Z]\z/
9
9
 
10
10
  private
11
11
 
@@ -4,6 +4,7 @@ class Object
4
4
  def runner_with(*runners, &block)
5
5
  include ::EacCli::Runner
6
6
 
7
+ enable_memoized
7
8
  enable_simple_cache
8
9
  enable_speaker
9
10
  runners.each do |runner|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- Dir["#{File.dirname(__FILE__)}/#{File.basename(__FILE__, '.*')}/*.rb"].sort.each do |path|
3
+ Dir["#{File.dirname(__FILE__)}/#{File.basename(__FILE__, '.*')}/*.rb"].each do |path|
4
4
  require path
5
5
  end
@@ -14,8 +14,8 @@ module EacCli
14
14
  end
15
15
 
16
16
  # Call a method in the runner or in one of it ancestors.
17
- def call(method_name, *args, &block)
18
- context_call_responder(method_name).call(*args, &block)
17
+ def call(method_name, *, &)
18
+ context_call_responder(method_name).call(*, &)
19
19
  end
20
20
 
21
21
  # @return [EacCli::Runner::ContextResponders]
@@ -40,8 +40,8 @@ module EacCli
40
40
  end
41
41
  end
42
42
 
43
- def parent_call(method_name, *args, &block)
44
- return parent.runner_context.call(method_name, *args, &block) if
43
+ def parent_call(method_name, *, &)
44
+ return parent.runner_context.call(method_name, *, &) if
45
45
  parent.respond_to?(:runner_context)
46
46
 
47
47
  raise "Parent #{parent} do not respond to .context or .runner_context (Runner: #{runner})"
@@ -12,8 +12,8 @@ module EacCli
12
12
  end
13
13
  end
14
14
 
15
- def call(*args, &block)
16
- return parent.runner_context.call(method_name, *args, &block) if
15
+ def call(*, &)
16
+ return parent.runner_context.call(method_name, *, &) if
17
17
  parent.respond_to?(:runner_context)
18
18
 
19
19
  raise "Parent #{parent} do not respond to .context or .runner_context (Runner: #{runner})"
@@ -8,8 +8,8 @@ module EacCli
8
8
  runner.respond_to?(method_name)
9
9
  end
10
10
 
11
- def call(*args, &block)
12
- runner.send(method_name, *args, &block)
11
+ def call(*, &)
12
+ runner.send(method_name, *, &)
13
13
  end
14
14
  end
15
15
  end
@@ -8,8 +8,8 @@ module EacCli
8
8
  responder_runner.present?
9
9
  end
10
10
 
11
- def call(*args, &block)
12
- responder_runner.send(method_name, *args, &block)
11
+ def call(*, &)
12
+ responder_runner.send(method_name, *, &)
13
13
  end
14
14
 
15
15
  private
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EacCli
4
+ module RunnerWith
5
+ module OutputItem
6
+ class AsciidocFormatter < ::EacCli::RunnerWith::OutputItem::BaseFormatter
7
+ class Section
8
+ acts_as_instance_method
9
+ common_constructor :caller, :title, :content, :level
10
+
11
+ # @return [String]
12
+ def result
13
+ "#{formatted_title}#{formatted_content}"
14
+ end
15
+
16
+ protected
17
+
18
+ # @return [String]
19
+ def formatted_title
20
+ title.if_present('') { |_e| "#{'=' * level} #{title}\n\n" }
21
+ end
22
+
23
+ # @return [String]
24
+ def formatted_content
25
+ caller.send(:output_object, content, level + 1)
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -43,27 +43,7 @@ module EacCli
43
43
  "* #{string.to_s.strip}\n"
44
44
  end
45
45
 
46
- # @param title [String]
47
- # @param content [String]
48
- # @param level [Integer]
49
- # @return [String]
50
- def section(title, content, level)
51
- "#{section_title(title, level)}\n\n#{section_content(content, level)}"
52
- end
53
-
54
- # @param title [String]
55
- # @param level [Integer]
56
- # @return [String]
57
- def section_title(title, level)
58
- "#{'=' * level} #{title}"
59
- end
60
-
61
- # @param content [String]
62
- # @param level [Integer]
63
- # @return [String]
64
- def section_content(content, level)
65
- output_object(content, level)
66
- end
46
+ require_sub __FILE__, require_mode: :kernel
67
47
  end
68
48
  end
69
49
  end
@@ -49,8 +49,8 @@ module EacCli
49
49
  help_list_section('Subcommands', available_subcommands.keys.sort)
50
50
  end
51
51
 
52
- def method_missing(method_name, *arguments, &block)
53
- return run_with_subcommand(*arguments, &block) if
52
+ def method_missing(method_name, *, &)
53
+ return run_with_subcommand(*, &) if
54
54
  run_with_subcommand_alias_run?(method_name)
55
55
 
56
56
  super
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacCli
4
- VERSION = '0.45.0'
4
+ VERSION = '0.47.0'
5
5
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.45.0
4
+ version: 0.47.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2026-05-15 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: clipboard
@@ -63,20 +64,14 @@ dependencies:
63
64
  requirements:
64
65
  - - "~>"
65
66
  - !ruby/object:Gem::Version
66
- version: '0.128'
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- version: 0.128.6
67
+ version: '0.131'
70
68
  type: :runtime
71
69
  prerelease: false
72
70
  version_requirements: !ruby/object:Gem::Requirement
73
71
  requirements:
74
72
  - - "~>"
75
73
  - !ruby/object:Gem::Version
76
- version: '0.128'
77
- - - ">="
78
- - !ruby/object:Gem::Version
79
- version: 0.128.6
74
+ version: '0.131'
80
75
  - !ruby/object:Gem::Dependency
81
76
  name: tty-table
82
77
  requirement: !ruby/object:Gem::Requirement
@@ -97,19 +92,20 @@ dependencies:
97
92
  requirements:
98
93
  - - "~>"
99
94
  - !ruby/object:Gem::Version
100
- version: '0.12'
95
+ version: '0.13'
101
96
  type: :development
102
97
  prerelease: false
103
98
  version_requirements: !ruby/object:Gem::Requirement
104
99
  requirements:
105
100
  - - "~>"
106
101
  - !ruby/object:Gem::Version
107
- version: '0.12'
102
+ version: '0.13'
103
+ description:
104
+ email:
108
105
  executables: []
109
106
  extensions: []
110
107
  extra_rdoc_files: []
111
108
  files:
112
- - Gemfile
113
109
  - lib/eac_cli.rb
114
110
  - lib/eac_cli/config.rb
115
111
  - lib/eac_cli/config/entry.rb
@@ -171,6 +167,7 @@ files:
171
167
  - lib/eac_cli/runner_with/output/clipboard_writer.rb
172
168
  - lib/eac_cli/runner_with/output_item.rb
173
169
  - lib/eac_cli/runner_with/output_item/asciidoc_formatter.rb
170
+ - lib/eac_cli/runner_with/output_item/asciidoc_formatter/section.rb
174
171
  - lib/eac_cli/runner_with/output_item/base_formatter.rb
175
172
  - lib/eac_cli/runner_with/output_item/csv_formatter.rb
176
173
  - lib/eac_cli/runner_with/output_item/yaml_formatter.rb
@@ -191,8 +188,10 @@ files:
191
188
  - lib/eac_cli/speaker/options.rb
192
189
  - lib/eac_cli/speaker/request_from_list.rb
193
190
  - lib/eac_cli/version.rb
191
+ homepage:
194
192
  licenses: []
195
193
  metadata: {}
194
+ post_install_message:
196
195
  rdoc_options: []
197
196
  require_paths:
198
197
  - lib
@@ -200,14 +199,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
200
199
  requirements:
201
200
  - - ">="
202
201
  - !ruby/object:Gem::Version
203
- version: 2.7.0
202
+ version: '3.2'
204
203
  required_rubygems_version: !ruby/object:Gem::Requirement
205
204
  requirements:
206
205
  - - ">="
207
206
  - !ruby/object:Gem::Version
208
207
  version: '0'
209
208
  requirements: []
210
- rubygems_version: 3.7.1
209
+ rubygems_version: 3.4.19
210
+ signing_key:
211
211
  specification_version: 4
212
212
  summary: Utilities to build CLI applications with Ruby.
213
213
  test_files: []
data/Gemfile DELETED
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec
6
-
7
- local_gemfile = File.join(File.dirname(__FILE__), 'Gemfile.local')
8
- eval_gemfile local_gemfile if File.exist?(local_gemfile)