avm-tools 0.113.3 → 0.113.4

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: 3df7ad19d9031c2e3d94cb8051798479282760386da32c55533f461a85d51580
4
- data.tar.gz: 69fe1de1ee67d5000c1a56aae122d1bf98e55a65b175616c73e9a99d28c4d472
3
+ metadata.gz: 5488a15876aa81048d9c653caff915780167551415a60d351c3137fd2418f78a
4
+ data.tar.gz: 73cf7cf7ef72418ded4b5cffac2dd4f7e2e399ce3a2b3149d962a5f1805d1e85
5
5
  SHA512:
6
- metadata.gz: 92453344e1eb2751ed5d653cb11fea487284315750b9e61e3044da5883c9aed8ec46d1ab5979489c1c733ed963ab844ede90a4bf81dbb0f1e8c6414bb35fceab
7
- data.tar.gz: c882830e166e9f7f59b1fca59d3658afccd2e3ad9dc6bf8929af4dae6a2ae6531537a9c97e924fdcd450c342d276b8d6029f917735c71702de8c9304884545ef
6
+ metadata.gz: ed7d05f9c93b6710189ec11e8b3e9f604b5066a2612c4053e978ac23d04da049257a42e6eab379c27b594d3255b09e682b44ae47d596e7529e53dcbe72c5da11
7
+ data.tar.gz: 18511d97a59192acf9e1ed6c14bf8e8a892c2a4a5af6caacfc5d9e7e9453a75057b2a265ea73b6890edc0a04e6f12070e63f973a8329e0582a2f96d6dd5d2793
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'avm/tools/core_ext'
4
- require 'avm/tools/self'
4
+ require 'avm/self/instance'
5
5
 
6
6
  module Avm
7
7
  module Tools
@@ -14,7 +14,7 @@ module Avm
14
14
  end
15
15
 
16
16
  def instance
17
- ::Avm::Tools::Self.instance
17
+ ::Avm::Self::Instance.default
18
18
  end
19
19
  end
20
20
  end
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_cli/old_configs_bridge'
4
3
  require 'eac_ruby_base0/application'
5
4
  require 'eac_ruby_utils/require_sub'
6
5
  require 'avm/instances/base'
@@ -15,18 +14,6 @@ module Avm
15
14
  @application ||= ::EacRubyBase0::Application.new(root.to_path)
16
15
  end
17
16
 
18
- # @return [EacCli::OldConfigsBridge]
19
- def build_config(path = nil)
20
- ::EacCli::OldConfigsBridge.new(
21
- application.name,
22
- path.if_present({}) { |v| { storage_path: v } }
23
- )
24
- end
25
-
26
- def instance
27
- @instance ||= ::Avm::Tools::Self::Instance.by_id('avm-tools_self')
28
- end
29
-
30
17
  def root
31
18
  ::Pathname.new('../../..').expand_path(__dir__)
32
19
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.113.3'
5
+ VERSION = '0.113.4'
6
6
  end
7
7
  end
@@ -9,8 +9,8 @@ module Avm
9
9
  module AutoValues
10
10
  module Data
11
11
  def auto_data_default_dump_path
12
- ::Avm::Self
13
- .instance
12
+ ::Avm::Self::Instance
13
+ .default
14
14
  .read_entry_optional(::Avm::Self::Instance::EntryKeys::DATA_DEFAULT_PATH)
15
15
  .if_present do |v|
16
16
  ::File.join(
@@ -27,11 +27,11 @@ module Avm
27
27
  end
28
28
 
29
29
  def optional_value
30
- read(required: false, noinput: true) || auto_value
30
+ context_entry.found? ? context_entry.value : auto_value
31
31
  end
32
32
 
33
- def read(extra_options = {})
34
- ::EacConfig::Node.context.current.entry(full_path, options.merge(extra_options)).value
33
+ def read
34
+ context_entry.value
35
35
  end
36
36
 
37
37
  def suffix_as_array
@@ -47,7 +47,13 @@ module Avm
47
47
  end
48
48
 
49
49
  def write(value)
50
- ::EacConfig::Node.context.current.entry(full_path).value = value
50
+ context_entry.value = value
51
+ end
52
+
53
+ private
54
+
55
+ def context_entry
56
+ ::EacConfig::Node.context.current.entry(full_path)
51
57
  end
52
58
  end
53
59
  end
@@ -8,6 +8,14 @@ require 'avm/eac_ubuntu_base0/docker_image'
8
8
  module Avm
9
9
  module Self
10
10
  class Instance < ::Avm::Instances::Base
11
+ DEFAULT_INSTANCE_ID = 'avm_self'
12
+
13
+ class << self
14
+ def default
15
+ @default ||= by_id(DEFAULT_INSTANCE_ID)
16
+ end
17
+ end
18
+
11
19
  def docker_image_class
12
20
  ::Avm::Self::DockerImage
13
21
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avm
4
- VERSION = '0.12.1'
4
+ VERSION = '0.13.0'
5
5
  end
@@ -15,6 +15,5 @@ Gem::Specification.new do |s|
15
15
  s.add_dependency 'avm-eac_rails_base1', '~> 0.1', '>= 0.1.3'
16
16
  s.add_dependency 'eac_ruby_utils', '~> 0.80', '>= 0.80.2'
17
17
 
18
- s.add_development_dependency 'eac_cli', '~> 0.24', '~> 0.24.1'
19
18
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.4'
20
19
  end
@@ -2,8 +2,4 @@
2
2
 
3
3
  require 'eac_ruby_utils/rspec/default_setup'
4
4
  ::EacRubyUtils::Rspec.default_setup_create(::File.expand_path('..', __dir__))
5
-
6
- require 'eac_cli/old_configs_bridge'
7
- ::EacRubyUtils::Rspec.default_setup.stub_eac_config_node do |file|
8
- ::EacCli::OldConfigsBridge.new(file)
9
- end
5
+ ::EacRubyUtils::Rspec.default_setup.stub_eac_config_node
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRailsBase1
5
- VERSION = '0.1.3'
5
+ VERSION = '0.1.4'
6
6
  end
7
7
  end
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.files = Dir['{lib}/**/*', 'Gemfile']
14
14
 
15
15
  s.add_dependency 'colorize', '~> 0.8.1'
16
- s.add_dependency 'eac_config', '~> 0.5', '>= 0.5.3'
16
+ s.add_dependency 'eac_config', '~> 0.7'
17
17
  s.add_dependency 'eac_ruby_utils', '~> 0.80'
18
18
 
19
19
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3'
@@ -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
@@ -29,10 +29,10 @@ module EacConfig
29
29
  ::EacConfig::EnvvarsNode.new.load_path.entry
30
30
  end
31
31
 
32
- def stub_eac_config_node(&node_builder)
32
+ def stub_eac_config_node(target_example = nil, target_file = nil, &node_builder)
33
33
  parent_self = self
34
- rspec_config.around do |example|
35
- ::EacRubyUtils::Fs::Temp.on_file do |file|
34
+ (target_example || rspec_config).around do |example|
35
+ parent_self.stub_eac_config_node_on_file(target_file) do |file|
36
36
  ::EacConfig::Node
37
37
  .context.on(parent_self.stub_eac_config_node_build(file, &node_builder)) do
38
38
  example.run
@@ -44,6 +44,14 @@ module EacConfig
44
44
  def stub_eac_config_node_build(file, &node_builder)
45
45
  node_builder.present? ? node_builder.call(file) : ::EacConfig::YamlFileNode.new(file)
46
46
  end
47
+
48
+ def stub_eac_config_node_on_file(target_file)
49
+ if target_file
50
+ yield(target_file.to_pathname)
51
+ else
52
+ ::EacRubyUtils::Fs::Temp.on_file { |file| yield(file) }
53
+ end
54
+ end
47
55
  end
48
56
  end
49
57
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacConfig
4
- VERSION = '0.6.0'
4
+ VERSION = '0.7.0'
5
5
  end
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib}/**/*']
14
14
 
15
- s.add_dependency 'eac_cli', '~> 0.24', '>= 0.24.1'
15
+ s.add_dependency 'eac_cli', '~> 0.25'
16
16
  s.add_dependency 'eac_fs', '~> 0.3'
17
17
  s.add_dependency 'eac_ruby_gems_utils', '~> 0.9', '~> 0.9.6'
18
18
  s.add_dependency 'eac_ruby_utils', '~> 0.70'
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module EacRubyBase0
6
+ module Rspec
7
+ module Setup
8
+ def self.extended(obj)
9
+ obj.disable_input_request
10
+ obj.stub_eac_config_node
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_exts'
4
+
5
+ module EacRubyBase0
6
+ module Rspec
7
+ require_sub __FILE__
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyBase0
4
- VERSION = '0.13.2'
4
+ VERSION = '0.14.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.113.3
4
+ version: 0.113.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-11 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: aranha-parsers
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.9'
33
+ version: '0.13'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.9'
40
+ version: '0.13'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: avm-eac_asciidoctor_base0
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -176,20 +176,14 @@ dependencies:
176
176
  requirements:
177
177
  - - "~>"
178
178
  - !ruby/object:Gem::Version
179
- version: '0.13'
180
- - - ">="
181
- - !ruby/object:Gem::Version
182
- version: 0.13.2
179
+ version: '0.14'
183
180
  type: :runtime
184
181
  prerelease: false
185
182
  version_requirements: !ruby/object:Gem::Requirement
186
183
  requirements:
187
184
  - - "~>"
188
185
  - !ruby/object:Gem::Version
189
- version: '0.13'
190
- - - ">="
191
- - !ruby/object:Gem::Version
192
- version: 0.13.2
186
+ version: '0.14'
193
187
  - !ruby/object:Gem::Dependency
194
188
  name: eac_ruby_gems_utils
195
189
  requirement: !ruby/object:Gem::Requirement
@@ -780,7 +774,6 @@ files:
780
774
  - sub/eac_cli/lib/eac_cli/old_configs/password_entry_reader.rb
781
775
  - sub/eac_cli/lib/eac_cli/old_configs/read_entry_options.rb
782
776
  - sub/eac_cli/lib/eac_cli/old_configs/store_passwords_entry_reader.rb
783
- - sub/eac_cli/lib/eac_cli/old_configs_bridge.rb
784
777
  - sub/eac_cli/lib/eac_cli/parser.rb
785
778
  - sub/eac_cli/lib/eac_cli/parser/alternative.rb
786
779
  - sub/eac_cli/lib/eac_cli/parser/alternative/argv.rb
@@ -795,6 +788,8 @@ files:
795
788
  - sub/eac_cli/lib/eac_cli/patches.rb
796
789
  - sub/eac_cli/lib/eac_cli/patches/object.rb
797
790
  - sub/eac_cli/lib/eac_cli/patches/object/runner_with.rb
791
+ - sub/eac_cli/lib/eac_cli/rspec.rb
792
+ - sub/eac_cli/lib/eac_cli/rspec/setup.rb
798
793
  - sub/eac_cli/lib/eac_cli/runner.rb
799
794
  - sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb
800
795
  - sub/eac_cli/lib/eac_cli/runner/context.rb
@@ -808,7 +803,7 @@ files:
808
803
  - sub/eac_cli/lib/eac_cli/runner_with/subcommands/definition_concern.rb
809
804
  - sub/eac_cli/lib/eac_cli/runner_with_set.rb
810
805
  - sub/eac_cli/lib/eac_cli/speaker.rb
811
- - sub/eac_cli/lib/eac_cli/speaker/_constants.rb
806
+ - sub/eac_cli/lib/eac_cli/speaker/constants.rb
812
807
  - sub/eac_cli/lib/eac_cli/speaker/list.rb
813
808
  - sub/eac_cli/lib/eac_cli/speaker/options.rb
814
809
  - sub/eac_cli/lib/eac_cli/version.rb
@@ -1132,6 +1127,8 @@ files:
1132
1127
  - sub/eac_ruby_base0/lib/eac_ruby_base0/patches/class/jobs_runner.rb
1133
1128
  - sub/eac_ruby_base0/lib/eac_ruby_base0/patches/object.rb
1134
1129
  - sub/eac_ruby_base0/lib/eac_ruby_base0/patches/object/runner_with.rb
1130
+ - sub/eac_ruby_base0/lib/eac_ruby_base0/rspec.rb
1131
+ - sub/eac_ruby_base0/lib/eac_ruby_base0/rspec/setup.rb
1135
1132
  - sub/eac_ruby_base0/lib/eac_ruby_base0/runner.rb
1136
1133
  - sub/eac_ruby_base0/lib/eac_ruby_base0/runner/test_all.rb
1137
1134
  - sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with.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