ehbrs-tools 0.21.0 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ehbrs/core_ext.rb +4 -0
  3. data/lib/ehbrs/music/album.rb +2 -0
  4. data/{vendor/eac_cli/lib/eac_cli/patches/module.rb → lib/ehbrs/patches.rb} +1 -1
  5. data/lib/ehbrs/runner/fs/selected.rb +79 -0
  6. data/lib/ehbrs/runner/fs/used_space.rb +1 -2
  7. data/lib/ehbrs/runner/music/selected.rb +9 -46
  8. data/lib/ehbrs/tools/version.rb +1 -1
  9. data/lib/ehbrs/videos/unsupported/check_support.rb +12 -8
  10. data/vendor/avm-apps/Gemfile +5 -0
  11. data/vendor/avm-apps/avm-apps.gemspec +18 -0
  12. data/vendor/avm-apps/lib/avm/apps.rb +9 -0
  13. data/vendor/avm-apps/lib/avm/apps/config.rb +19 -0
  14. data/vendor/avm-apps/lib/avm/apps/jobs.rb +11 -0
  15. data/vendor/avm-apps/lib/avm/apps/jobs/base.rb +64 -0
  16. data/vendor/avm-apps/lib/avm/apps/jobs/variables_source.rb +24 -0
  17. data/vendor/avm-apps/lib/avm/apps/sources/configuration.rb +57 -0
  18. data/vendor/avm-apps/lib/avm/apps/sources/configuration/_locale.rb +18 -0
  19. data/vendor/avm-apps/lib/avm/apps/sources/configuration/_rubocop.rb +26 -0
  20. data/vendor/avm-apps/lib/avm/apps/sources/configuration/_tests.rb +29 -0
  21. data/vendor/avm-apps/lib/avm/apps/version.rb +7 -0
  22. data/vendor/avm-apps/spec/rubocop_spec.rb +3 -0
  23. data/vendor/avm-apps/spec/spec_helper.rb +103 -0
  24. data/vendor/eac_cli/eac_cli.gemspec +1 -2
  25. data/vendor/eac_cli/lib/eac_cli/config.rb +16 -0
  26. data/vendor/eac_cli/lib/eac_cli/config/entry.rb +48 -0
  27. data/vendor/eac_cli/lib/eac_cli/config/entry/options.rb +57 -0
  28. data/vendor/eac_cli/lib/eac_cli/config/entry/undefined.rb +26 -0
  29. data/vendor/eac_cli/lib/eac_cli/definition/help_formatter.rb +3 -2
  30. data/vendor/eac_cli/lib/eac_cli/definition/positional_argument.rb +6 -1
  31. data/vendor/eac_cli/lib/eac_cli/old_configs.rb +0 -1
  32. data/vendor/eac_cli/lib/eac_cli/old_configs/entry_reader.rb +2 -2
  33. data/vendor/eac_cli/lib/eac_cli/old_configs_bridge.rb +39 -0
  34. data/vendor/eac_cli/lib/eac_cli/runner.rb +0 -2
  35. data/vendor/eac_cli/lib/eac_cli/runner/after_class_methods.rb +20 -3
  36. data/vendor/eac_cli/lib/eac_cli/runner/instance_methods.rb +5 -1
  37. data/vendor/eac_cli/lib/eac_cli/runner_with/help.rb +9 -4
  38. data/vendor/eac_cli/lib/eac_cli/runner_with/help/builder.rb +73 -0
  39. data/vendor/eac_cli/lib/eac_cli/runner_with/help/builder/alternative.rb +56 -0
  40. data/vendor/eac_cli/lib/eac_cli/runner_with/subcommands.rb +6 -4
  41. data/vendor/eac_cli/lib/eac_cli/speaker.rb +15 -19
  42. data/vendor/eac_cli/lib/eac_cli/speaker/_constants.rb +1 -1
  43. data/vendor/eac_cli/lib/eac_cli/speaker/list.rb +1 -1
  44. data/vendor/eac_cli/lib/eac_cli/speaker/options.rb +38 -0
  45. data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
  46. data/vendor/eac_cli/spec/lib/eac_cli/parser/alternative_spec.rb +1 -1
  47. data/vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb +0 -1
  48. data/vendor/eac_cli/spec/lib/eac_cli/speaker_spec.rb +5 -9
  49. data/vendor/eac_config/Gemfile +5 -0
  50. data/vendor/eac_config/eac_config.gemspec +19 -0
  51. data/vendor/eac_config/lib/eac_config.rb +7 -0
  52. data/vendor/eac_config/lib/eac_config/entry.rb +49 -0
  53. data/vendor/eac_config/lib/eac_config/entry_path.rb +41 -0
  54. data/vendor/eac_config/lib/eac_config/envvars_node.rb +25 -0
  55. data/vendor/eac_config/lib/eac_config/envvars_node/entry.rb +54 -0
  56. data/vendor/eac_config/lib/eac_config/load_nodes_search.rb +39 -0
  57. data/vendor/eac_config/lib/eac_config/load_path.rb +28 -0
  58. data/vendor/eac_config/lib/eac_config/node.rb +67 -0
  59. data/vendor/eac_config/lib/eac_config/node_entry.rb +18 -0
  60. data/vendor/eac_config/lib/eac_config/node_uri.rb +38 -0
  61. data/vendor/eac_config/lib/eac_config/old_configs.rb +75 -0
  62. data/vendor/eac_config/lib/eac_config/old_configs/base.rb +43 -0
  63. data/vendor/eac_config/lib/eac_config/old_configs/file.rb +47 -0
  64. data/vendor/eac_config/lib/eac_config/paths_hash.rb +56 -0
  65. data/vendor/eac_config/lib/eac_config/paths_hash/entry_key_error.rb +8 -0
  66. data/vendor/eac_config/lib/eac_config/paths_hash/node.rb +67 -0
  67. data/vendor/eac_config/lib/eac_config/paths_hash/path_search.rb +39 -0
  68. data/vendor/eac_config/lib/eac_config/version.rb +5 -0
  69. data/vendor/eac_config/lib/eac_config/yaml_file_node.rb +48 -0
  70. data/vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb +37 -0
  71. data/vendor/eac_config/spec/lib/eac_config/entry_path_spec.rb +30 -0
  72. data/vendor/eac_config/spec/lib/eac_config/envvars_node/entry_spec.rb +14 -0
  73. data/vendor/eac_config/spec/lib/eac_config/envvars_node_spec.rb +40 -0
  74. data/vendor/eac_config/spec/lib/eac_config/old_configs_spec.rb +46 -0
  75. data/vendor/eac_config/spec/lib/eac_config/paths_hash_spec.rb +88 -0
  76. data/vendor/eac_config/spec/lib/eac_config/yaml_file_node_spec.rb +52 -0
  77. data/vendor/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1.yaml +6 -0
  78. data/vendor/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_1.yaml +2 -0
  79. data/vendor/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_2.yaml +4 -0
  80. data/vendor/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_2/storage1_2_1.yaml +2 -0
  81. data/vendor/eac_config/spec/rubocop_spec.rb +3 -0
  82. data/vendor/eac_config/spec/spec_helper.rb +17 -0
  83. data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +2 -2
  84. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/application.rb +23 -9
  85. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/application_xdg.rb +34 -0
  86. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/jobs_runner.rb +2 -2
  87. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +19 -7
  88. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/confirmation.rb +8 -1
  89. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
  90. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/context.rb +31 -0
  91. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/contextualizable.rb +12 -7
  92. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/context.rb +11 -0
  93. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/speaker.rb +9 -0
  94. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/simple_cache.rb +10 -2
  95. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/speaker.rb +16 -0
  96. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/speaker/receiver.rb +57 -0
  97. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/speaker/sender.rb +32 -0
  98. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  99. data/vendor/{eac_cli/spec/lib → eac_ruby_utils/spec/lib/eac_ruby_utils/patches}/module/speaker_spec.rb +2 -2
  100. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/simple_cache_spec.rb +18 -0
  101. metadata +69 -18
  102. data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb +0 -71
  103. data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder/alternative.rb +0 -50
  104. data/vendor/eac_cli/lib/eac_cli/docopt/runner_context_replacement.rb +0 -15
  105. data/vendor/eac_cli/lib/eac_cli/docopt/runner_extension.rb +0 -51
  106. data/vendor/eac_cli/lib/eac_cli/docopt_runner.rb +0 -43
  107. data/vendor/eac_cli/lib/eac_cli/docopt_runner/_class_methods.rb +0 -16
  108. data/vendor/eac_cli/lib/eac_cli/docopt_runner/_doc.rb +0 -23
  109. data/vendor/eac_cli/lib/eac_cli/docopt_runner/_settings.rb +0 -17
  110. data/vendor/eac_cli/lib/eac_cli/docopt_runner/_subcommands.rb +0 -152
  111. data/vendor/eac_cli/lib/eac_cli/patches/module/speaker.rb +0 -10
  112. data/vendor/eac_cli/lib/eac_cli/speaker/_class_methods.rb +0 -37
  113. data/vendor/eac_cli/lib/eac_cli/speaker/node.rb +0 -24
  114. data/vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb +0 -35
  115. data/vendor/eac_cli/spec/lib/eac_cli/docopt_runner_spec.rb +0 -136
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'tempfile'
4
+ require 'eac_config/old_configs'
5
+
6
+ RSpec.describe ::EacConfig::OldConfigs do
7
+ let(:configs_key) { 'configsspec' }
8
+ let(:storage_path) do
9
+ file = ::Tempfile.new(configs_key)
10
+ path = file.path
11
+ file.close
12
+ file.unlink
13
+ path
14
+ end
15
+ let(:instance) { described_class.new(configs_key, storage_path: storage_path) }
16
+
17
+ describe '#storage_path' do
18
+ it { expect(instance.storage_path).to eq(storage_path) }
19
+ end
20
+
21
+ describe '#write' do
22
+ let(:entry_key) { 'parent.child' }
23
+
24
+ before do
25
+ instance[entry_key] = 'value1'
26
+ instance.save
27
+ end
28
+
29
+ it { expect(::YAML.load_file(storage_path)).to eq(parent: { child: 'value1' }) }
30
+ end
31
+
32
+ describe '#read' do
33
+ let(:present_key) { 'a.present.key' }
34
+ let(:blank_key) { 'a.blank.key' }
35
+
36
+ before do
37
+ instance[present_key] = 'A value'
38
+ instance[blank_key] = ''
39
+ instance.save
40
+ instance.load
41
+ end
42
+
43
+ it { expect(instance[present_key]).to be_present }
44
+ it { expect(instance[blank_key]).to be_present }
45
+ end
46
+ end
@@ -0,0 +1,88 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_config/paths_hash'
4
+
5
+ RSpec.describe ::EacConfig::PathsHash do
6
+ let(:source_hash) do
7
+ {
8
+ parent: {
9
+ child1: {
10
+ child1_1: 'v1_1',
11
+ child1_2: 'v1_2'
12
+ },
13
+ child2: 'v2'
14
+ }
15
+ }
16
+ end
17
+ let(:instance) { described_class.new(source_hash) }
18
+
19
+ describe '#[]' do
20
+ {
21
+ 'parent.child1.child1_1' => 'v1_1',
22
+ 'parent.child1.child1_2' => 'v1_2',
23
+ 'parent.child2' => 'v2',
24
+ 'no_exist' => nil,
25
+ 'parent.child1' => {
26
+ child1_1: 'v1_1',
27
+ child1_2: 'v1_2'
28
+ }
29
+ }.each do |entry_key, expected_value|
30
+ it { expect(instance[entry_key]).to eq(expected_value) }
31
+ end
32
+
33
+ ['.only_suffix', '', '.', 'only_prefx.', 'empty..part'].each do |entry_key|
34
+ it "invalid entry key \"#{entry_key}\" raises EntryKeyError" do
35
+ expect { instance[entry_key] }.to raise_error(::EacConfig::PathsHash::EntryKeyError)
36
+ end
37
+ end
38
+ end
39
+
40
+ describe '#[]=' do
41
+ let(:source_hash) { {} }
42
+
43
+ before do
44
+ instance['a.b.c'] = '123'
45
+ end
46
+
47
+ it { expect(instance.to_h).to eq(a: { b: { c: '123' } }) }
48
+ end
49
+
50
+ describe '#fetch' do
51
+ {
52
+ 'parent.child1.child1_1' => 'v1_1',
53
+ 'parent.child1.child1_2' => 'v1_2',
54
+ 'parent.child1.child1_2.no_exist' => ::EacConfig::PathsHash::EntryKeyError,
55
+ 'parent.child1.child1_3' => ::EacConfig::PathsHash::EntryKeyError,
56
+ 'parent.child2' => 'v2',
57
+ 'no_exist' => ::EacConfig::PathsHash::EntryKeyError,
58
+ 'parent.child1' => {
59
+ child1_1: 'v1_1',
60
+ child1_2: 'v1_2'
61
+ }
62
+ }.each do |entry_key, expected_value|
63
+ if expected_value.is_a?(::Class) && expected_value < ::Exception
64
+ it "raise error #{expected_value}" do
65
+ expect { instance.fetch(entry_key) }.to raise_error(expected_value)
66
+ end
67
+ else
68
+ it "\#fetch return \"#{expected_value}\"" do
69
+ expect(instance.fetch(entry_key)).to eq(expected_value)
70
+ end
71
+ end
72
+ end
73
+ end
74
+
75
+ describe '#key?' do
76
+ {
77
+ 'parent.child1.child1_1' => true,
78
+ 'parent.child1.child1_2' => true,
79
+ 'parent.child1.child1_2.no_exist' => false,
80
+ 'parent.child1.child1_3' => false,
81
+ 'parent.child2' => true,
82
+ 'no_exist' => false,
83
+ 'parent.child1' => true
84
+ }.each do |entry_key, expected_value|
85
+ it { expect(instance.key?(entry_key)).to eq(expected_value) }
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/struct'
4
+ require 'eac_config/yaml_file_node'
5
+
6
+ RSpec.describe ::EacConfig::YamlFileNode do
7
+ storages = %w[1 1_1 1_2 1_2_1].map do |suffix|
8
+ key = "storage#{suffix}"
9
+ subpath = "#{key}.yaml"
10
+ subpath = "storage1_2/#{subpath}" if suffix == '1_2_1'
11
+ ::EacRubyUtils::Struct.new(suffix: suffix, key: key, subpath: subpath.to_pathname)
12
+ end
13
+
14
+ let(:fixtures_dir) { ::Pathname.new(__dir__).join('yaml_file_node_spec_files') }
15
+ let(:target_dir) { temp_copy(fixtures_dir) }
16
+ let(:yaml_file_path) do
17
+ r = target_dir.join('storage1.yaml')
18
+ r.write(r.read.gsub('%%STORAGE1_2_ABSOLUTE_PATH%%',
19
+ target_dir.join('storage1_2.yaml').expand_path.to_path))
20
+ r
21
+ end
22
+ let(:instance) { described_class.new(yaml_file_path) }
23
+
24
+ context 'with common entry' do
25
+ let(:entry) { instance.entry('common') }
26
+
27
+ it { expect(entry.value).to eq('AAA') }
28
+ it { expect(entry.found_node).to eq(instance) }
29
+ it { expect(entry).to be_found }
30
+ end
31
+
32
+ storages.each do |storage|
33
+ context "with entry in loaded path \"#{storage.subpath}\"" do
34
+ let(:entry) { instance.entry(storage.key) }
35
+ let(:storage_node) { described_class.new(target_dir.join(storage.subpath)) }
36
+
37
+ it { expect(entry).to be_a(::EacConfig::Entry) }
38
+ it { expect(entry).to be_found }
39
+ it { expect(entry.value).to eq(storage.key) }
40
+ it { expect(entry.found_node.url).to eq(storage_node.url) }
41
+ end
42
+ end
43
+
44
+ context 'with not existing entry' do
45
+ let(:entry) { instance.entry('no_exist') }
46
+
47
+ it { expect(entry).to be_a(::EacConfig::Entry) }
48
+ it { expect(entry.value).to eq(nil) }
49
+ it { expect(entry.found_node).to eq(nil) }
50
+ it { expect(entry).not_to be_found }
51
+ end
52
+ end
@@ -0,0 +1,6 @@
1
+ ---
2
+ common: AAA
3
+ load_path:
4
+ - storage1_1.yaml
5
+ - %%STORAGE1_2_ABSOLUTE_PATH%%
6
+ storage1: storage1
@@ -0,0 +1,2 @@
1
+ ---
2
+ storage1_1: storage1_1
@@ -0,0 +1,4 @@
1
+ ---
2
+ load_path:
3
+ - ./storage1_2/storage1_2_1.yaml
4
+ storage1_2: storage1_2
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ ::EacRubyGemSupport::Rspec.default.describe_rubocop
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
4
+ RSpec.configure do |config|
5
+ config.expect_with :rspec do |expectations|
6
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
7
+ end
8
+
9
+ config.mock_with :rspec do |mocks|
10
+ mocks.verify_partial_doubles = true
11
+ end
12
+
13
+ config.shared_context_metadata_behavior = :apply_to_host_groups
14
+
15
+ require 'eac_ruby_gem_support/rspec'
16
+ ::EacRubyGemSupport::Rspec.setup(::File.dirname(__dir__), config)
17
+ end
@@ -12,9 +12,9 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib}/**/*']
14
14
 
15
- s.add_dependency 'eac_cli', '~> 0.15', '>= 0.15.1'
15
+ s.add_dependency 'eac_cli', '~> 0.20'
16
16
  s.add_dependency 'eac_ruby_gems_utils', '~> 0.8'
17
- s.add_dependency 'eac_ruby_utils', '~> 0.64'
17
+ s.add_dependency 'eac_ruby_utils', '~> 0.67'
18
18
 
19
19
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
20
20
  end
@@ -1,5 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'eac_cli/config'
4
+ require 'eac_config/envvars_node'
5
+ require 'eac_config/yaml_file_node'
6
+ require 'eac_ruby_base0/application_xdg'
3
7
  require 'eac_ruby_gems_utils/gem'
4
8
  require 'eac_ruby_utils/core_ext'
5
9
  require 'eac_ruby_utils/filesystem_cache'
@@ -21,16 +25,22 @@ module EacRubyBase0
21
25
  vendor_gems + [self_gem]
22
26
  end
23
27
 
24
- { cache: '.cache', config: '.config', data: '.local/share' }.each do |item, subpath|
25
- xdg_env_method_name = "#{item}_xdg_env"
28
+ # @return [EacCli::Config]
29
+ def build_config(path = nil)
30
+ envvar_node = ::EacConfig::EnvvarsNode.new
31
+ file_node = ::EacConfig::YamlFileNode.new(path || config_default_path)
32
+ envvar_node.load_path.push(file_node.url)
33
+ envvar_node.write_node = file_node
34
+ ::EacCli::Config.new(envvar_node)
35
+ end
26
36
 
27
- define_method xdg_env_method_name do
28
- ENV["XDG_#{item.upcase}_HOME"].if_present(&:to_pathname)
29
- end
37
+ # @return [EacCli::Config]
38
+ def config_default_path
39
+ config_dir.join('eac_config.yaml')
40
+ end
30
41
 
31
- define_method "#{item}_dir" do
32
- (send(xdg_env_method_name) || home_dir.join(subpath)).join(name)
33
- end
42
+ ::EacRubyBase0::ApplicationXdg::DIRECTORIES.each_key do |item|
43
+ delegate "#{item}_xdg_env", "#{item}_dir", to: :app_xdg
34
44
  end
35
45
 
36
46
  def fs_cache
@@ -40,7 +50,7 @@ module EacRubyBase0
40
50
  end
41
51
 
42
52
  def home_dir
43
- @home_dir ||= (options[OPTION_HOME_DIR] || ENV.fetch('HOME')).to_pathname
53
+ app_xdg.user_home_dir
44
54
  end
45
55
 
46
56
  def name
@@ -53,6 +63,10 @@ module EacRubyBase0
53
63
 
54
64
  private
55
65
 
66
+ def app_xdg_uncached
67
+ ::EacRubyBase0::ApplicationXdg.new(name, options[OPTION_HOME_DIR])
68
+ end
69
+
56
70
  def self_gem_uncached
57
71
  ::EacRubyGemsUtils::Gem.new(gemspec_dir)
58
72
  end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module EacRubyBase0
6
+ # https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
7
+ class ApplicationXdg
8
+ class << self
9
+ # @return [Pathname]
10
+ def user_home_dir_from_env
11
+ ENV.fetch('HOME').to_pathname
12
+ end
13
+ end
14
+
15
+ DIRECTORIES = { cache: '.cache', config: '.config', data: '.local/share',
16
+ state: '.local/state' }.freeze
17
+
18
+ common_constructor :app_name, :user_home_dir, default: [nil] do
19
+ self.user_home_dir ||= self.class.user_home_dir_from_env
20
+ end
21
+
22
+ DIRECTORIES.each do |item, subpath|
23
+ xdg_env_method_name = "#{item}_xdg_env"
24
+
25
+ define_method xdg_env_method_name do
26
+ ENV["XDG_#{item.upcase}_HOME"].if_present(&:to_pathname)
27
+ end
28
+
29
+ define_method "#{item}_dir" do
30
+ (send(xdg_env_method_name) || user_home_dir.join(subpath)).join(app_name)
31
+ end
32
+ end
33
+ end
34
+ end
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_cli/speaker'
3
+ require 'eac_ruby_utils/core_ext'
4
4
  require 'eac_ruby_utils/settings_provider'
5
5
 
6
6
  module EacRubyBase0
7
7
  module JobsRunner
8
8
  common_concern do
9
- include ::EacCli::Speaker
9
+ enable_speaker
10
10
  include ::EacRubyUtils::SettingsProvider
11
11
  end
12
12
 
@@ -1,6 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'eac_cli/core_ext'
4
+ require 'eac_cli/speaker'
5
+ require 'eac_config/node'
6
+ require 'eac_ruby_utils/speaker'
4
7
 
5
8
  module EacRubyBase0
6
9
  module Runner
@@ -20,13 +23,13 @@ module EacRubyBase0
20
23
  end
21
24
 
22
25
  def run
23
- on_speaker_node do |node|
24
- node.stderr = ::StringIO.new if parsed.quiet?
25
- node.stdin = FailIfRequestInput.new if parsed.no_input?
26
- if parsed.version?
27
- show_version
28
- else
29
- run_with_subcommand
26
+ ::EacRubyUtils::Speaker.context.on(build_speaker) do
27
+ ::EacConfig::Node.context.on(runner_context.call(:application).build_config) do
28
+ if parsed.version?
29
+ show_version
30
+ else
31
+ run_with_subcommand
32
+ end
30
33
  end
31
34
  end
32
35
  end
@@ -48,5 +51,14 @@ module EacRubyBase0
48
51
  end
49
52
  end
50
53
  end
54
+
55
+ private
56
+
57
+ def build_speaker
58
+ options = {}
59
+ options[:err_out] = ::StringIO.new if parsed.quiet?
60
+ options[:in_in] = FailIfRequestInput.new if parsed.no_input?
61
+ ::EacCli::Speaker.new(options)
62
+ end
51
63
  end
52
64
  end
@@ -12,6 +12,7 @@ module EacRubyBase0
12
12
  common_concern do
13
13
  include ::EacCli::Runner
14
14
  enable_settings_provider
15
+ enable_simple_cache
15
16
  runner_definition do
16
17
  bool_opt '--no', 'Deny confirmation without question.'
17
18
  bool_opt '--yes', 'Accept confirmation without question.'
@@ -22,7 +23,7 @@ module EacRubyBase0
22
23
  return false if parsed.no?
23
24
  return true if parsed.yes?
24
25
 
25
- request_input(
26
+ input(
26
27
  message || setting_value(:confirm_question_text, default: DEFAULT_CONFIRM_QUESTION_TEXT),
27
28
  bool: true
28
29
  )
@@ -31,6 +32,12 @@ module EacRubyBase0
31
32
  def run_confirm(message = nil)
32
33
  yield if confirm?(message)
33
34
  end
35
+
36
+ private
37
+
38
+ def cached_confirm_uncached?(message = nil)
39
+ confirm?(message)
40
+ end
34
41
  end
35
42
  end
36
43
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyBase0
4
- VERSION = '0.7.3'
4
+ VERSION = '0.10.0'
5
5
  end