avm 0.35.1 → 0.38.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/avm/entries/base/uri_component_entry_value.rb +55 -0
- data/lib/avm/entries/base.rb +2 -0
- data/lib/avm/entries/entry.rb +10 -1
- data/lib/avm/entries/uri_builder.rb +4 -0
- data/lib/avm/instances/base/auto_values/install.rb +5 -13
- data/lib/avm/instances/base.rb +1 -1
- data/lib/avm/instances/entry_keys.rb +2 -1
- data/lib/avm/sources/base/application.rb +34 -0
- data/lib/avm/sources/base/configuration.rb +2 -0
- data/lib/avm/sources/base/testing.rb +1 -1
- data/lib/avm/version.rb +1 -1
- metadata +10 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc4f65ada3e6c902df6d77b491ac3a043e6ebb7fc93812873fb6d2d7b0d50624
|
4
|
+
data.tar.gz: 5dfb61ddeed3edb2c55f98133e281a18aa28f7024e69f2e1942b3fccc03453a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 142224b13cfcf3129c0fb24650724af9e66d892247668fb249e526fb9b050df749f0da51c1d0de95106ef85bceae03f563ca93adcf41f2464327cae6153341a0
|
7
|
+
data.tar.gz: 8968321777cca2c10902856df6bb9654f98d7e4b84a9c5781c741ef2483e9b1ca5283d281288c9351f34de83bb7e22992894c611059985d8359fcf42b1fd92a7
|
@@ -0,0 +1,55 @@
|
|
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
|
+
enable_method_class
|
12
|
+
common_constructor :entries_provider, :component_entry_path do
|
13
|
+
self.component_entry_path = ::EacConfig::EntryPath.assert(component_entry_path)
|
14
|
+
end
|
15
|
+
|
16
|
+
def inherited_result
|
17
|
+
entries_provider.inherited_entry_value(
|
18
|
+
id_entry_path.to_string,
|
19
|
+
component_entry_path.to_string
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
# @return [EacConfig::EntryPath]
|
24
|
+
def id_entry_path
|
25
|
+
root_entry_path + %w[id]
|
26
|
+
end
|
27
|
+
|
28
|
+
# @return [String, nil]
|
29
|
+
def result
|
30
|
+
if url_entry.context_found?
|
31
|
+
return ::Avm::Entries::UriBuilder.from_source(url_entry.value.to_uri)
|
32
|
+
.avm_field_get(component)
|
33
|
+
end
|
34
|
+
|
35
|
+
inherited_result
|
36
|
+
end
|
37
|
+
|
38
|
+
# @return [EacConfig::EntryPath]
|
39
|
+
def root_entry_path
|
40
|
+
component_entry_path[0..-2]
|
41
|
+
end
|
42
|
+
|
43
|
+
# @return [Avm::Entries::Entry]
|
44
|
+
def url_entry
|
45
|
+
entries_provider.entry((root_entry_path + %w[url]).to_string)
|
46
|
+
end
|
47
|
+
|
48
|
+
# @return [String]
|
49
|
+
def component
|
50
|
+
component_entry_path.last
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
data/lib/avm/entries/base.rb
CHANGED
data/lib/avm/entries/entry.rb
CHANGED
@@ -10,7 +10,16 @@ module Avm
|
|
10
10
|
common_constructor :parent, :suffix, :options
|
11
11
|
|
12
12
|
def auto_value
|
13
|
-
|
13
|
+
auto_value_entry.value
|
14
|
+
end
|
15
|
+
|
16
|
+
def auto_value_entry
|
17
|
+
@auto_value_entry ||= ::Avm::Entries::AutoValues::Entry.new(parent, suffix)
|
18
|
+
end
|
19
|
+
|
20
|
+
# @return [Boolean]
|
21
|
+
def context_found?
|
22
|
+
context_entry.found?
|
14
23
|
end
|
15
24
|
|
16
25
|
def full_path
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'avm/entries/uri_builder'
|
3
4
|
require 'avm/instances/entry_keys'
|
4
5
|
|
5
6
|
module Avm
|
@@ -13,19 +14,10 @@ module Avm
|
|
13
14
|
read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_USERNAME)
|
14
15
|
end
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
def auto_install_port
|
22
|
-
inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
|
23
|
-
::Avm::Instances::EntryKeys::INSTALL_PORT) || 22
|
24
|
-
end
|
25
|
-
|
26
|
-
def auto_install_username
|
27
|
-
inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
|
28
|
-
::Avm::Instances::EntryKeys::INSTALL_USERNAME)
|
17
|
+
::Avm::Entries::UriBuilder::ENTRIES_FIELDS.each do |component|
|
18
|
+
define_method "auto_install_#{component}" do
|
19
|
+
uri_component_entry_value("install.#{component}")
|
20
|
+
end
|
29
21
|
end
|
30
22
|
|
31
23
|
def auto_install_url
|
data/lib/avm/instances/base.rb
CHANGED
@@ -53,7 +53,7 @@ module Avm
|
|
53
53
|
def host_env_uncached
|
54
54
|
install_uri = entry(::Avm::Instances::EntryKeys::INSTALL_URL).value.to_uri
|
55
55
|
case install_uri.scheme
|
56
|
-
when '
|
56
|
+
when 'file' then ::EacRubyUtils::Envs.local
|
57
57
|
when 'ssh' then ::EacRubyUtils::Envs.ssh(install_uri)
|
58
58
|
else raise("Unmapped access value: \"#{install_uri}\"")
|
59
59
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'avm/entries/uri_builder'
|
3
4
|
require 'eac_ruby_utils/core_ext'
|
4
5
|
|
5
6
|
module Avm
|
6
7
|
module Instances
|
7
8
|
module EntryKeys
|
8
|
-
URI_FIELDS = %
|
9
|
+
URI_FIELDS = ::Avm::Entries::UriBuilder::ENTRIES_FIELDS + %w[url]
|
9
10
|
|
10
11
|
class << self
|
11
12
|
def all
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/applications/base'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Sources
|
8
|
+
class Base
|
9
|
+
module Application
|
10
|
+
APPLICATION_NAME_KEY = 'application'
|
11
|
+
|
12
|
+
# @return [Avm::Applications::Base]
|
13
|
+
def application
|
14
|
+
@application ||= ::Avm::Applications::Base.new(application_id)
|
15
|
+
end
|
16
|
+
|
17
|
+
# @return [String]
|
18
|
+
def application_id
|
19
|
+
application_id_by_configuration || application_id_by_directory
|
20
|
+
end
|
21
|
+
|
22
|
+
# @return [String, nil]
|
23
|
+
def application_id_by_configuration
|
24
|
+
configuration.entry(APPLICATION_NAME_KEY).value
|
25
|
+
end
|
26
|
+
|
27
|
+
# @return [String]
|
28
|
+
def application_id_by_directory
|
29
|
+
path.basename.to_path
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -24,6 +24,8 @@ module Avm
|
|
24
24
|
|
25
25
|
# @return [EacRubyUtils::Envs::Command, nil]
|
26
26
|
def configuration_value_to_env_command(value)
|
27
|
+
return value if value.is_a?(::EacRubyUtils::Envs::Command)
|
28
|
+
|
27
29
|
configuration_value_to_shell_words(value).if_present { |v| env.command(v).chdir(path) }
|
28
30
|
end
|
29
31
|
|
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.38.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-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eac_cli
|
@@ -36,14 +36,14 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0.
|
39
|
+
version: '0.11'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '0.
|
46
|
+
version: '0.11'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: eac_docker
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,7 +73,7 @@ dependencies:
|
|
73
73
|
version: '0.12'
|
74
74
|
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: 0.12.
|
76
|
+
version: 0.12.2
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -83,21 +83,21 @@ dependencies:
|
|
83
83
|
version: '0.12'
|
84
84
|
- - ">="
|
85
85
|
- !ruby/object:Gem::Version
|
86
|
-
version: 0.12.
|
86
|
+
version: 0.12.2
|
87
87
|
- !ruby/object:Gem::Dependency
|
88
88
|
name: eac_ruby_utils
|
89
89
|
requirement: !ruby/object:Gem::Requirement
|
90
90
|
requirements:
|
91
91
|
- - "~>"
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: '0.
|
93
|
+
version: '0.100'
|
94
94
|
type: :runtime
|
95
95
|
prerelease: false
|
96
96
|
version_requirements: !ruby/object:Gem::Requirement
|
97
97
|
requirements:
|
98
98
|
- - "~>"
|
99
99
|
- !ruby/object:Gem::Version
|
100
|
-
version: '0.
|
100
|
+
version: '0.100'
|
101
101
|
- !ruby/object:Gem::Dependency
|
102
102
|
name: eac_templates
|
103
103
|
requirement: !ruby/object:Gem::Requirement
|
@@ -230,6 +230,7 @@ files:
|
|
230
230
|
- lib/avm/entries/auto_values/entry.rb
|
231
231
|
- lib/avm/entries/auto_values/uri_entry.rb
|
232
232
|
- lib/avm/entries/base.rb
|
233
|
+
- lib/avm/entries/base/uri_component_entry_value.rb
|
233
234
|
- lib/avm/entries/entry.rb
|
234
235
|
- lib/avm/entries/uri_builder.rb
|
235
236
|
- lib/avm/executables.rb
|
@@ -290,6 +291,7 @@ files:
|
|
290
291
|
- lib/avm/source_generators/runner.rb
|
291
292
|
- lib/avm/sources.rb
|
292
293
|
- lib/avm/sources/base.rb
|
294
|
+
- lib/avm/sources/base/application.rb
|
293
295
|
- lib/avm/sources/base/configuration.rb
|
294
296
|
- lib/avm/sources/base/instance.rb
|
295
297
|
- lib/avm/sources/base/locale.rb
|