avm 0.64.1 → 0.65.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: 16d0d9543dd537c7dec9ad3b7958426558e9b0ca7f7763345e5beb9b55f4fea3
4
- data.tar.gz: faf52cfe3e69406c5a3d36b1485aee475e9d8ee44aebb4d2bc10baec99e6c83a
3
+ metadata.gz: 2944015b38061efc50472926c45c9d9696c6960d0d150226481249f86ee5d2d1
4
+ data.tar.gz: c8e3d32b157f5e8ff06ce1904fa702fdd7a5ae425e3d1da9e8327332c71b9693
5
5
  SHA512:
6
- metadata.gz: 77a8de4846a96ad91dd3809131ba510b1c113b81718eead76461993982c4420f5d09a67ff45b79dd1daef102c82d1268776262c0fe809fe607428d5f2b410d23
7
- data.tar.gz: fcb16b18c37d910c32a114dffe9e60367cd03ea768475d464f6324f696a799c0a6ceae30a2d7b4b099dcdde5a9f5bc90d9b03fb97d27d6ce16ac8a9741c9cdd6
6
+ metadata.gz: 792dfd5ec8d14e1fd1723962a4b6ab1da06e998a0d3bb1204ae4801c76a94130969010a3be542fd4d08f07b77ab896b7cedce265a29f9a40430a0f490670f567
7
+ data.tar.gz: f76e19d8af260f6ff840960b655362c2c47dd9292030c26eb7e0c72667f37e72051f3460b517a7057655da7b9b4dc7b9a89851452fd3de78f4f96c9c46aca9eb
@@ -7,8 +7,9 @@ module Avm
7
7
  class Base
8
8
  module AutoValues
9
9
  module Database
10
+ LOCAL_ADDRESS = '127.0.0.1'
10
11
  DEFAULT_EXTRA = ''
11
- DEFAULT_HOSTNAME = '127.0.0.1'
12
+ DEFAULT_HOSTNAME = LOCAL_ADDRESS
12
13
  DEFAULT_LIMIT = 5
13
14
  DEFAULT_PORTS = {
14
15
  'postgresql' => 5432,
@@ -19,8 +20,16 @@ module Avm
19
20
  DEFAULT_SYSTEM = 'postgresql'
20
21
  DEFAULT_TIMEOUT = 5000
21
22
 
22
- def auto_database_extra
23
- database_auto_common('hostname') || DEFAULT_EXTRA
23
+ %w[extra hostname limit system timeout].each do |attr|
24
+ define_method "auto_database_#{attr}" do
25
+ database_auto_common(attr) || self.class.const_get("default_#{attr}".upcase)
26
+ end
27
+ end
28
+
29
+ %w[username password].each do |attr|
30
+ define_method "auto_database_#{attr}" do
31
+ database_auto_common(attr) || id
32
+ end
24
33
  end
25
34
 
26
35
  def auto_database_name
@@ -28,34 +37,10 @@ module Avm
28
37
  ::Avm::Instances::EntryKeys::DATABASE_NAME) || id
29
38
  end
30
39
 
31
- def auto_database_hostname
32
- database_auto_common('hostname') || DEFAULT_HOSTNAME
33
- end
34
-
35
- def auto_database_limit
36
- database_auto_common('limit') || DEFAULT_LIMIT
37
- end
38
-
39
- def auto_database_password
40
- database_auto_common('password') || id
41
- end
42
-
43
40
  def auto_database_port
44
41
  database_auto_common('port') || database_port_by_system
45
42
  end
46
43
 
47
- def auto_database_username
48
- database_auto_common('username') || id
49
- end
50
-
51
- def auto_database_system
52
- database_auto_common('system') || DEFAULT_SYSTEM
53
- end
54
-
55
- def auto_database_timeout
56
- database_auto_common('timeout') || DEFAULT_TIMEOUT
57
- end
58
-
59
44
  private
60
45
 
61
46
  def database_auto_common(suffix)
@@ -2,13 +2,13 @@
2
2
 
3
3
  require 'avm/launcher/paths/real'
4
4
  require 'avm/launcher/stereotype'
5
+ require 'eac_ruby_utils/core_ext'
5
6
 
6
7
  module Avm
7
8
  module Launcher
8
9
  module Paths
9
10
  class Logical
10
- include ::Comparable
11
- include ::EacRubyUtils::SimpleCache
11
+ enable_simple_cache
12
12
 
13
13
  class << self
14
14
  def from_h(context, hash)
@@ -17,18 +17,11 @@ module Avm
17
17
  end
18
18
  end
19
19
 
20
- attr_reader :context, :real, :logical, :parent_path
21
-
22
- def initialize(context, parent_path, real, logical)
23
- @context = context
24
- @parent_path = parent_path
25
- @real = ::Avm::Launcher::Paths::Real.new(real)
26
- @logical = logical
20
+ common_constructor :context, :parent_path, :real, :logical do
21
+ self.real = ::Avm::Launcher::Paths::Real.new(real)
27
22
  end
28
23
 
29
- def <=>(other)
30
- [logical, real] <=> [other.logical, other.real]
31
- end
24
+ compare_by :logical, :real
32
25
 
33
26
  def to_s
34
27
  logical
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.64.1'
4
+ VERSION = '0.65.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.64.1
4
+ version: 0.65.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-03-28 00:00:00.000000000 Z
11
+ date: 2023-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -287,7 +287,6 @@ files:
287
287
  - lib/avm/instances/base/auto_values/data.rb
288
288
  - lib/avm/instances/base/auto_values/database.rb
289
289
  - lib/avm/instances/base/auto_values/mailer.rb
290
- - lib/avm/instances/base/auto_values/ruby.rb
291
290
  - lib/avm/instances/base/auto_values/source.rb
292
291
  - lib/avm/instances/base/dockerizable.rb
293
292
  - lib/avm/instances/base/entry_keys.rb
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module Instances
5
- class Base
6
- module AutoValues
7
- module Ruby
8
- def auto_ruby_version
9
- inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, 'ruby.version')
10
- end
11
- end
12
- end
13
- end
14
- end
15
- end