avm 0.35.0 → 0.37.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: 8d1057f254c35e9a58a3e175d41bc3269a1870a436ae6f9c4906d1f0c1235e74
4
- data.tar.gz: 4954952889777c08c9b0af69cf1c10b151e998b54a866c080960558cef5c83cb
3
+ metadata.gz: '0821a30efc137201d1e73d98cf31b741458bacc8a297495e1d88a6a150d988d3'
4
+ data.tar.gz: da4de9f1f24f9638ee5158411a05494c5007ffad292f26c3f19a4c5665389b1c
5
5
  SHA512:
6
- metadata.gz: f5e770babac5244337114c9c9a537d1d9d8e589d64850feced6f699d12b789b82a7281e878a115dbc83476b60a22f27badd800cd73045bf8fa9af3f855c88cd5
7
- data.tar.gz: 411a518bf695992eb94aac4c5765f553bc2355f44bac229712809a33eb9ceb87c36247feb9f832928b8e40516d3d6f4a2b153989965f1ff48837543919dbc30b
6
+ metadata.gz: afad52fb0a1801a83d5d295b9e220d7040a8ed09205d9fafd783393abc08bafe750a882e4ce4a28c6bbb5d23d3039a97e843818ef6e75437f4f7b5b5d87f1458
7
+ data.tar.gz: b450f642ef1c8692264dd21d60195f669a1d58291cff3256f3c379b5f529bdd589b8b66537f10e19acafa796ec1eb0e4600bb788e31ca6e3712392534dd32b00
@@ -53,7 +53,7 @@ module Avm
53
53
  def host_env_uncached
54
54
  install_uri = entry(::Avm::Instances::EntryKeys::INSTALL_URL).value.to_uri
55
55
  case install_uri.scheme
56
- when 'local' then ::EacRubyUtils::Envs.local
56
+ when 'file' then ::EacRubyUtils::Envs.local
57
57
  when 'ssh' then ::EacRubyUtils::Envs.ssh(install_uri)
58
58
  else raise("Unmapped access value: \"#{install_uri}\"")
59
59
  end
@@ -7,10 +7,12 @@ module Avm
7
7
  module Instances
8
8
  class Runner < ::Avm::Runners::Base
9
9
  class << self
10
- def instance_class
11
- ::Avm.const_get(stereotype_name).const_get('Instance')
10
+ def application_stereotype
11
+ ::Avm::Registry.application_stereotypes.detect(stereotype_name)
12
12
  end
13
13
 
14
+ delegate :instance_class, to: :application_stereotype
15
+
14
16
  def stereotype_module
15
17
  ::Avm.const_get(stereotype_name)
16
18
  end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/applications/base'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module Sources
8
+ class Base
9
+ module Application
10
+ APPLICATION_NAME_KEY = 'application'
11
+
12
+ # @return [Avm::Applications::Base]
13
+ def application
14
+ @application ||= ::Avm::Applications::Base.new(application_id)
15
+ end
16
+
17
+ # @return [String]
18
+ def application_id
19
+ application_id_by_configuration || application_id_by_directory
20
+ end
21
+
22
+ # @return [String, nil]
23
+ def application_id_by_configuration
24
+ configuration.entry(APPLICATION_NAME_KEY).value
25
+ end
26
+
27
+ # @return [String]
28
+ def application_id_by_directory
29
+ path.basename.to_path
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -24,6 +24,8 @@ module Avm
24
24
 
25
25
  # @return [EacRubyUtils::Envs::Command, nil]
26
26
  def configuration_value_to_env_command(value)
27
+ return value if value.is_a?(::EacRubyUtils::Envs::Command)
28
+
27
29
  configuration_value_to_shell_words(value).if_present { |v| env.command(v).chdir(path) }
28
30
  end
29
31
 
@@ -57,7 +57,7 @@ module Avm
57
57
 
58
58
  def configured_enumerable_value_as_test_commands(value)
59
59
  configured_hash_value_as_test_commands(
60
- value.each_with_index.map { |v| ["test_#{v[1]}", v[0]] }.to_h
60
+ value.each_with_index.map { |v, i| ["test_#{i}", v] }.to_h
61
61
  )
62
62
  end
63
63
 
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.35.0'
4
+ VERSION = '0.37.0'
5
5
  end
@@ -5,9 +5,7 @@ require 'eac_ruby_utils/core_ext'
5
5
  module Avm
6
6
  module With
7
7
  module ApplicationStereotype
8
- common_concern do
9
- include ClassMethods
10
- end
8
+ common_concern
11
9
 
12
10
  module ClassMethods
13
11
  # @return [Avm::ApplicationStereotype::Base]
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.35.0
4
+ version: 0.37.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: 2022-08-06 00:00:00.000000000 Z
11
+ date: 2022-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_cli
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '0.27'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 0.27.6
22
+ version: 0.27.8
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '0.27'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 0.27.6
32
+ version: 0.27.8
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: eac_config
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -50,62 +50,74 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.3'
53
+ version: '0.4'
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 0.4.2
54
57
  type: :runtime
55
58
  prerelease: false
56
59
  version_requirements: !ruby/object:Gem::Requirement
57
60
  requirements:
58
61
  - - "~>"
59
62
  - !ruby/object:Gem::Version
60
- version: '0.3'
63
+ version: '0.4'
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 0.4.2
61
67
  - !ruby/object:Gem::Dependency
62
68
  name: eac_git
63
69
  requirement: !ruby/object:Gem::Requirement
64
70
  requirements:
65
71
  - - "~>"
66
72
  - !ruby/object:Gem::Version
67
- version: '0.6'
73
+ version: '0.12'
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: 0.12.1
68
77
  type: :runtime
69
78
  prerelease: false
70
79
  version_requirements: !ruby/object:Gem::Requirement
71
80
  requirements:
72
81
  - - "~>"
73
82
  - !ruby/object:Gem::Version
74
- version: '0.6'
83
+ version: '0.12'
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: 0.12.1
75
87
  - !ruby/object:Gem::Dependency
76
88
  name: eac_ruby_utils
77
89
  requirement: !ruby/object:Gem::Requirement
78
90
  requirements:
79
91
  - - "~>"
80
92
  - !ruby/object:Gem::Version
81
- version: '0.97'
93
+ version: '0.98'
82
94
  type: :runtime
83
95
  prerelease: false
84
96
  version_requirements: !ruby/object:Gem::Requirement
85
97
  requirements:
86
98
  - - "~>"
87
99
  - !ruby/object:Gem::Version
88
- version: '0.97'
100
+ version: '0.98'
89
101
  - !ruby/object:Gem::Dependency
90
102
  name: eac_templates
91
103
  requirement: !ruby/object:Gem::Requirement
92
104
  requirements:
93
105
  - - "~>"
94
106
  - !ruby/object:Gem::Version
95
- version: '0.1'
107
+ version: '0.3'
96
108
  - - ">="
97
109
  - !ruby/object:Gem::Version
98
- version: 0.1.1
110
+ version: 0.3.1
99
111
  type: :runtime
100
112
  prerelease: false
101
113
  version_requirements: !ruby/object:Gem::Requirement
102
114
  requirements:
103
115
  - - "~>"
104
116
  - !ruby/object:Gem::Version
105
- version: '0.1'
117
+ version: '0.3'
106
118
  - - ">="
107
119
  - !ruby/object:Gem::Version
108
- version: 0.1.1
120
+ version: 0.3.1
109
121
  - !ruby/object:Gem::Dependency
110
122
  name: filesize
111
123
  requirement: !ruby/object:Gem::Requirement
@@ -126,20 +138,20 @@ dependencies:
126
138
  requirements:
127
139
  - - "~>"
128
140
  - !ruby/object:Gem::Version
129
- version: '1.3'
141
+ version: '1.4'
130
142
  - - ">="
131
143
  - !ruby/object:Gem::Version
132
- version: 1.3.1
144
+ version: 1.4.2
133
145
  type: :runtime
134
146
  prerelease: false
135
147
  version_requirements: !ruby/object:Gem::Requirement
136
148
  requirements:
137
149
  - - "~>"
138
150
  - !ruby/object:Gem::Version
139
- version: '1.3'
151
+ version: '1.4'
140
152
  - - ">="
141
153
  - !ruby/object:Gem::Version
142
- version: 1.3.1
154
+ version: 1.4.2
143
155
  - !ruby/object:Gem::Dependency
144
156
  name: minitar
145
157
  requirement: !ruby/object:Gem::Requirement
@@ -278,6 +290,7 @@ files:
278
290
  - lib/avm/source_generators/runner.rb
279
291
  - lib/avm/sources.rb
280
292
  - lib/avm/sources/base.rb
293
+ - lib/avm/sources/base/application.rb
281
294
  - lib/avm/sources/base/configuration.rb
282
295
  - lib/avm/sources/base/instance.rb
283
296
  - lib/avm/sources/base/locale.rb