avm 0.14.0 → 0.17.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: 84721ab93d07c32f2b8c587c364a3cf3a3881b12c7984bf8011737eae8e47334
4
- data.tar.gz: d54152761bbc8cd0ab059e96e3e8a4a8d102c9276b29362a92cc915a0cad3a94
3
+ metadata.gz: edd4c18a4938a22e0913c03f4fea9ecd3e88fad97b0b9af4c259921d7a599834
4
+ data.tar.gz: 7120426eaba5a99f1138e588c1e2b1a8d3e5e424d1e4abc29ddeab703a99dd17
5
5
  SHA512:
6
- metadata.gz: e152406d787229dd1a56ff977fbcb4d50dac8667fb67360e323fc758420dbbd81efd37f5049dd1bbf8961aae93e6fa34ea865831dcdcbdd69f1e8d6a6e486749
7
- data.tar.gz: a3b25728a082f27ca49e85fb191e8334be93cc8919df3175cdbd7264066d598ddb2cc9dc0a016d52ac450ba6a3afb6c5890ab12972be7e54dc13a1dff8d192f0
6
+ metadata.gz: 314413e3a55d8a090b7f793846300b0be4fde3468865ab395358d1029c537c7974ee2190973be7a703b48cfcc2b22f1da2b02b0c0a00fb1a99b233fb3a0a6b1a
7
+ data.tar.gz: 3f9eb9c95d16ab50104ee56aa8390df9d2eaf34a851e2168002b385f9189aa7df04153a8008595528a1ac167fab29732baeab251579ac6a577490691aa1cf40f
@@ -37,7 +37,7 @@ module Avm
37
37
  end
38
38
 
39
39
  def auto_database_password
40
- database_auto_common('password')
40
+ database_auto_common('password') || id
41
41
  end
42
42
 
43
43
  def auto_database_port
@@ -45,7 +45,7 @@ module Avm
45
45
  end
46
46
 
47
47
  def auto_database_username
48
- database_auto_common('username')
48
+ database_auto_common('username') || id
49
49
  end
50
50
 
51
51
  def auto_database_system
@@ -47,7 +47,8 @@ module Avm
47
47
  docker: %w[registry],
48
48
  mailer: {
49
49
  '' => %w[id from reply_to],
50
- smtp: %w[address port domain username password authentication starttls_auto]
50
+ smtp: %w[address port domain username password authentication openssl_verify_mode
51
+ starttls_auto tls]
51
52
  },
52
53
  ssh: %w[hostname port url username],
53
54
  web: %w[authority hostname path port scheme url userinfo]
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avm
4
+ module Launcher
5
+ module Errors
6
+ class Base < ::StandardError
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/launcher/errors/base'
4
+
5
+ module Avm
6
+ module Launcher
7
+ module Errors
8
+ class NonProject < ::Avm::Launcher::Errors::Base
9
+ def initialize(path)
10
+ super("#{path} is not a project")
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avm
4
+ module Launcher
5
+ module Paths
6
+ class Real < String
7
+ def initialize(path)
8
+ raise "Argument path is not a string: \"#{path}\"|#{path.class}" unless path.is_a?(String)
9
+
10
+ super(path)
11
+ end
12
+
13
+ def subpath(relative_path)
14
+ ::Avm::Launcher::Paths::Real.new(::File.expand_path(relative_path, self))
15
+ end
16
+
17
+ def basename
18
+ ::File.basename(self)
19
+ end
20
+
21
+ def dirname
22
+ return nil if self == '/'
23
+
24
+ self.class.new(::File.dirname(self))
25
+ end
26
+
27
+ def find_file_with_extension(extension)
28
+ r = find_files_with_extension(extension)
29
+ return r.first if r.any?
30
+
31
+ raise "Extension \"#{extension}\" not found in directory \"#{self}\""
32
+ end
33
+
34
+ def find_files_with_extension(extension)
35
+ r = []
36
+ ::Dir.entries(self).each do |i|
37
+ r << ::File.expand_path(i, self) if i =~ /#{::Regexp.quote(extension)}\z/
38
+ end
39
+ r
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_support/concern' # Missing on "eac/listable"
4
+ require 'active_support/hash_with_indifferent_access'
5
+ require 'eac_ruby_utils/listable'
6
+
7
+ module Avm
8
+ module Launcher
9
+ module Publish
10
+ class CheckResult
11
+ include ::EacRubyUtils::Listable
12
+
13
+ lists.add_string :status, :updated, :pending, :blocked, :outdated
14
+
15
+ lists.status.values.each do |status| # rubocop:disable Style/HashEachMethods
16
+ class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
17
+ def self.#{status}(message)
18
+ new('#{status}', message)
19
+ end
20
+ RUBY_EVAL
21
+ end
22
+
23
+ class << self
24
+ def pending_status?(status)
25
+ [STATUS_PENDING].include?(status)
26
+ end
27
+
28
+ def updated_color
29
+ 'green'
30
+ end
31
+
32
+ def pending_color
33
+ 'yellow'
34
+ end
35
+
36
+ def blocked_color
37
+ 'red'
38
+ end
39
+
40
+ def outdated_color
41
+ 'light_blue'
42
+ end
43
+ end
44
+
45
+ attr_reader :status, :message
46
+
47
+ def initialize(status, message)
48
+ raise "Status \"#{status}\" not in #{self.class.lists.status.values}" unless
49
+ self.class.lists.status.values.include?(status)
50
+
51
+ @status = status
52
+ @message = message
53
+ end
54
+
55
+ def to_s
56
+ message.light_white.send("on_#{background_color}")
57
+ end
58
+
59
+ private
60
+
61
+ def background_color
62
+ self.class.send("#{status}_color")
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
@@ -3,7 +3,6 @@
3
3
  require 'avm/instances/base'
4
4
  require 'avm/self/docker_image'
5
5
  require 'avm/self/instance/entry_keys'
6
- require 'avm/eac_ubuntu_base0/docker_image'
7
6
 
8
7
  module Avm
9
8
  module Self
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/instances/application'
4
+ require 'avm/instances/base'
5
+
6
+ module Avm
7
+ module Sources
8
+ class Base
9
+ module Instance
10
+ DEFAULT_INSTANCE_SUFFIX = 'dev'
11
+
12
+ def instance_suffix
13
+ DEFAULT_INSTANCE_SUFFIX
14
+ end
15
+
16
+ private
17
+
18
+ def application_uncached
19
+ ::Avm::Instances::Application.new(path.basename)
20
+ end
21
+
22
+ def instance_uncached
23
+ ::Avm::Instances::Base.new(application, DEFAULT_INSTANCE_SUFFIX)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ 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.14.0'
4
+ VERSION = '0.17.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.14.0
4
+ version: 0.17.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: 2021-12-21 00:00:00.000000000 Z
11
+ date: 2022-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_cli
@@ -219,6 +219,10 @@ files:
219
219
  - lib/avm/jobs.rb
220
220
  - lib/avm/jobs/base.rb
221
221
  - lib/avm/jobs/variables_source.rb
222
+ - lib/avm/launcher/errors/base.rb
223
+ - lib/avm/launcher/errors/non_project.rb
224
+ - lib/avm/launcher/paths/real.rb
225
+ - lib/avm/launcher/publish/check_result.rb
222
226
  - lib/avm/path_string.rb
223
227
  - lib/avm/registry.rb
224
228
  - lib/avm/registry/base.rb
@@ -237,6 +241,7 @@ files:
237
241
  - lib/avm/sources.rb
238
242
  - lib/avm/sources/base.rb
239
243
  - lib/avm/sources/base/configuration.rb
244
+ - lib/avm/sources/base/instance.rb
240
245
  - lib/avm/sources/base/testing.rb
241
246
  - lib/avm/sources/configuration.rb
242
247
  - lib/avm/sources/configuration/_locale.rb