avm 0.40.0 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29538404e81ca5b9e3c7043a5b665b9a73f4bb662b7e5d6d1de891154c3bdddf
4
- data.tar.gz: a2e2216c1cbdaf94044f3b59ee1c0aec69e193720d3f6312c25a6aad59865ea0
3
+ metadata.gz: 64ca72cb2ab91751e6ac2bf8e81404c0c5111ccbe4971ea349bd38ee490735e2
4
+ data.tar.gz: 1b840a43b5511128fa3f1cbf54395a3fb435f2c5cd0bb59293aac6fdd970c4e4
5
5
  SHA512:
6
- metadata.gz: c4e2ac1e34e6d64bc030183c414507b5ca15e82039ff16728727786357b5922c8a193cd58ffd2b51d40b0055531ce94b111135e1ff0589e198099b40b3421f3d
7
- data.tar.gz: f430f917bd972158fdfbef76de2f72ecfa4a514df8d333dc360cdaaf6adcc6bbc4dabce9f37371c07b00fde76bc8eda1162787c20ab2a2e1edc80c736a70a98f
6
+ metadata.gz: 4a6b697d1114c887b4590f51afe76b0bde03b471b3eabfbcf904c5b31fcd686d15eb355cb43a9145e934de2cd60f3ecf045abefda892b4feb3835f7392e5d2cf
7
+ data.tar.gz: a9331ce632924f1bc83a6ac93b12609abbeb92eec20c04d6c3340d19779ffd8876c63b238cf017ad351e4b7b219fe9ab4ae84bd95ac912f6d92c26a09304c17f
@@ -38,7 +38,7 @@ module Avm
38
38
 
39
39
  # @return [Avm::Sources::Base]
40
40
  def local_source_uncached
41
- ::Avm::Registry.sources.detect(local_instance.fs_path)
41
+ ::Avm::Registry.sources.detect(local_instance.install_path)
42
42
  end
43
43
  end
44
44
  end
@@ -18,7 +18,8 @@ module Avm
18
18
  before_load :clear_files
19
19
 
20
20
  def files_path
21
- ::File.join(instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH), fs_path_subpath)
21
+ ::File.join(instance.read_entry(::Avm::Instances::EntryKeys::INSTALL_PATH),
22
+ fs_path_subpath)
22
23
  end
23
24
 
24
25
  def dump_command
@@ -11,10 +11,10 @@ module Avm
11
11
  class DefaultValue
12
12
  enable_method_class
13
13
  common_constructor :uri_component_entry_value
14
- delegate :component, :entries_provider, to: :uri_component_entry_value
14
+ delegate :component_entry_path, :entries_provider, to: :uri_component_entry_value
15
15
 
16
16
  def default_value_method_name
17
- "#{component}_default_value"
17
+ "#{component_entry_path.parts.join('_').variableize}_default_value"
18
18
  end
19
19
 
20
20
  def result
@@ -11,7 +11,7 @@ module Avm
11
11
  class InheritedValue
12
12
  enable_method_class
13
13
  common_constructor :uri_component_entry_value
14
- delegate :component, :entries_provider, :id_entry_path, :component_entry_path,
14
+ delegate :entries_provider, :id_entry_path, :component_entry_path,
15
15
  to: :uri_component_entry_value
16
16
 
17
17
  def result
@@ -29,7 +29,7 @@ module Avm
29
29
  end
30
30
 
31
31
  def inherited_value_block_method_name
32
- "#{component}_inherited_value_proc".to_sym
32
+ "#{component_entry_path.parts.join('_').variableize}_inherited_value_proc".to_sym
33
33
  end
34
34
  end
35
35
  end
@@ -28,13 +28,17 @@ module Avm
28
28
  ::Avm::Entries::AutoValues::UriEntry.new(self, 'install').value
29
29
  end
30
30
 
31
- def data_path_inherited_value_proc(value)
31
+ def install_data_path_inherited_value_proc(value)
32
32
  value + '/' + id
33
33
  end
34
34
 
35
- def groupname_default_value
35
+ def install_groupname_default_value
36
36
  read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_USERNAME)
37
37
  end
38
+
39
+ def install_path_inherited_value_proc(value)
40
+ install_data_path_inherited_value_proc(value)
41
+ end
38
42
  end
39
43
  end
40
44
  end
@@ -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
 
@@ -45,7 +45,7 @@ module Avm
45
45
  end
46
46
 
47
47
  {
48
- '' => %w[fs_path name source_instance_id],
48
+ '' => %w[name source_instance_id],
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],
@@ -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.40.0'
4
+ VERSION = '0.42.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.40.0
4
+ version: 0.42.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-18 00:00:00.000000000 Z
11
+ date: 2022-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_cli
@@ -97,6 +97,9 @@ dependencies:
97
97
  - - "~>"
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0.102'
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: 0.102.1
100
103
  type: :runtime
101
104
  prerelease: false
102
105
  version_requirements: !ruby/object:Gem::Requirement
@@ -104,6 +107,9 @@ dependencies:
104
107
  - - "~>"
105
108
  - !ruby/object:Gem::Version
106
109
  version: '0.102'
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: 0.102.1
107
113
  - !ruby/object:Gem::Dependency
108
114
  name: eac_templates
109
115
  requirement: !ruby/object:Gem::Requirement
@@ -250,7 +256,6 @@ files:
250
256
  - lib/avm/instances/base/auto_values/admin.rb
251
257
  - lib/avm/instances/base/auto_values/data.rb
252
258
  - lib/avm/instances/base/auto_values/database.rb
253
- - lib/avm/instances/base/auto_values/filesystem.rb
254
259
  - lib/avm/instances/base/auto_values/install.rb
255
260
  - lib/avm/instances/base/auto_values/mailer.rb
256
261
  - lib/avm/instances/base/auto_values/ruby.rb
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/instances/entry_keys'
4
-
5
- module Avm
6
- module Instances
7
- class Base
8
- module AutoValues
9
- module Filesystem
10
- def auto_fs_path
11
- inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
12
- ::Avm::Instances::EntryKeys::FS_PATH) { |v| v + '/' + id }
13
- end
14
- end
15
- end
16
- end
17
- end
18
- end