avm 0.64.2 → 0.65.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: cfbe828fa402574c8d87792d855971448ab931e26ecfb1ed15ea50acc81169e6
4
- data.tar.gz: 3a1c0bc8719b29f23cb8e8b195430ca875592b8f01902e1cddcd80ac64943774
3
+ metadata.gz: 2944015b38061efc50472926c45c9d9696c6960d0d150226481249f86ee5d2d1
4
+ data.tar.gz: c8e3d32b157f5e8ff06ce1904fa702fdd7a5ae425e3d1da9e8327332c71b9693
5
5
  SHA512:
6
- metadata.gz: 7fb5104275aa21de8f5b647cd035df7ddf7cf5a5525138d1485643d931257974de2bcf3adbc735212b7c2e4e3958a4079ebd14d6a9bee1c319f0f9fa4984a90e
7
- data.tar.gz: 71880eff3e7920658456b8e5e7fe7998b53ea27c5fed3c612008147ad55e65c12268b6f6a67608fa6c89e684d57711114d803bcbfefe5cd16de1370914f5ffbc
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)
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.2'
4
+ VERSION = '0.65.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.64.2
4
+ version: 0.65.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo H. Bogoni
@@ -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