avm 0.10.0 → 0.13.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: 38b3cb78a40be49432757cf6da098d59bf73ff4873b19c6797fdba2d7e4d287f
4
- data.tar.gz: 5fe80c98b3c824af779750f5c1068c963c2ffbe178162dfc13b48d601c6fc966
3
+ metadata.gz: f1fa3a6d770a4005a0006754cd253d522b6a9c521c3ca426fe69dc43118b4101
4
+ data.tar.gz: 1aea6bae6db31d7bf6bd315eff95247ba5f2cb3886267d2aa6944a83d11b891f
5
5
  SHA512:
6
- metadata.gz: ce0716e32d4450fddd8707145357b4d36aae42a173e0d91e7adbab4087ad833d57917376a3d43cc2bf65fc4bc3a401fc6db8d537e1e9a1a8d158c0702fca3093
7
- data.tar.gz: e71070a17e331c95aa719131f0e3ffe9af461150cc3ae8b0df05a0e192ecc58fb02f7dee38e8394fafce5ee890b4528c34661a58b44ff4b73cac6c84c7c471a0
6
+ metadata.gz: b2c06a7e3a1ded1ad9a54152658f6c3a216994c26f2ddbad37b6e89e36381770f99f0dad61c8d543ed35daec3d26ba60c962450432d3e440a678b76f7cb95719
7
+ data.tar.gz: fc40a815b2c8eaef9863ab25ef3fdd4fe919d38d73cca6f9d628692fdc0ecf906ffe0a53508192ed592ccbaf676a23545710071ddf2a74e7651021f2a588b5ff
@@ -20,6 +20,10 @@ module Avm
20
20
  def instance(suffix)
21
21
  ::Avm::Instances::Base.new(self, suffix)
22
22
  end
23
+
24
+ def name
25
+ entry(::Avm::Instances::EntryKeys::NAME).read
26
+ end
23
27
  end
24
28
  end
25
29
  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
@@ -42,7 +42,7 @@ module Avm
42
42
  end
43
43
 
44
44
  {
45
- '' => %w[fs_path host_id source_instance_id],
45
+ '' => %w[fs_path host_id name source_instance_id],
46
46
  database: %w[id hostname limit name password port system timeout username extra],
47
47
  docker: %w[registry],
48
48
  mailer: {
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/runners/base'
3
4
  require 'eac_cli/core_ext'
4
5
 
5
6
  module Avm
6
7
  module Instances
7
- class Runner
8
+ class Runner < ::Avm::Runners::Base
8
9
  class << self
9
10
  def instance_class
10
11
  ::Avm.const_get(stereotype_name).const_get('Instance')
@@ -19,10 +19,6 @@ module Avm
19
19
 
20
20
  delegate :command_argument, :stereotype_name, to: :class
21
21
 
22
- runner_with :help, :subcommands do
23
- subcommands
24
- end
25
-
26
22
  def to_s
27
23
  stereotype_name
28
24
  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
@@ -37,7 +37,7 @@ module Avm
37
37
 
38
38
  # @return [Enumerable<Avm::Sources::Base>]
39
39
  def subs
40
- scm.subs.map { |subrepo| self.class.new(subrepo.path, parent: self) }
40
+ scm.subs.map { |subrepo| ::Avm::Registry.sources.detect(subrepo.path, parent: self) }
41
41
  end
42
42
 
43
43
  private
@@ -10,7 +10,7 @@ module Avm
10
10
 
11
11
  abstract_methods :result, :logs
12
12
 
13
- # @return [EacRubyUtils::Fs::Logs]
13
+ # @return [EacFs::Logs]
14
14
  def logs
15
15
  raise_abstract_method __method__
16
16
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'avm/sources/tests/result'
4
4
  require 'eac_ruby_utils/core_ext'
5
- require 'eac_ruby_utils/fs/logs'
5
+ require 'eac_fs/logs'
6
6
 
7
7
  module Avm
8
8
  module Sources
data/lib/avm/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avm
4
- VERSION = '0.10.0'
4
+ VERSION = '0.13.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo H. Bogoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-26 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: eac_cli