avm 0.14.0 → 0.15.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: af8b48e6c2b68eae42fc189f37800c24267c60d74dab16e65b271848d45f553e
4
+ data.tar.gz: 2cc8fa0683ba1133e61847ee85ac838bb30ec638972e2126df1ebd77d6368606
5
5
  SHA512:
6
- metadata.gz: e152406d787229dd1a56ff977fbcb4d50dac8667fb67360e323fc758420dbbd81efd37f5049dd1bbf8961aae93e6fa34ea865831dcdcbdd69f1e8d6a6e486749
7
- data.tar.gz: a3b25728a082f27ca49e85fb191e8334be93cc8919df3175cdbd7264066d598ddb2cc9dc0a016d52ac450ba6a3afb6c5890ab12972be7e54dc13a1dff8d192f0
6
+ metadata.gz: 6da4fd9d1296dae4e716d6da17ce53df86981dcade20a5df3e1aad9f044faeda2dd0287e39f680e393d78ed7a0a5b9de16a4e510ede5aa6ade061e86f036d815
7
+ data.tar.gz: 44ca2f513f2a86b30a5125fadcfe6a3d18877ad7ead72b97c4371f957abda401b07c7f2164a2f2e7fbf5f821219cd42b3f77394ce973dca0d5a5c07bcbd0f724
@@ -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
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.15.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.15.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-02-25 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