avm 0.75.0 → 0.77.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: 283b2992d153ecb696d270dca06440c1211ad0986d2bcccbba13d59880ec8241
4
- data.tar.gz: df2da2e866a10834d9b2d7c07e921f332de3b64937592bad04eb0c334cd1b3a6
3
+ metadata.gz: d977abcc08d9507e93d451f66c89fb6cd12e8da240c29c2ad70c84646487affa
4
+ data.tar.gz: b3cf445b1f5c876ec2dc0c8461be14dd0bb3bda3bfccdcd7794c34d7f14ccd42
5
5
  SHA512:
6
- metadata.gz: 57b1246b460a76df268e0b1021e27e7a38ba6056225b5c363fa8ad53b52d5ec09d092518709060cab4fc8b472cce619d8a8b84ed9ff398e502ee5b827613d40b
7
- data.tar.gz: 4552cfce3a392507c560938a8ae956278fe03b335d50c5213e4aecfde007b5beaa66012fc0c32a24ab0736f2dae4b5b85e0b3310c7c803a96c6d74e240fae775
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(&block)
23
- entries_provider_class.define_method(auto_method_name, &block)
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
- outer_self = self
44
- define_auto_method do
45
- uri_component_entry_value(outer_self.entry_key_path.to_string)
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 setup
11
+ def define_auto_method
12
12
  outer_self = self
13
- define_auto_method do
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)
@@ -6,6 +6,11 @@ module Avm
6
6
  module Instances
7
7
  class Base
8
8
  module EntryKeys
9
+ # @return [Enumerable<String>]
10
+ def entry_keys
11
+ ::Avm::Instances::EntryKeys.all
12
+ end
13
+
9
14
  ::Avm::Instances::EntryKeys.all.each do |key|
10
15
  method_name = key.to_s.variableize
11
16
  define_method method_name do
@@ -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
@@ -17,6 +17,10 @@ module Avm
17
17
  def data_default_dump_path
18
18
  instance.data_default_dump_path.to_pathname
19
19
  end
20
+
21
+ def load(*args, &block)
22
+ instance.on_disabled_processes { super(*args, &block) }
23
+ end
20
24
  end
21
25
  end
22
26
  end
@@ -20,6 +20,10 @@ module Avm
20
20
  def identifier
21
21
  instance.data_package.units.key(self) || raise("No identifier found for #{self}")
22
22
  end
23
+
24
+ def load(*args, &block)
25
+ instance.on_disabled_processes { super(*args, &block) }
26
+ end
23
27
  end
24
28
  end
25
29
  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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avm
4
- VERSION = '0.75.0'
4
+ VERSION = '0.77.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.75.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-05-23 00:00:00.000000000 Z
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
@@ -31,6 +37,9 @@ dependencies:
31
37
  - - "~>"
32
38
  - !ruby/object:Gem::Version
33
39
  version: '0.35'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 0.35.1
34
43
  type: :runtime
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -38,6 +47,9 @@ dependencies:
38
47
  - - "~>"
39
48
  - !ruby/object:Gem::Version
40
49
  version: '0.35'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 0.35.1
41
53
  - !ruby/object:Gem::Dependency
42
54
  name: eac_config
43
55
  requirement: !ruby/object:Gem::Requirement
@@ -107,6 +119,9 @@ dependencies:
107
119
  - - "~>"
108
120
  - !ruby/object:Gem::Version
109
121
  version: '0.117'
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: 0.117.1
110
125
  type: :runtime
111
126
  prerelease: false
112
127
  version_requirements: !ruby/object:Gem::Requirement
@@ -114,6 +129,9 @@ dependencies:
114
129
  - - "~>"
115
130
  - !ruby/object:Gem::Version
116
131
  version: '0.117'
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: 0.117.1
117
135
  - !ruby/object:Gem::Dependency
118
136
  name: eac_templates
119
137
  requirement: !ruby/object:Gem::Requirement
@@ -289,6 +307,7 @@ files:
289
307
  - lib/avm/instances/base/dockerizable.rb
290
308
  - lib/avm/instances/base/entry_keys.rb
291
309
  - lib/avm/instances/base/install.rb
310
+ - lib/avm/instances/base/processes.rb
292
311
  - lib/avm/instances/base/subcommand_parent.rb
293
312
  - lib/avm/instances/base/web.rb
294
313
  - lib/avm/instances/data.rb
@@ -298,6 +317,7 @@ files:
298
317
  - lib/avm/instances/docker_image.rb
299
318
  - lib/avm/instances/entry_keys.rb
300
319
  - lib/avm/instances/ids.rb
320
+ - lib/avm/instances/process.rb
301
321
  - lib/avm/instances/runner.rb
302
322
  - lib/avm/launcher.rb
303
323
  - lib/avm/launcher/context.rb