avm 0.77.0 → 0.79.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: d977abcc08d9507e93d451f66c89fb6cd12e8da240c29c2ad70c84646487affa
4
- data.tar.gz: b3cf445b1f5c876ec2dc0c8461be14dd0bb3bda3bfccdcd7794c34d7f14ccd42
3
+ metadata.gz: 4e75e2e4044fb0c1e42d0d5cdc2f6abb2e1997084f3d5678988bf1dc8088aa23
4
+ data.tar.gz: 914822d073360376f74d24d38fe8deaf8632f8d881d5b3218142dc9607488f36
5
5
  SHA512:
6
- metadata.gz: 35c7f775fc34a8d91b2a3db000303ecd339c7b0499c585801a70c8f0816ed2a0f6fb0887205a27749689814ece0b6cdeff1d60b05a49f868820087930039baf5
7
- data.tar.gz: cc74d0f97e1d4c9355ede98286350593e01779d5d7149c46fbf8c009c1aea3414cf6a4c758c7c89fc528f7610c04d41379e8691b3470d02839b3b0d47e064547
6
+ metadata.gz: 8bd934e7f40740bedc0815ac12bdfb9ebdc6430c232f1f31181818b7ec4160f5afad568e256a61772eef3efb9e9d57757028918341a7558247360bef496b0d51
7
+ data.tar.gz: 040d13c6f269e1050053e750bc66af9c7d5ff4a8809450ece0d604a1a85223c9ababaca624db0d63b3368948ed726bd7603ebb242b6da428ea7161cff384827c
@@ -12,6 +12,7 @@ module Avm
12
12
  require_sub __FILE__, include_modules: true
13
13
  include ::Avm::Entries::Base
14
14
 
15
+ AVM_TYPE = 'Application'
15
16
  LOCAL_INSTANCE_SUFFIX = 'dev'
16
17
 
17
18
  common_constructor :id do
@@ -12,9 +12,9 @@ module Avm
12
12
  end
13
13
 
14
14
  def on_disabled_processes(&block)
15
- available_processes.each(&:disable)
16
- block.call
17
- available_processes.each(&:enable)
15
+ available_processes.inject(block) do |a, e|
16
+ -> { e.on_disabled(&a) }
17
+ end.call
18
18
  end
19
19
 
20
20
  # @return [Array<Avm::Instances::Process>]
@@ -12,10 +12,20 @@ module Avm
12
12
  end
13
13
  end
14
14
 
15
- acts_as_abstract :available?, :disable, :enable
15
+ acts_as_abstract :available?, :disable, :enable, :enabled?
16
16
  common_constructor :instance, :id, default: [nil] do
17
17
  self.id ||= (id || self.class.default_id).to_sym
18
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
19
29
  end
20
30
  end
21
31
  end
@@ -10,6 +10,7 @@ module Avm
10
10
 
11
11
  # @return [Array<Avm::Applications::Base>]
12
12
  def available
13
+ load_config
13
14
  detected.values
14
15
  end
15
16
 
@@ -26,6 +27,12 @@ module Avm
26
27
  def detected
27
28
  @detected ||= {}
28
29
  end
30
+
31
+ def load_config
32
+ ::Avm::Registry.config_objects.available.each do |id, type|
33
+ detect(id) if type == ::Avm::Applications::Base::AVM_TYPE
34
+ end
35
+ end
29
36
  end
30
37
  end
31
38
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/applications/base'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module Registry
8
+ class ConfigObjects
9
+ def initialize(*args); end
10
+
11
+ # @return [Array<Avm::Applications::Base>]
12
+ def available
13
+ ::EacConfig::Node.context.current.entries('*.avm_type').node_entries
14
+ .map { |ne| [ne.path.first, ne.value] }
15
+ end
16
+ end
17
+ end
18
+ end
data/lib/avm/registry.rb CHANGED
@@ -7,8 +7,9 @@ module Avm
7
7
  module Registry
8
8
  require_sub __FILE__
9
9
  enable_listable
10
- lists.add_symbol :category, :applications, :application_stereotypes, :file_formats, :instances,
11
- :launcher_stereotypes, :runners, :scms, :source_generators, :sources
10
+ lists.add_symbol :category, :applications, :application_stereotypes, :config_objects,
11
+ :file_formats, :instances, :launcher_stereotypes, :runners, :scms,
12
+ :source_generators, :sources
12
13
 
13
14
  class << self
14
15
  enable_simple_cache
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.77.0'
4
+ VERSION = '0.79.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.77.0
4
+ version: 0.79.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-06-04 00:00:00.000000000 Z
11
+ date: 2023-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.19'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 0.19.1
19
+ version: '0.21'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '0.19'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 0.19.1
26
+ version: '0.21'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: eac_cli
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -56,14 +50,14 @@ dependencies:
56
50
  requirements:
57
51
  - - "~>"
58
52
  - !ruby/object:Gem::Version
59
- version: '0.12'
53
+ version: '0.14'
60
54
  type: :runtime
61
55
  prerelease: false
62
56
  version_requirements: !ruby/object:Gem::Requirement
63
57
  requirements:
64
58
  - - "~>"
65
59
  - !ruby/object:Gem::Version
66
- version: '0.12'
60
+ version: '0.14'
67
61
  - !ruby/object:Gem::Dependency
68
62
  name: eac_docker
69
63
  requirement: !ruby/object:Gem::Requirement
@@ -118,20 +112,14 @@ dependencies:
118
112
  requirements:
119
113
  - - "~>"
120
114
  - !ruby/object:Gem::Version
121
- version: '0.117'
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: 0.117.1
115
+ version: '0.119'
125
116
  type: :runtime
126
117
  prerelease: false
127
118
  version_requirements: !ruby/object:Gem::Requirement
128
119
  requirements:
129
120
  - - "~>"
130
121
  - !ruby/object:Gem::Version
131
- version: '0.117'
132
- - - ">="
133
- - !ruby/object:Gem::Version
134
- version: 0.117.1
122
+ version: '0.119'
135
123
  - !ruby/object:Gem::Dependency
136
124
  name: eac_templates
137
125
  requirement: !ruby/object:Gem::Requirement
@@ -352,6 +340,7 @@ files:
352
340
  - lib/avm/registry/application_stereotypes/build_available.rb
353
341
  - lib/avm/registry/application_stereotypes/stereotype_builder.rb
354
342
  - lib/avm/registry/applications.rb
343
+ - lib/avm/registry/config_objects.rb
355
344
  - lib/avm/registry/file_formats.rb
356
345
  - lib/avm/registry/from_gems.rb
357
346
  - lib/avm/registry/instances.rb