eac_cli 0.24.1 → 0.25.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 732a1f8ce5e5dc0a0866646c056d9beadb0792d6fa5d49d778b2781d415e3894
4
- data.tar.gz: a3a6c28a58b3547fc4f6d79e613612e7d39cb08c3b693c6195509a65aabb2625
3
+ metadata.gz: 9958f4d1b81751a3898ceac31489c06a1a10f02d8a9aa373d8c15bc2708102f8
4
+ data.tar.gz: 9faa05710f123ac1642dbdc1d608b5ceae1e5ff4fe517345bdd47297065e9a81
5
5
  SHA512:
6
- metadata.gz: e4a49116714b16d94950d8535fb5e120ad35bb3bc2729e5b35e65b1e33ada05ae46fb92b41034379a8fe8e90e15217328f950153c4758c9df2269295e53f3ed2
7
- data.tar.gz: 0aa191f78fa604940d4584d04a081a5739d821b9b13a23bbf6ba4638b2786ef637432aca43f10ef53b01c14b3e4e1e9284a13371ac36ed39d52d1a10a6cc59e6
6
+ metadata.gz: de6e9f9a2ce9981d204ce3ba2ea921d72965a3422e18581f673fc89d12679d263a076cae32423bbba50d25d9c8c708c934f7d69a944de3863f79af1e432d9e11
7
+ data.tar.gz: 1eb5b7c3e24bb5280727c0ef61a445669884c4bcdcf96aacf9d302872ffdfb35c73ead41ddca845cdd7f4d93ca37d021cd9db8fe3dfe347586e45ced3ab37cfb
@@ -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
@@ -0,0 +1,44 @@
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.context.on(
28
+ ::EacCli::Speaker.new(err_out: ::StringIO.new, out_out: ::StringIO.new,
29
+ in_in: FailIfRequestInput.new)
30
+ ) { example.run }
31
+ end
32
+ end
33
+ end
34
+
35
+ class FailIfRequestInput
36
+ %w[gets noecho].each do |method|
37
+ define_method(method) do
38
+ raise "Input method requested: #{method}. Should not request input on RSpec."
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ 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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacCli
4
- VERSION = '0.24.1'
4
+ VERSION = '0.25.0'
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.25.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: 2021-12-06 00:00:00.000000000 Z
11
+ date: 2021-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -30,20 +30,14 @@ 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.7'
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.7'
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: eac_ruby_utils
49
43
  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