avm 0.11.0 → 0.14.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: 4bc589fce7e7ecab9f13ac06d9f48990995ae1709ad593cb9a18053715f46508
4
- data.tar.gz: a0e0fd0693719a46d2bd3d943b70cf13cef07ab89e96961a4f60f2fec343d3de
3
+ metadata.gz: 84721ab93d07c32f2b8c587c364a3cf3a3881b12c7984bf8011737eae8e47334
4
+ data.tar.gz: d54152761bbc8cd0ab059e96e3e8a4a8d102c9276b29362a92cc915a0cad3a94
5
5
  SHA512:
6
- metadata.gz: 767b4cb523ef822a6a58a799efb5f839cd22c5dd251abd7d25267c45cb7d8fdb52fddd177c02cd7bf2866f73c555a3ad840394611d5817cc5339ead385eab4c4
7
- data.tar.gz: 450c6420ff3864834e4e1cc1191671d7f655c34be7deb60131fbf19651c9e07dff056d73646bd483f8cccec62bcbe1134771d3968030daae4a3d36ef110cf94e
6
+ metadata.gz: e152406d787229dd1a56ff977fbcb4d50dac8667fb67360e323fc758420dbbd81efd37f5049dd1bbf8961aae93e6fa34ea865831dcdcbdd69f1e8d6a6e486749
7
+ data.tar.gz: a3b25728a082f27ca49e85fb191e8334be93cc8919df3175cdbd7264066d598ddb2cc9dc0a016d52ac450ba6a3afb6c5890ab12972be7e54dc13a1dff8d192f0
@@ -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(
@@ -1,22 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/instances/entry_keys'
4
+
3
5
  module Avm
4
6
  module Instances
5
7
  class Base
6
8
  module AutoValues
7
9
  module Filesystem
8
- FS_PATH_KEY = :fs_path
9
-
10
10
  def auto_fs_path
11
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, FS_PATH_KEY) do |v|
12
- v + '/' + id
13
- end
11
+ inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
12
+ ::Avm::Instances::EntryKeys::FS_PATH) { |v| v + '/' + id }
14
13
  end
15
14
 
16
15
  def auto_data_fs_path
17
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, :data_fs_path) do |v|
18
- v + '/' + id
19
- end
16
+ inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
17
+ ::Avm::Instances::EntryKeys::DATA_FS_PATH) { |v| v + '/' + id }
20
18
  end
21
19
 
22
20
  def auto_fs_url
@@ -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[data_fs_path 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: {
@@ -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
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.11.0'
4
+ VERSION = '0.14.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.11.0
4
+ version: 0.14.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-12-06 00:00:00.000000000 Z
11
+ date: 2021-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_cli