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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 602c52da99b301910d47a70c9ea6f1d8f9f9755c848d2e76ab48ac1eccf30fdd
4
- data.tar.gz: 71c8c4c0ef62594c171d62d073eb32dd81837f7ada1fd6666372ead450eab76e
3
+ metadata.gz: d977abcc08d9507e93d451f66c89fb6cd12e8da240c29c2ad70c84646487affa
4
+ data.tar.gz: b3cf445b1f5c876ec2dc0c8461be14dd0bb3bda3bfccdcd7794c34d7f14ccd42
5
5
  SHA512:
6
- metadata.gz: 56204b4fea75fa041555a662779f1763957ce98ba643a6050d3e44b247ba7ae36196abb013b6aa47c912f94fdbcc62552f19faa7fae79287dd87ada7da6d960c
7
- data.tar.gz: bd7e7c229db445f4a9c1a995a34a596f02d70a45d487c7feabe37a32b3766a01769dc9c726646784f31a322c0cd315d90f5a3e6919c90ed31915ba2a5d6da683
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)
@@ -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.76.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.76.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-26 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
@@ -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