eac_cli 0.29.0 → 0.30.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 +4 -4
- data/lib/eac_cli/config/entry/options.rb +2 -1
- data/lib/eac_cli/config/entry/undefined.rb +6 -1
- data/lib/eac_cli/config/entry.rb +8 -3
- data/lib/eac_cli/runner/class_runner.rb +6 -20
- data/lib/eac_cli/speaker/input_blocked.rb +16 -0
- data/lib/eac_cli/speaker/input_requested.rb +8 -0
- data/lib/eac_cli/version.rb +1 -1
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c6c9d3ac7f26ac1fdc4cbb83a5c7c6b36bd9b293429b17ca63b25b3945d562e
|
4
|
+
data.tar.gz: a887a446a8f97edc9c2d4d093a22251a2e51cf47c5656c661c47530d3d3a0c51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 371e1ab8cb6b93c36ad658168212c344c2c14e92ee783d91fc7d6251b21c85122284e800f1c1797b130df8bee6701e262e50e0894c018108bc55dfc91ba8cada
|
7
|
+
data.tar.gz: 7361269780fce5f667541fee9fe3ebbb1248b9335e59f1529f9099872fd0985635197b3c41cfc25f232a921b02c29067e28393983c6e55aba121129343d21ddc
|
@@ -1,10 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'eac_config/node_entry'
|
3
4
|
require 'eac_ruby_utils/core_ext'
|
4
5
|
|
5
6
|
module EacCli
|
6
7
|
class Config < ::SimpleDelegator
|
7
|
-
class Entry
|
8
|
+
class Entry < ::EacConfig::NodeEntry
|
8
9
|
class Options
|
9
10
|
enable_simple_cache
|
10
11
|
enable_listable
|
@@ -1,10 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'eac_cli/speaker/input_requested'
|
4
|
+
require 'eac_config/entry/not_found_error'
|
5
|
+
require 'eac_config/node_entry'
|
3
6
|
require 'eac_ruby_utils/core_ext'
|
4
7
|
|
5
8
|
module EacCli
|
6
9
|
class Config < ::SimpleDelegator
|
7
|
-
class Entry
|
10
|
+
class Entry < ::EacConfig::NodeEntry
|
8
11
|
module Undefined
|
9
12
|
private
|
10
13
|
|
@@ -19,6 +22,8 @@ module EacCli
|
|
19
22
|
|
20
23
|
def undefined_value_no_loop
|
21
24
|
input("Value for entry \"#{path}\"", options.request_input_options)
|
25
|
+
rescue ::EacCli::Speaker::InputRequested
|
26
|
+
raise ::EacConfig::Entry::NotFoundError, self
|
22
27
|
end
|
23
28
|
end
|
24
29
|
end
|
data/lib/eac_cli/config/entry.rb
CHANGED
@@ -2,21 +2,26 @@
|
|
2
2
|
|
3
3
|
require 'eac_cli/speaker'
|
4
4
|
require 'eac_config/entry_path'
|
5
|
+
require 'eac_config/node_entry'
|
5
6
|
require 'eac_ruby_utils/core_ext'
|
6
7
|
|
7
8
|
module EacCli
|
8
9
|
class Config < ::SimpleDelegator
|
9
|
-
class Entry
|
10
|
+
class Entry < ::EacConfig::NodeEntry
|
10
11
|
require_sub __FILE__, include_modules: true
|
11
12
|
enable_listable
|
12
13
|
enable_simple_cache
|
13
14
|
enable_speaker
|
14
15
|
|
15
|
-
common_constructor :
|
16
|
-
self.path = ::EacConfig::EntryPath.assert(path)
|
16
|
+
common_constructor :root_node, :path, :options, super_args: -> { [root_node, path] } do
|
17
17
|
self.options = ::EacCli::Config::Entry::Options.new(options)
|
18
18
|
end
|
19
19
|
|
20
|
+
# @return [EacCli::Config]
|
21
|
+
def config
|
22
|
+
root_node
|
23
|
+
end
|
24
|
+
|
20
25
|
def value
|
21
26
|
value!
|
22
27
|
end
|
@@ -18,33 +18,19 @@ module EacCli
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def run
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
run_parser_error(r, e)
|
27
|
-
end
|
28
|
-
r
|
21
|
+
r = create
|
22
|
+
begin
|
23
|
+
r.run_run
|
24
|
+
rescue ::EacCli::Parser::Error => e
|
25
|
+
run_parser_error(r, e)
|
29
26
|
end
|
27
|
+
r
|
30
28
|
end
|
31
29
|
|
32
30
|
def run_parser_error(runner_instance, error)
|
33
31
|
$stderr.write("#{runner_instance.program_name}: #{error}\n")
|
34
32
|
::Kernel.exit(PARSER_ERROR_EXIT_CODE)
|
35
33
|
end
|
36
|
-
|
37
|
-
private
|
38
|
-
|
39
|
-
def on_asserted_speaker
|
40
|
-
if ::EacRubyUtils::Speaker.context.optional_current
|
41
|
-
yield
|
42
|
-
else
|
43
|
-
::EacRubyUtils::Speaker.context.on(::EacCli::Speaker.new) do
|
44
|
-
yield
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
34
|
end
|
49
35
|
end
|
50
36
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/speaker/input_requested'
|
4
|
+
|
5
|
+
module EacCli
|
6
|
+
class Speaker
|
7
|
+
class InputBlocked
|
8
|
+
%w[gets noecho].each do |method|
|
9
|
+
define_method(method) do
|
10
|
+
raise ::EacCli::Speaker::InputRequested,
|
11
|
+
"Method (\"#{method}\") was requested, but input is blocked"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/eac_cli/version.rb
CHANGED
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.
|
4
|
+
version: 0.30.0
|
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-11-
|
11
|
+
date: 2022-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -51,6 +51,9 @@ dependencies:
|
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0.107'
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 0.107.1
|
54
57
|
type: :runtime
|
55
58
|
prerelease: false
|
56
59
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,6 +61,9 @@ dependencies:
|
|
58
61
|
- - "~>"
|
59
62
|
- !ruby/object:Gem::Version
|
60
63
|
version: '0.107'
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 0.107.1
|
61
67
|
- !ruby/object:Gem::Dependency
|
62
68
|
name: eac_ruby_gem_support
|
63
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,6 +136,8 @@ files:
|
|
130
136
|
- lib/eac_cli/runner_with_set.rb
|
131
137
|
- lib/eac_cli/speaker.rb
|
132
138
|
- lib/eac_cli/speaker/constants.rb
|
139
|
+
- lib/eac_cli/speaker/input_blocked.rb
|
140
|
+
- lib/eac_cli/speaker/input_requested.rb
|
133
141
|
- lib/eac_cli/speaker/list.rb
|
134
142
|
- lib/eac_cli/speaker/options.rb
|
135
143
|
- lib/eac_cli/version.rb
|