avm 0.14.0 → 0.15.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 +4 -4
- data/lib/avm/launcher/errors/base.rb +10 -0
- data/lib/avm/launcher/errors/non_project.rb +15 -0
- data/lib/avm/launcher/paths/real.rb +44 -0
- data/lib/avm/launcher/publish/check_result.rb +67 -0
- data/lib/avm/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: af8b48e6c2b68eae42fc189f37800c24267c60d74dab16e65b271848d45f553e
|
|
4
|
+
data.tar.gz: 2cc8fa0683ba1133e61847ee85ac838bb30ec638972e2126df1ebd77d6368606
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6da4fd9d1296dae4e716d6da17ce53df86981dcade20a5df3e1aad9f044faeda2dd0287e39f680e393d78ed7a0a5b9de16a4e510ede5aa6ade061e86f036d815
|
|
7
|
+
data.tar.gz: 44ca2f513f2a86b30a5125fadcfe6a3d18877ad7ead72b97c4371f957abda401b07c7f2164a2f2e7fbf5f821219cd42b3f77394ce973dca0d5a5c07bcbd0f724
|
|
@@ -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
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.
|
|
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:
|
|
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
|