avm 0.39.0 → 0.41.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/applications/base.rb +1 -1
- data/lib/avm/data/instance/files_unit.rb +2 -1
- data/lib/avm/entries/auto_values/uri_entry.rb +1 -1
- data/lib/avm/entries/base/uri_component_entry_value/default_value.rb +27 -0
- data/lib/avm/entries/base/uri_component_entry_value/inherited_value.rb +38 -0
- data/lib/avm/entries/base/uri_component_entry_value/url_entry_value.rb +31 -0
- data/lib/avm/entries/base/uri_component_entry_value.rb +3 -30
- data/lib/avm/instances/base/auto_values/filesystem.rb +0 -25
- data/lib/avm/instances/base/auto_values/install.rb +13 -17
- data/lib/avm/instances/entry_keys.rb +1 -2
- data/lib/avm/version.rb +1 -1
- metadata +13 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff98dd57f92b57b9584b1f9e6b17f7d6512ac0a9e7d9fa61efddff90a2384f5c
|
4
|
+
data.tar.gz: 4a4c95084804d58be56d34ee820e1fb6435cbb33ef67b1cb8be9420a4a6b5ca9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 104bc1564c1184da11ab751b250324da90af6353e0656c4c9fe7d9920e13efbb029177a460e32721b03ec99d85bdc44cd7939e7c294235dac2130d983e514f59
|
7
|
+
data.tar.gz: c9ab7a4af7ae782a1c36b93b0d3664d6f161b638b867f397373088932f507ca1da762f0c6077ab9f71eb279081f9e02f3febbe27c1750c3a2509162f45b437e9
|
@@ -18,7 +18,8 @@ module Avm
|
|
18
18
|
before_load :clear_files
|
19
19
|
|
20
20
|
def files_path
|
21
|
-
::File.join(instance.read_entry(::Avm::Instances::EntryKeys::
|
21
|
+
::File.join(instance.read_entry(::Avm::Instances::EntryKeys::INSTALL_PATH),
|
22
|
+
fs_path_subpath)
|
22
23
|
end
|
23
24
|
|
24
25
|
def dump_command
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/entries/uri_builder'
|
4
|
+
require 'eac_config/entry_path'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module Entries
|
9
|
+
module Base
|
10
|
+
class UriComponentEntryValue
|
11
|
+
class DefaultValue
|
12
|
+
enable_method_class
|
13
|
+
common_constructor :uri_component_entry_value
|
14
|
+
delegate :component_entry_path, :entries_provider, to: :uri_component_entry_value
|
15
|
+
|
16
|
+
def default_value_method_name
|
17
|
+
"#{component_entry_path.parts.join('_').variableize}_default_value"
|
18
|
+
end
|
19
|
+
|
20
|
+
def result
|
21
|
+
entries_provider.if_respond(default_value_method_name)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/entries/uri_builder'
|
4
|
+
require 'eac_config/entry_path'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module Entries
|
9
|
+
module Base
|
10
|
+
class UriComponentEntryValue
|
11
|
+
class InheritedValue
|
12
|
+
enable_method_class
|
13
|
+
common_constructor :uri_component_entry_value
|
14
|
+
delegate :entries_provider, :id_entry_path, :component_entry_path,
|
15
|
+
to: :uri_component_entry_value
|
16
|
+
|
17
|
+
def result
|
18
|
+
entries_provider.inherited_entry_value(
|
19
|
+
id_entry_path.to_string,
|
20
|
+
component_entry_path.to_string,
|
21
|
+
&inherited_value_block
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
def inherited_value_block
|
26
|
+
return nil unless entries_provider.respond_to?(inherited_value_block_method_name)
|
27
|
+
|
28
|
+
->(value) { entries_provider.send(inherited_value_block_method_name, value) }
|
29
|
+
end
|
30
|
+
|
31
|
+
def inherited_value_block_method_name
|
32
|
+
"#{component_entry_path.parts.join('_').variableize}_inherited_value_proc".to_sym
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/entries/uri_builder'
|
4
|
+
require 'eac_config/entry_path'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module Entries
|
9
|
+
module Base
|
10
|
+
class UriComponentEntryValue
|
11
|
+
class UrlEntryValue
|
12
|
+
enable_method_class
|
13
|
+
common_constructor :uri_component_entry_value
|
14
|
+
delegate :component, :entries_provider, :root_entry_path, to: :uri_component_entry_value
|
15
|
+
|
16
|
+
def result
|
17
|
+
return unless url_entry.context_found?
|
18
|
+
|
19
|
+
::Avm::Entries::UriBuilder.from_source(url_entry.value.to_uri)
|
20
|
+
.avm_field_get(component)
|
21
|
+
end
|
22
|
+
|
23
|
+
# @return [Avm::Entries::Entry]
|
24
|
+
def url_entry
|
25
|
+
entries_provider.entry((root_entry_path + %w[url]).to_string)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -9,31 +9,16 @@ module Avm
|
|
9
9
|
module Base
|
10
10
|
class UriComponentEntryValue
|
11
11
|
enable_method_class
|
12
|
+
require_sub __FILE__, require_dependency: true
|
12
13
|
|
13
14
|
enable_listable
|
14
|
-
lists.add_symbol :option
|
15
|
+
lists.add_symbol :option
|
15
16
|
|
16
17
|
common_constructor :entries_provider, :component_entry_path, :options, default: [{}] do
|
17
18
|
self.component_entry_path = ::EacConfig::EntryPath.assert(component_entry_path)
|
18
19
|
self.options = self.class.lists.option.hash_keys_validate!(options)
|
19
20
|
end
|
20
21
|
|
21
|
-
def default_value
|
22
|
-
options[OPTION_DEFAULT_VALUE].call_if_proc
|
23
|
-
end
|
24
|
-
|
25
|
-
def inherited_result
|
26
|
-
entries_provider.inherited_entry_value(
|
27
|
-
id_entry_path.to_string,
|
28
|
-
component_entry_path.to_string,
|
29
|
-
&inherited_value_block
|
30
|
-
)
|
31
|
-
end
|
32
|
-
|
33
|
-
def inherited_value_block
|
34
|
-
options[OPTION_INHERITED_VALUE_BLOCK]
|
35
|
-
end
|
36
|
-
|
37
22
|
# @return [EacConfig::EntryPath]
|
38
23
|
def id_entry_path
|
39
24
|
root_entry_path + %w[id]
|
@@ -41,7 +26,7 @@ module Avm
|
|
41
26
|
|
42
27
|
# @return [String, nil]
|
43
28
|
def result
|
44
|
-
url_entry_value ||
|
29
|
+
url_entry_value || inherited_value || default_value
|
45
30
|
end
|
46
31
|
|
47
32
|
# @return [EacConfig::EntryPath]
|
@@ -49,18 +34,6 @@ module Avm
|
|
49
34
|
component_entry_path[0..-2]
|
50
35
|
end
|
51
36
|
|
52
|
-
# @return [Avm::Entries::Entry]
|
53
|
-
def url_entry
|
54
|
-
entries_provider.entry((root_entry_path + %w[url]).to_string)
|
55
|
-
end
|
56
|
-
|
57
|
-
def url_entry_value
|
58
|
-
return unless url_entry.context_found?
|
59
|
-
|
60
|
-
::Avm::Entries::UriBuilder.from_source(url_entry.value.to_uri)
|
61
|
-
.avm_field_get(component)
|
62
|
-
end
|
63
|
-
|
64
37
|
# @return [String]
|
65
38
|
def component
|
66
39
|
component_entry_path.last
|
@@ -7,31 +7,6 @@ module Avm
|
|
7
7
|
class Base
|
8
8
|
module AutoValues
|
9
9
|
module Filesystem
|
10
|
-
def auto_fs_path
|
11
|
-
inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
|
12
|
-
::Avm::Instances::EntryKeys::FS_PATH) { |v| v + '/' + id }
|
13
|
-
end
|
14
|
-
|
15
|
-
def auto_fs_url
|
16
|
-
auto_fs_url_with_install || auto_fs_url_without_install
|
17
|
-
end
|
18
|
-
|
19
|
-
def auto_fs_url_with_install
|
20
|
-
read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_URL)
|
21
|
-
.if_present do |install_url|
|
22
|
-
read_entry_optional('fs_path').if_present do |fs_path|
|
23
|
-
"#{install_url}#{fs_path}"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def auto_fs_url_without_install
|
29
|
-
return nil if read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_URL).present?
|
30
|
-
|
31
|
-
read_entry_optional('fs_path').if_present do |fs_path|
|
32
|
-
"file://#{fs_path}"
|
33
|
-
end
|
34
|
-
end
|
35
10
|
end
|
36
11
|
end
|
37
12
|
end
|
@@ -8,23 +8,7 @@ module Avm
|
|
8
8
|
class Base
|
9
9
|
module AutoValues
|
10
10
|
module Install
|
11
|
-
|
12
|
-
uri_component_entry_value(
|
13
|
-
::Avm::Instances::EntryKeys::INSTALL_DATA_PATH,
|
14
|
-
inherited_value_block: ->(v) { v + '/' + id }
|
15
|
-
)
|
16
|
-
end
|
17
|
-
|
18
|
-
def auto_install_groupname
|
19
|
-
uri_component_entry_value(
|
20
|
-
::Avm::Instances::EntryKeys::INSTALL_GROUPNAME,
|
21
|
-
default_value: lambda do
|
22
|
-
read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_USERNAME)
|
23
|
-
end
|
24
|
-
)
|
25
|
-
end
|
26
|
-
|
27
|
-
::Avm::Entries::UriBuilder::ENTRIES_FIELDS.each do |component|
|
11
|
+
(::Avm::Entries::UriBuilder::ENTRIES_FIELDS + %w[data_path groupname]).each do |component|
|
28
12
|
method_suffix = "install_#{component}"
|
29
13
|
define_method "auto_#{method_suffix}" do
|
30
14
|
uri_component_entry_value(
|
@@ -43,6 +27,18 @@ module Avm
|
|
43
27
|
require 'avm/entries/auto_values/uri_entry'
|
44
28
|
::Avm::Entries::AutoValues::UriEntry.new(self, 'install').value
|
45
29
|
end
|
30
|
+
|
31
|
+
def install_data_path_inherited_value_proc(value)
|
32
|
+
value + '/' + id
|
33
|
+
end
|
34
|
+
|
35
|
+
def install_groupname_default_value
|
36
|
+
read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_USERNAME)
|
37
|
+
end
|
38
|
+
|
39
|
+
def install_path_inherited_value_proc(value)
|
40
|
+
install_data_path_inherited_value_proc(value)
|
41
|
+
end
|
46
42
|
end
|
47
43
|
end
|
48
44
|
end
|
@@ -45,11 +45,10 @@ module Avm
|
|
45
45
|
end
|
46
46
|
|
47
47
|
{
|
48
|
-
'' => %w[
|
48
|
+
'' => %w[name source_instance_id],
|
49
49
|
admin: URI_FIELDS + %w[api_key],
|
50
50
|
database: URI_FIELDS + %w[id limit name system timeout extra],
|
51
51
|
docker: %w[registry],
|
52
|
-
fs: %w[url],
|
53
52
|
install: URI_FIELDS + %w[id data_path groupname],
|
54
53
|
mailer: {
|
55
54
|
'' => %w[id from reply_to],
|
data/lib/avm/version.rb
CHANGED
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.
|
4
|
+
version: 0.41.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: 2022-08-
|
11
|
+
date: 2022-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eac_cli
|
@@ -37,6 +37,9 @@ dependencies:
|
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '0.11'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 0.11.1
|
40
43
|
type: :runtime
|
41
44
|
prerelease: false
|
42
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -44,6 +47,9 @@ dependencies:
|
|
44
47
|
- - "~>"
|
45
48
|
- !ruby/object:Gem::Version
|
46
49
|
version: '0.11'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 0.11.1
|
47
53
|
- !ruby/object:Gem::Dependency
|
48
54
|
name: eac_docker
|
49
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -90,14 +96,14 @@ dependencies:
|
|
90
96
|
requirements:
|
91
97
|
- - "~>"
|
92
98
|
- !ruby/object:Gem::Version
|
93
|
-
version: '0.
|
99
|
+
version: '0.102'
|
94
100
|
type: :runtime
|
95
101
|
prerelease: false
|
96
102
|
version_requirements: !ruby/object:Gem::Requirement
|
97
103
|
requirements:
|
98
104
|
- - "~>"
|
99
105
|
- !ruby/object:Gem::Version
|
100
|
-
version: '0.
|
106
|
+
version: '0.102'
|
101
107
|
- !ruby/object:Gem::Dependency
|
102
108
|
name: eac_templates
|
103
109
|
requirement: !ruby/object:Gem::Requirement
|
@@ -232,6 +238,9 @@ files:
|
|
232
238
|
- lib/avm/entries/base.rb
|
233
239
|
- lib/avm/entries/base/inherited_entry_value.rb
|
234
240
|
- lib/avm/entries/base/uri_component_entry_value.rb
|
241
|
+
- lib/avm/entries/base/uri_component_entry_value/default_value.rb
|
242
|
+
- lib/avm/entries/base/uri_component_entry_value/inherited_value.rb
|
243
|
+
- lib/avm/entries/base/uri_component_entry_value/url_entry_value.rb
|
235
244
|
- lib/avm/entries/entry.rb
|
236
245
|
- lib/avm/entries/uri_builder.rb
|
237
246
|
- lib/avm/executables.rb
|