avm 0.68.0 → 0.70.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: 46e1377fa15fec46de929ea19865c646a3505e4b017ce614d90f78dadd2251cd
4
- data.tar.gz: d79b5728e7c89b32e20ec430c87cbe9dbb0f50644645f796edf67da2ce7cbef6
3
+ metadata.gz: 2e2eb2f46518de88aca96c5a8cedf9c64abb72b862a657a195ef6ff081547cf4
4
+ data.tar.gz: 0e516460bb5620cd9ceb9f6bfbfd04db263760a1ec294f1d67c8fe43c78dd81c
5
5
  SHA512:
6
- metadata.gz: 18d7483e604e82fbe29ea9adfe1ba16463def7927faf24f074557fa37b58012d29251ebf4e85bd422a048a2e1c71608a3e8c7606e18517df6f745b3fc5b5ff8d
7
- data.tar.gz: 02b27be5b600b610ec0e6cf334682ec853160def0406fa317ab288da4d0c553d07f0cc54553d05952303572900d73699e6c57a040a3e3f2ddceab43fde1eafba
6
+ metadata.gz: 2eb9e691468af8f7e927c2dc99c8d7a1ff5472a5cfa846bab185416062fd9e2ec338fe38a374837f4cc260aa2bbf9380b7bd85b156d53779087f4a14970b3e89
7
+ data.tar.gz: 01dac660041abddfcebfa4b1bc56bcfe21d775c6393b6c575b0dba1ba3bec2286f0dfe15505ee3b17bc9222332dbd28e17f3333c0282f89bec9f4b178cef4442
@@ -45,9 +45,20 @@ module Avm
45
45
  end
46
46
  end
47
47
 
48
+ # @param id [Symbol]
49
+ # @return [Avm::Data::Unit]
50
+ def unit(identifier)
51
+ units[identifier.to_sym] || raise("No unit found with identifier \"#{identifier}\"")
52
+ end
53
+
48
54
  def units
49
55
  @units ||= {}
50
56
  end
57
+
58
+ # @return [Enumerable<String>]
59
+ def units_ids
60
+ units.keys
61
+ end
51
62
  end
52
63
  end
53
64
  end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/runner/context'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module Instances
8
+ class Base
9
+ class SubcommandParent
10
+ enable_simple_cache
11
+ common_constructor :instance
12
+
13
+ private
14
+
15
+ def runner_context_uncached
16
+ ::EacCli::Runner::Context.new(self, argv: runner_argv)
17
+ end
18
+
19
+ def runner_argv
20
+ [instance.class.name.split('::')[-2].dasherize, instance.id]
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -17,7 +17,7 @@ module Avm
17
17
  self.options = self.class.lists.option.hash_keys_validate!(options)
18
18
  end
19
19
 
20
- before_load :clear_files
20
+ before_load :clear
21
21
 
22
22
  # @return [Pathname]
23
23
  def files_path
@@ -33,7 +33,7 @@ module Avm
33
33
  instance_command('tar', '-xzf', '-', '-C', files_path)
34
34
  end
35
35
 
36
- def clear_files
36
+ def clear
37
37
  infom "Removing all files under #{files_path}..."
38
38
  instance_command('mkdir', '-p', files_path).execute!
39
39
  instance_command('find', files_path, '-mindepth', 1, '-delete').execute!
@@ -8,6 +8,18 @@ module Avm
8
8
  module Data
9
9
  class Unit < ::Avm::Data::Unit
10
10
  common_constructor :instance
11
+
12
+ # @return [Pathname]
13
+ def data_default_dump_path
14
+ instance.data_default_dump_path.to_pathname.basename_sub('.*') do |b|
15
+ "#{b}_#{identifier}#{extension}"
16
+ end
17
+ end
18
+
19
+ # @return [String]
20
+ def identifier
21
+ instance.data_package.units.key(self) || raise("No identifier found for #{self}")
22
+ end
11
23
  end
12
24
  end
13
25
  end
@@ -28,6 +28,7 @@ module Avm
28
28
  {
29
29
  '' => %w[name source_instance_id],
30
30
  admin: URI_FIELDS + %w[api_key],
31
+ data: %w[default_dump_path],
31
32
  database: URI_FIELDS + %w[id limit name system timeout extra],
32
33
  docker: %w[registry],
33
34
  install: URI_FIELDS + %w[id data_path email groupname],
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.68.0'
4
+ VERSION = '0.70.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.68.0
4
+ version: 0.70.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-06 00:00:00.000000000 Z
11
+ date: 2023-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.31'
39
+ version: '0.33'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.31'
46
+ version: '0.33'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: eac_config
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -112,14 +112,14 @@ dependencies:
112
112
  requirements:
113
113
  - - "~>"
114
114
  - !ruby/object:Gem::Version
115
- version: '0.112'
115
+ version: '0.114'
116
116
  type: :runtime
117
117
  prerelease: false
118
118
  version_requirements: !ruby/object:Gem::Requirement
119
119
  requirements:
120
120
  - - "~>"
121
121
  - !ruby/object:Gem::Version
122
- version: '0.112'
122
+ version: '0.114'
123
123
  - !ruby/object:Gem::Dependency
124
124
  name: eac_templates
125
125
  requirement: !ruby/object:Gem::Requirement
@@ -288,6 +288,7 @@ files:
288
288
  - lib/avm/instances/base/dockerizable.rb
289
289
  - lib/avm/instances/base/entry_keys.rb
290
290
  - lib/avm/instances/base/install.rb
291
+ - lib/avm/instances/base/subcommand_parent.rb
291
292
  - lib/avm/instances/base/web.rb
292
293
  - lib/avm/instances/data.rb
293
294
  - lib/avm/instances/data/files_unit.rb