avm 0.76.0 → 0.77.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 +21 -0
- data/lib/avm/version.rb +1 -1
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d977abcc08d9507e93d451f66c89fb6cd12e8da240c29c2ad70c84646487affa
|
4
|
+
data.tar.gz: b3cf445b1f5c876ec2dc0c8461be14dd0bb3bda3bfccdcd7794c34d7f14ccd42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35c7f775fc34a8d91b2a3db000303ecd339c7b0499c585801a70c8f0816ed2a0f6fb0887205a27749689814ece0b6cdeff1d60b05a49f868820087930039baf5
|
7
|
+
data.tar.gz: cc74d0f97e1d4c9355ede98286350593e01779d5d7149c46fbf8c009c1aea3414cf6a4c758c7c89fc528f7610c04d41379e8691b3470d02839b3b0d47e064547
|
@@ -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.each(&:disable)
|
16
|
+
block.call
|
17
|
+
available_processes.each(&:enable)
|
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,21 @@
|
|
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
|
16
|
+
common_constructor :instance, :id, default: [nil] do
|
17
|
+
self.id ||= (id || self.class.default_id).to_sym
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
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.77.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-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aranha-parsers
|
@@ -17,6 +17,9 @@ dependencies:
|
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0.19'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.19.1
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -24,6 +27,9 @@ dependencies:
|
|
24
27
|
- - "~>"
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '0.19'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.19.1
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: eac_cli
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -301,6 +307,7 @@ files:
|
|
301
307
|
- lib/avm/instances/base/dockerizable.rb
|
302
308
|
- lib/avm/instances/base/entry_keys.rb
|
303
309
|
- lib/avm/instances/base/install.rb
|
310
|
+
- lib/avm/instances/base/processes.rb
|
304
311
|
- lib/avm/instances/base/subcommand_parent.rb
|
305
312
|
- lib/avm/instances/base/web.rb
|
306
313
|
- lib/avm/instances/data.rb
|
@@ -310,6 +317,7 @@ files:
|
|
310
317
|
- lib/avm/instances/docker_image.rb
|
311
318
|
- lib/avm/instances/entry_keys.rb
|
312
319
|
- lib/avm/instances/ids.rb
|
320
|
+
- lib/avm/instances/process.rb
|
313
321
|
- lib/avm/instances/runner.rb
|
314
322
|
- lib/avm/launcher.rb
|
315
323
|
- lib/avm/launcher/context.rb
|