avm 0.76.0 → 0.78.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/entries/base/uri_components_entries_values/generic_component.rb +32 -6
- data/lib/avm/entries/base/uri_components_entries_values/url_component.rb +2 -2
- data/lib/avm/instances/base/processes.rb +27 -0
- data/lib/avm/instances/data/package.rb +4 -0
- data/lib/avm/instances/data/unit.rb +4 -0
- data/lib/avm/instances/process.rb +31 -0
- data/lib/avm/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cb5d857b2f46b9de8b367c04438c3be0bd5d511a3fccb7ba52b6aa92acd83a0
|
4
|
+
data.tar.gz: 5ea79e6a35fede8b4049f923d13bb1d8c357044c53a21e0b52866dda26891bff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9e1659d394a2bf0107f010af8e26f1c6cf5bbd8af3e670b3b4ccf4c62e06e8394acff968fe39ab5b99ee6e12be0779969cb7d67b2b7c06c26894ed24d4baebb
|
7
|
+
data.tar.gz: 658e8f4282ce9390ed58bc19ce862205f526dd712b3ae604edf8f3f7bb83d3b7d213eb28d461b357aa24aee9f078ff88fe633e655842565a5ab9ef9646280347
|
@@ -19,8 +19,25 @@ module Avm
|
|
19
19
|
[prefix, component].join('_')
|
20
20
|
end
|
21
21
|
|
22
|
-
def define_auto_method
|
23
|
-
|
22
|
+
def define_auto_method
|
23
|
+
outer_self = self
|
24
|
+
entries_provider_class.define_method(auto_method_name) do
|
25
|
+
uri_component_entry_value(outer_self.entry_key_path.to_string)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def define_get_method
|
30
|
+
outer_self = self
|
31
|
+
entries_provider_class.define_method(get_method_name) do
|
32
|
+
read_entry(outer_self.entry_key_path.to_string)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def define_get_optional_method
|
37
|
+
outer_self = self
|
38
|
+
entries_provider_class.define_method(get_optional_method_name) do
|
39
|
+
read_entry_optional(outer_self.entry_key_path.to_string)
|
40
|
+
end
|
24
41
|
end
|
25
42
|
|
26
43
|
def define_inherited_value_proc_method(&block)
|
@@ -31,6 +48,16 @@ module Avm
|
|
31
48
|
::EacConfig::EntryPath.assert([prefix, component])
|
32
49
|
end
|
33
50
|
|
51
|
+
# @return [String]
|
52
|
+
def get_method_name # rubocop:disable Naming/AccessorMethodName
|
53
|
+
component_method_name
|
54
|
+
end
|
55
|
+
|
56
|
+
# @return [String]
|
57
|
+
def get_optional_method_name # rubocop:disable Naming/AccessorMethodName
|
58
|
+
get_method_name + '_optional'
|
59
|
+
end
|
60
|
+
|
34
61
|
def id_component
|
35
62
|
@id_component ||= owner.component_factory('id')
|
36
63
|
end
|
@@ -40,10 +67,9 @@ module Avm
|
|
40
67
|
end
|
41
68
|
|
42
69
|
def setup
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
end
|
70
|
+
define_auto_method
|
71
|
+
define_get_method
|
72
|
+
define_get_optional_method
|
47
73
|
end
|
48
74
|
end
|
49
75
|
end
|
@@ -8,9 +8,9 @@ module Avm
|
|
8
8
|
module Base
|
9
9
|
class UriComponentsEntriesValues
|
10
10
|
class UrlComponent < ::Avm::Entries::Base::UriComponentsEntriesValues::GenericComponent
|
11
|
-
def
|
11
|
+
def define_auto_method
|
12
12
|
outer_self = self
|
13
|
-
|
13
|
+
entries_provider_class.define_method(auto_method_name) do
|
14
14
|
inherited_entry_value(outer_self.id_component.entry_key_path.to_string,
|
15
15
|
outer_self.entry_key_path.to_string) ||
|
16
16
|
outer_self.auto_install_url_by_parts(self)
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Instances
|
7
|
+
class Base
|
8
|
+
module Processes
|
9
|
+
# @return [Array<Avm::Instances::Process>]
|
10
|
+
def available_processes
|
11
|
+
processes.select(&:available?)
|
12
|
+
end
|
13
|
+
|
14
|
+
def on_disabled_processes(&block)
|
15
|
+
available_processes.inject(block) do |a, e|
|
16
|
+
-> { e.on_disabled(&a) }
|
17
|
+
end.call
|
18
|
+
end
|
19
|
+
|
20
|
+
# @return [Array<Avm::Instances::Process>]
|
21
|
+
def processes
|
22
|
+
[]
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Instances
|
7
|
+
class Process
|
8
|
+
class << self
|
9
|
+
# @return [Symbol]
|
10
|
+
def default_id
|
11
|
+
name.demodulize.underscore.to_sym
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
acts_as_abstract :available?, :disable, :enable, :enabled?
|
16
|
+
common_constructor :instance, :id, default: [nil] do
|
17
|
+
self.id ||= (id || self.class.default_id).to_sym
|
18
|
+
end
|
19
|
+
|
20
|
+
def on_disabled(&block)
|
21
|
+
previous_enabled = enabled?
|
22
|
+
begin
|
23
|
+
disable if previous_enabled
|
24
|
+
block.call
|
25
|
+
ensure
|
26
|
+
enable if previous_enabled
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
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.78.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: 2023-
|
11
|
+
date: 2023-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aranha-parsers
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.20'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.20'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: eac_cli
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -301,6 +301,7 @@ files:
|
|
301
301
|
- lib/avm/instances/base/dockerizable.rb
|
302
302
|
- lib/avm/instances/base/entry_keys.rb
|
303
303
|
- lib/avm/instances/base/install.rb
|
304
|
+
- lib/avm/instances/base/processes.rb
|
304
305
|
- lib/avm/instances/base/subcommand_parent.rb
|
305
306
|
- lib/avm/instances/base/web.rb
|
306
307
|
- lib/avm/instances/data.rb
|
@@ -310,6 +311,7 @@ files:
|
|
310
311
|
- lib/avm/instances/docker_image.rb
|
311
312
|
- lib/avm/instances/entry_keys.rb
|
312
313
|
- lib/avm/instances/ids.rb
|
314
|
+
- lib/avm/instances/process.rb
|
313
315
|
- lib/avm/instances/runner.rb
|
314
316
|
- lib/avm/launcher.rb
|
315
317
|
- lib/avm/launcher/context.rb
|