avm 0.41.1 → 0.43.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: 01cc4fb71195c68ac7537f915a8a42233b781ed6c07d7ecf5eeafae0e213159a
4
- data.tar.gz: a7de999e81365e9f8f05bfa6af80d5a4a73411db1fe4b0c839b571617a3cb14e
3
+ metadata.gz: da90158349f77578925f4185dcf817f3d086ba8939cf6fe2a0057d5acebce8d6
4
+ data.tar.gz: 68bdb121438447bb34a59526adb61af042922a59f0d31226cae3ad10c9b66bf4
5
5
  SHA512:
6
- metadata.gz: 6ae39e05f3e21ed0784f6c137c9ce41788e3431c6df80b5e03b61f5a6e0a19873aaf845a7d7d1b8a190c154bce8d6d9098d9dcec95022bbee808c48e1bc5dcd5
7
- data.tar.gz: 50effabbbe2de5927f7d6d6e931f0593fa92b7f200445aee17f2e6c3bfba4709dfc461fc9acc3b172407d877b576417d9c67ffd450bad610edf2fc0a5ffdeea3
6
+ metadata.gz: 6842223c4c7006bad23a1b1bd283b389ca20fdb63acb2a6264a84cf737fefc43406167cedfab09843aaddb7620295b1b1fb70b445ce517bd7752ebd0e66982fe
7
+ data.tar.gz: c4d9bd5b0994d480ae7ff9b8a48edfdfb1fd20b849c5cd99adee4fb3e6ff645b7dbeba8092771b475e6284254f13109340f0c7d58eb8ccdf0a97d9f2d1ba0b86
@@ -8,7 +8,8 @@ module Avm
8
8
  class Base
9
9
  module AutoValues
10
10
  module Install
11
- (::Avm::Entries::UriBuilder::ENTRIES_FIELDS + %w[data_path groupname]).each do |component|
11
+ (::Avm::Entries::UriBuilder::ENTRIES_FIELDS + %w[data_path email groupname])
12
+ .each do |component|
12
13
  method_suffix = "install_#{component}"
13
14
  define_method "auto_#{method_suffix}" do
14
15
  uri_component_entry_value(
@@ -51,11 +51,10 @@ module Avm
51
51
  end
52
52
 
53
53
  def host_env_uncached
54
- install_uri = entry(::Avm::Instances::EntryKeys::INSTALL_URL).value.to_uri
55
- case install_uri.scheme
54
+ case install_scheme
56
55
  when 'file' then ::EacRubyUtils::Envs.local
57
- when 'ssh' then ::EacRubyUtils::Envs.ssh(install_uri)
58
- else raise("Unmapped access value: \"#{install_uri}\"")
56
+ when 'ssh' then ::EacRubyUtils::Envs.ssh(install_url)
57
+ else raise("Unmapped access value: \"#{install_scheme}\"")
59
58
  end
60
59
  end
61
60
 
@@ -49,7 +49,7 @@ module Avm
49
49
  admin: URI_FIELDS + %w[api_key],
50
50
  database: URI_FIELDS + %w[id limit name system timeout extra],
51
51
  docker: %w[registry],
52
- install: URI_FIELDS + %w[id data_path groupname],
52
+ install: URI_FIELDS + %w[id data_path email groupname],
53
53
  mailer: {
54
54
  '' => %w[id from reply_to],
55
55
  smtp: URI_FIELDS + %w[address domain authentication openssl_verify_mode starttls_auto tls]
@@ -6,35 +6,31 @@ require 'eac_cli/core_ext'
6
6
  module Avm
7
7
  module Instances
8
8
  class Runner < ::Avm::Runners::Base
9
- class << self
10
- def application_stereotype
11
- ::Avm::Registry.application_stereotypes.detect(stereotype_name)
12
- end
13
-
14
- delegate :instance_class, to: :application_stereotype
9
+ runner_with :help, :subcommands do
10
+ desc 'Utilities for a instance.'
11
+ pos_arg 'instance-id'
12
+ subcommands
13
+ end
15
14
 
16
- def stereotype_module
17
- ::Avm.const_get(stereotype_name)
18
- end
15
+ delegate :class, to: :instance, prefix: true
16
+ delegate :stereotype_module, :stereotype_name, to: :class
19
17
 
20
- def stereotype_name
21
- name.demodulize
22
- end
18
+ def extra_available_subcommands
19
+ instance.if_present({}, &:extra_available_subcommands)
23
20
  end
24
21
 
25
- description = "Utilities for #{stereotype_name} instances."
26
- runner_with :help, :subcommands do
27
- desc description
28
- pos_arg 'instance-id'
29
- subcommands
22
+ def stereotype_module
23
+ instance.application.stereotype.namespace_module
30
24
  end
31
25
 
32
- delegate :instance_class, :stereotype_module, :stereotype_name, to: :class
26
+ def stereotype_name
27
+ stereotype_module.name
28
+ end
33
29
 
34
30
  private
35
31
 
36
32
  def instance_uncached
37
- self.class.instance_class.by_id(parsed.instance_id)
33
+ parsed.instance_id.if_present { |v| ::Avm::Registry.instances.detect(v) }
38
34
  end
39
35
  end
40
36
  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.41.1'
4
+ VERSION = '0.43.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.41.1
4
+ version: 0.43.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: 2022-08-20 00:00:00.000000000 Z
11
+ date: 2022-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_cli
@@ -96,14 +96,14 @@ dependencies:
96
96
  requirements:
97
97
  - - "~>"
98
98
  - !ruby/object:Gem::Version
99
- version: '0.102'
99
+ version: '0.103'
100
100
  type: :runtime
101
101
  prerelease: false
102
102
  version_requirements: !ruby/object:Gem::Requirement
103
103
  requirements:
104
104
  - - "~>"
105
105
  - !ruby/object:Gem::Version
106
- version: '0.102'
106
+ version: '0.103'
107
107
  - !ruby/object:Gem::Dependency
108
108
  name: eac_templates
109
109
  requirement: !ruby/object:Gem::Requirement
@@ -247,7 +247,6 @@ files:
247
247
  - lib/avm/instances.rb
248
248
  - lib/avm/instances/base.rb
249
249
  - lib/avm/instances/base/auto_values.rb
250
- - lib/avm/instances/base/auto_values/admin.rb
251
250
  - lib/avm/instances/base/auto_values/data.rb
252
251
  - lib/avm/instances/base/auto_values/database.rb
253
252
  - lib/avm/instances/base/auto_values/install.rb
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module Instances
5
- class Base
6
- module AutoValues
7
- module Admin
8
- def auto_admin_email
9
- inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, 'admin.email')
10
- end
11
-
12
- def auto_admin_name
13
- inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, 'admin.name')
14
- end
15
- end
16
- end
17
- end
18
- end
19
- end