eac_cli 0.24.1 → 0.26.2

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: 732a1f8ce5e5dc0a0866646c056d9beadb0792d6fa5d49d778b2781d415e3894
4
- data.tar.gz: a3a6c28a58b3547fc4f6d79e613612e7d39cb08c3b693c6195509a65aabb2625
3
+ metadata.gz: 1af434e48b3486c3638354590357e325f94dc0fe99f2eed91336ae0950761ad2
4
+ data.tar.gz: 31d8d8df98098fed979b211aad821e62f1b86400cc1c3d1770dae94c38f1b52e
5
5
  SHA512:
6
- metadata.gz: e4a49116714b16d94950d8535fb5e120ad35bb3bc2729e5b35e65b1e33ada05ae46fb92b41034379a8fe8e90e15217328f950153c4758c9df2269295e53f3ed2
7
- data.tar.gz: 0aa191f78fa604940d4584d04a081a5739d821b9b13a23bbf6ba4638b2786ef637432aca43f10ef53b01c14b3e4e1e9284a13371ac36ed39d52d1a10a6cc59e6
6
+ metadata.gz: 2e7ae9c06974b6980da568ee8325a6252f794be706fb8e9d5f28de9e69f70b133d0309812c3c9116352173388b7f55b102a228ec61e9b2d0a7e741ccffbbc689
7
+ data.tar.gz: b119377c59db20c60daf078eb58331ed56146218570685fef3ed566b631674598fc6abf5d40eeff24ccef61f8fecc8b61375e2ee73b6e8dc7cd63b48853f65e7
@@ -3,7 +3,7 @@
3
3
  require 'eac_ruby_utils/core_ext'
4
4
 
5
5
  module EacCli
6
- class Config
6
+ class Config < ::SimpleDelegator
7
7
  class Entry
8
8
  class Options
9
9
  enable_simple_cache
@@ -3,7 +3,7 @@
3
3
  require 'eac_ruby_utils/core_ext'
4
4
 
5
5
  module EacCli
6
- class Config
6
+ class Config < ::SimpleDelegator
7
7
  class Entry
8
8
  module Undefined
9
9
  private
@@ -5,7 +5,7 @@ require 'eac_config/entry_path'
5
5
  require 'eac_ruby_utils/core_ext'
6
6
 
7
7
  module EacCli
8
- class Config
8
+ class Config < ::SimpleDelegator
9
9
  class Entry
10
10
  require_sub __FILE__, include_modules: true
11
11
  enable_listable
@@ -24,6 +24,10 @@ module EacCli
24
24
  input_value
25
25
  end
26
26
 
27
+ def secret_value
28
+ self.class.new(config, path, options.to_h.merge(noecho: true).to_h).value
29
+ end
30
+
27
31
  delegate :found?, :value=, to: :sub_entry
28
32
 
29
33
  private
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/config/entry'
4
+ require 'eac_cli/speaker'
5
+ require 'eac_ruby_utils/core_ext'
6
+ require 'eac_ruby_utils/speaker'
7
+
8
+ module EacCli
9
+ module Rspec
10
+ module Setup
11
+ def disable_input_request
12
+ disable_config_input_request
13
+ disable_speaker_input_request
14
+ end
15
+
16
+ def disable_config_input_request
17
+ rspec_config.before do
18
+ allow_any_instance_of(::EacCli::Config::Entry).to receive(:input_value) do |obj|
19
+ raise "Console input requested for entry (Path: #{obj.path})"
20
+ end
21
+ end
22
+ end
23
+
24
+ def disable_speaker_input_request
25
+ ::RSpec.configure do |config|
26
+ config.around do |example|
27
+ ::EacRubyUtils::Speaker
28
+ .context.on(::EacCli::Speaker.new(in_in: FailIfRequestInput.new)) { example.run }
29
+ end
30
+ end
31
+ end
32
+
33
+ class FailIfRequestInput
34
+ %w[gets noecho].each do |method|
35
+ define_method(method) do
36
+ raise "Input method requested: #{method}. Should not request input on RSpec."
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_exts'
4
+
5
+ module EacCli
6
+ module Rspec
7
+ require_sub __FILE__
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/by_reference'
4
+
5
+ module EacCli
6
+ class Speaker
7
+ module Constants
8
+ STDERR = ::EacRubyUtils::ByReference.new { $stderr }
9
+ STDIN = ::EacRubyUtils::ByReference.new { $stdin }
10
+ STDOUT = ::EacRubyUtils::ByReference.new { $stdout }
11
+ end
12
+ end
13
+ end
@@ -23,9 +23,8 @@ module EacCli
23
23
  out_out.write(string.to_s)
24
24
  end
25
25
 
26
- def fatal_error(string)
26
+ def error(string)
27
27
  puts "ERROR: #{string}".white.on_red
28
- Kernel.exit 1
29
28
  end
30
29
 
31
30
  def title(string)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacCli
4
- VERSION = '0.24.1'
4
+ VERSION = '0.26.2'
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.24.1
4
+ version: 0.26.2
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: 2021-12-06 00:00:00.000000000 Z
11
+ date: 2022-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -30,34 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.5'
34
- - - ">="
35
- - !ruby/object:Gem::Version
36
- version: 0.5.3
33
+ version: '0.8'
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
38
  - - "~>"
42
39
  - !ruby/object:Gem::Version
43
- version: '0.5'
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: 0.5.3
40
+ version: '0.8'
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: eac_ruby_utils
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
45
  - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: '0.80'
47
+ version: '0.83'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
51
  requirements:
58
52
  - - "~>"
59
53
  - !ruby/object:Gem::Version
60
- version: '0.80'
54
+ version: '0.83'
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: eac_ruby_gem_support
63
57
  requirement: !ruby/object:Gem::Requirement
@@ -100,7 +94,6 @@ files:
100
94
  - lib/eac_cli/old_configs/password_entry_reader.rb
101
95
  - lib/eac_cli/old_configs/read_entry_options.rb
102
96
  - lib/eac_cli/old_configs/store_passwords_entry_reader.rb
103
- - lib/eac_cli/old_configs_bridge.rb
104
97
  - lib/eac_cli/parser.rb
105
98
  - lib/eac_cli/parser/alternative.rb
106
99
  - lib/eac_cli/parser/alternative/argv.rb
@@ -115,6 +108,8 @@ files:
115
108
  - lib/eac_cli/patches.rb
116
109
  - lib/eac_cli/patches/object.rb
117
110
  - lib/eac_cli/patches/object/runner_with.rb
111
+ - lib/eac_cli/rspec.rb
112
+ - lib/eac_cli/rspec/setup.rb
118
113
  - lib/eac_cli/runner.rb
119
114
  - lib/eac_cli/runner/after_class_methods.rb
120
115
  - lib/eac_cli/runner/context.rb
@@ -128,7 +123,7 @@ files:
128
123
  - lib/eac_cli/runner_with/subcommands/definition_concern.rb
129
124
  - lib/eac_cli/runner_with_set.rb
130
125
  - lib/eac_cli/speaker.rb
131
- - lib/eac_cli/speaker/_constants.rb
126
+ - lib/eac_cli/speaker/constants.rb
132
127
  - lib/eac_cli/speaker/list.rb
133
128
  - lib/eac_cli/speaker/options.rb
134
129
  - lib/eac_cli/version.rb
@@ -1,39 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_cli/config'
4
- require 'eac_config/envvars_node'
5
- require 'eac_config/yaml_file_node'
6
- require 'eac_ruby_utils/core_ext'
7
-
8
- module EacCli
9
- class OldConfigsBridge < ::EacCli::Config
10
- ENTRY_KEY = 'core.store_passwords'
11
-
12
- class << self
13
- def new_configs_path(configs_key, options)
14
- options[:storage_path] || ::File.join(ENV['HOME'], '.config', configs_key, 'settings.yml')
15
- end
16
- end
17
-
18
- def initialize(configs_key, options = {})
19
- options.assert_argument(::Hash, 'options')
20
- envvar_node = ::EacConfig::EnvvarsNode.new
21
- file_node = ::EacConfig::YamlFileNode.new(self.class.new_configs_path(configs_key, options))
22
- envvar_node.load_path.push(file_node.url)
23
- envvar_node.write_node = file_node
24
- super(envvar_node)
25
- end
26
-
27
- def read_entry(entry_key, options = {})
28
- entry(entry_key, options).value
29
- end
30
-
31
- def read_password(entry_key, options = {})
32
- entry(entry_key, options.merge(noecho: true, store: store_passwords?)).value
33
- end
34
-
35
- def store_passwords?
36
- read_entry(ENTRY_KEY, bool: true)
37
- end
38
- end
39
- end
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/by_reference'
4
-
5
- module EacCli
6
- # https://github.com/fazibear/colorize
7
- class Speaker
8
- STDERR = ::EacRubyUtils::ByReference.new { $stderr }
9
- STDIN = ::EacRubyUtils::ByReference.new { $stdin }
10
- STDOUT = ::EacRubyUtils::ByReference.new { $stdout }
11
- end
12
- end