eac_cli 0.24.1 → 0.25.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 +1 -1
- data/lib/eac_cli/config/entry/undefined.rb +1 -1
- data/lib/eac_cli/config/entry.rb +1 -1
- data/lib/eac_cli/rspec/setup.rb +44 -0
- data/lib/eac_cli/rspec.rb +9 -0
- data/lib/eac_cli/speaker/constants.rb +13 -0
- data/lib/eac_cli/version.rb +1 -1
- metadata +7 -12
- data/lib/eac_cli/old_configs_bridge.rb +0 -39
- data/lib/eac_cli/speaker/_constants.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9958f4d1b81751a3898ceac31489c06a1a10f02d8a9aa373d8c15bc2708102f8
|
4
|
+
data.tar.gz: 9faa05710f123ac1642dbdc1d608b5ceae1e5ff4fe517345bdd47297065e9a81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de6e9f9a2ce9981d204ce3ba2ea921d72965a3422e18581f673fc89d12679d263a076cae32423bbba50d25d9c8c708c934f7d69a944de3863f79af1e432d9e11
|
7
|
+
data.tar.gz: 1eb5b7c3e24bb5280727c0ef61a445669884c4bcdcf96aacf9d302872ffdfb35c73ead41ddca845cdd7f4d93ca37d021cd9db8fe3dfe347586e45ced3ab37cfb
|
data/lib/eac_cli/config/entry.rb
CHANGED
@@ -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,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
|
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.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-
|
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.
|
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.
|
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/
|
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
|