eac_tools 0.77.1 → 0.79.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +38 -29
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm/avm.gemspec +3 -3
- data/sub/avm/lib/avm/application_scms/base.rb +28 -0
- data/sub/avm/lib/avm/application_scms.rb +9 -0
- data/sub/avm/lib/avm/applications/base/local_instance.rb +31 -0
- data/sub/avm/lib/avm/applications/base/local_source.rb +30 -0
- data/sub/avm/lib/avm/applications/base/naming.rb +28 -0
- data/sub/avm/lib/avm/applications/base/organization.rb +29 -0
- data/sub/avm/lib/avm/applications/base/scm.rb +27 -0
- data/sub/avm/lib/avm/applications/base.rb +9 -39
- data/sub/avm/lib/avm/entries/base/inherited_entry_value.rb +16 -1
- data/sub/avm/lib/avm/entries/base/uri_component_entry_value/default_value.rb +2 -1
- data/sub/avm/lib/avm/entries/base/uri_component_entry_value/inherited_value.rb +2 -1
- data/sub/avm/lib/avm/entries/base/uri_components_entries_values/generic_component.rb +4 -19
- data/sub/avm/lib/avm/instances/base/auto_values/database.rb +1 -0
- data/sub/avm/lib/avm/patches/eac_config/entry_path.rb +46 -0
- data/sub/avm/lib/avm/registry/application_scms.rb +15 -0
- data/sub/avm/lib/avm/registry.rb +3 -3
- data/sub/avm/lib/avm/rspec/shared_examples/entries_values.rb +2 -2
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/avm/spec/lib/avm/applications/base/entries_spec.rb +29 -0
- data/sub/avm/spec/lib/avm/applications/base/entries_spec_files/config.yml +11 -0
- data/sub/avm/spec/lib/avm/patches/eac_config/entry_path_spec.rb +28 -0
- data/sub/avm-eac_github_base0/Gemfile +8 -0
- data/sub/avm-eac_github_base0/avm-eac_github_base0.gemspec +21 -0
- data/sub/avm-eac_github_base0/lib/avm/eac_github_base0/api/entity.rb +24 -0
- data/sub/avm-eac_github_base0/lib/avm/eac_github_base0/api/organization.rb +19 -0
- data/sub/avm-eac_github_base0/lib/avm/eac_github_base0/api/repository.rb +14 -0
- data/sub/avm-eac_github_base0/lib/avm/eac_github_base0/api/root.rb +20 -0
- data/sub/avm-eac_github_base0/lib/avm/eac_github_base0/api.rb +18 -0
- data/sub/avm-eac_github_base0/lib/avm/eac_github_base0/application_scms/base.rb +13 -0
- data/sub/avm-eac_github_base0/lib/avm/eac_github_base0/application_scms.rb +11 -0
- data/sub/avm-eac_github_base0/lib/avm/eac_github_base0/version.rb +7 -0
- data/sub/avm-eac_github_base0/lib/avm/eac_github_base0.rb +9 -0
- data/sub/avm-eac_github_base0/spec/avm/eac_github_base0/application_scms/base_spec.rb +7 -0
- data/sub/avm-eac_github_base0/spec/rubocop_spec.rb +3 -0
- data/sub/avm-eac_github_base0/spec/spec_helper.rb +4 -0
- data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +2 -2
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/database.rb +2 -2
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/gitolite.rb +3 -1
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
- data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +1 -1
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update_dependency_requirements.rb +4 -1
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
- data/sub/avm-tools/avm-tools.gemspec +2 -2
- data/sub/avm-tools/lib/avm/tools/runner/application/info.rb +35 -0
- data/sub/avm-tools/lib/avm/tools/runner/application.rb +26 -0
- data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
- data/sub/eac_cli/lib/eac_cli/config/entry.rb +2 -1
- data/sub/eac_config/eac_config.gemspec +2 -2
- data/sub/eac_config/lib/eac_config/version.rb +1 -1
- metadata +60 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90311d99a8fde34e9e085138cecf3eb3eaec19cd6db5df22b900ca73a058a568
|
4
|
+
data.tar.gz: '082caa63292c671845f74e8a913054ad212894aa117ddc7d3f7cd2ff65885bdb'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 392a2ae0e2f9688a644ae606bd2b6e8c82e06a2aa0e9f30138972866f15f29dd045533b5ebd59303b2613ce43bebdfc3903535727a5e2f2b48c410c5a6b04168
|
7
|
+
data.tar.gz: 99306a1b0f26497d5bebb657c766c912acc347be451a23eea152c0e73f9f5b9e1fe31c39dc1eed32faebbeebf1df39f6cf47d86759b26c902222b217c1c5743c
|
data/Gemfile.lock
CHANGED
@@ -1,23 +1,24 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
eac_tools (0.
|
5
|
-
avm (~> 0.
|
4
|
+
eac_tools (0.79.0)
|
5
|
+
avm (~> 0.81)
|
6
6
|
avm-eac_asciidoctor_base0 (~> 0.19)
|
7
7
|
avm-eac_generic_base0 (~> 0.12, >= 0.12.1)
|
8
|
+
avm-eac_github_base0 (~> 0.2)
|
8
9
|
avm-eac_latex_base0 (~> 0.3, >= 0.3.1)
|
9
10
|
avm-eac_php_base0 (~> 0.4, >= 0.4.2)
|
10
11
|
avm-eac_postgresql_base0 (~> 0.5, >= 0.5.2)
|
11
12
|
avm-eac_python_base0 (~> 0.2, >= 0.2.1)
|
12
13
|
avm-eac_rails_base0 (~> 0.10, >= 0.10.3)
|
13
14
|
avm-eac_rails_base1 (~> 0.9, >= 0.9.3)
|
14
|
-
avm-eac_redmine_base0 (~> 0.21)
|
15
|
+
avm-eac_redmine_base0 (~> 0.21, >= 0.21.2)
|
15
16
|
avm-eac_redmine_plugin_base0 (~> 0.4)
|
16
|
-
avm-eac_ruby_base1 (~> 0.32)
|
17
|
+
avm-eac_ruby_base1 (~> 0.32, >= 0.32.1)
|
17
18
|
avm-eac_webapp_base0 (~> 0.18, >= 0.18.2)
|
18
19
|
avm-eac_wordpress_base0 (~> 0.3, >= 0.3.1)
|
19
20
|
avm-git (~> 0.13, >= 0.13.4)
|
20
|
-
avm-tools (~> 0.
|
21
|
+
avm-tools (~> 0.157)
|
21
22
|
eac_ruby_utils (~> 0.119, >= 0.119.2)
|
22
23
|
|
23
24
|
PATH
|
@@ -37,6 +38,14 @@ PATH
|
|
37
38
|
avm (~> 0.79)
|
38
39
|
eac_ruby_utils (~> 0.119, >= 0.119.2)
|
39
40
|
|
41
|
+
PATH
|
42
|
+
remote: sub/avm-eac_github_base0
|
43
|
+
specs:
|
44
|
+
avm-eac_github_base0 (0.2.0)
|
45
|
+
avm (~> 0.81)
|
46
|
+
eac_rest (~> 0.10)
|
47
|
+
eac_ruby_utils (~> 0.119, >= 0.119.2)
|
48
|
+
|
40
49
|
PATH
|
41
50
|
remote: sub/avm-eac_latex_base0
|
42
51
|
specs:
|
@@ -86,9 +95,9 @@ PATH
|
|
86
95
|
PATH
|
87
96
|
remote: sub/avm-eac_redmine_base0
|
88
97
|
specs:
|
89
|
-
avm-eac_redmine_base0 (0.21.
|
90
|
-
avm (~> 0.
|
91
|
-
avm-eac_generic_base0 (~> 0.12)
|
98
|
+
avm-eac_redmine_base0 (0.21.2)
|
99
|
+
avm (~> 0.81)
|
100
|
+
avm-eac_generic_base0 (~> 0.12, >= 0.12.1)
|
92
101
|
avm-eac_rails_base1 (~> 0.9, >= 0.9.3)
|
93
102
|
avm-eac_ubuntu_base0 (~> 0.5)
|
94
103
|
curb (~> 0.9, >= 0.9.11)
|
@@ -106,9 +115,9 @@ PATH
|
|
106
115
|
PATH
|
107
116
|
remote: sub/avm-eac_ruby_base1
|
108
117
|
specs:
|
109
|
-
avm-eac_ruby_base1 (0.32.
|
118
|
+
avm-eac_ruby_base1 (0.32.1)
|
110
119
|
aranha-parsers (~> 0.21)
|
111
|
-
avm (~> 0.
|
120
|
+
avm (~> 0.80)
|
112
121
|
avm-eac_generic_base0 (~> 0.12, >= 0.12.1)
|
113
122
|
eac_envs-http (~> 0.4, >= 0.4.1)
|
114
123
|
eac_ruby_utils (~> 0.119, >= 0.119.2)
|
@@ -163,10 +172,10 @@ PATH
|
|
163
172
|
PATH
|
164
173
|
remote: sub/avm-tools
|
165
174
|
specs:
|
166
|
-
avm-tools (0.
|
175
|
+
avm-tools (0.157.0)
|
167
176
|
aranha-parsers (~> 0.21)
|
168
|
-
avm (~> 0.
|
169
|
-
avm-eac_ruby_base1 (~> 0.
|
177
|
+
avm (~> 0.81)
|
178
|
+
avm-eac_ruby_base1 (~> 0.32, >= 0.32.1)
|
170
179
|
avm-eac_ubuntu_base0 (~> 0.5)
|
171
180
|
avm-files (~> 0.6, >= 0.6.2)
|
172
181
|
avm-git (~> 0.13, >= 0.13.4)
|
@@ -181,14 +190,14 @@ PATH
|
|
181
190
|
PATH
|
182
191
|
remote: sub/avm
|
183
192
|
specs:
|
184
|
-
avm (0.
|
193
|
+
avm (0.81.0)
|
185
194
|
aranha-parsers (~> 0.21)
|
186
|
-
eac_cli (~> 0.
|
187
|
-
eac_config (~> 0.14)
|
195
|
+
eac_cli (~> 0.38)
|
196
|
+
eac_config (~> 0.14, >= 0.14.1)
|
188
197
|
eac_docker (~> 0.7)
|
189
198
|
eac_fs (~> 0.16)
|
190
199
|
eac_git (~> 0.14, >= 0.14.1)
|
191
|
-
eac_ruby_utils (~> 0.119)
|
200
|
+
eac_ruby_utils (~> 0.119, >= 0.119.2)
|
192
201
|
eac_templates (~> 0.5)
|
193
202
|
filesize (~> 0.2)
|
194
203
|
htmlbeautifier (~> 1.4, >= 1.4.2)
|
@@ -205,9 +214,9 @@ PATH
|
|
205
214
|
PATH
|
206
215
|
remote: sub/eac_config
|
207
216
|
specs:
|
208
|
-
eac_config (0.14.
|
209
|
-
addressable (~> 2.8, >= 2.8.
|
210
|
-
eac_ruby_utils (~> 0.119)
|
217
|
+
eac_config (0.14.1)
|
218
|
+
addressable (~> 2.8, >= 2.8.5)
|
219
|
+
eac_ruby_utils (~> 0.119, >= 0.119.2)
|
211
220
|
|
212
221
|
PATH
|
213
222
|
remote: sub/eac_git
|
@@ -268,10 +277,10 @@ GEM
|
|
268
277
|
eac_cli (~> 0.35)
|
269
278
|
eac_fs (~> 0.16)
|
270
279
|
eac_ruby_utils (~> 0.117)
|
271
|
-
eac_ruby_gem_support (0.8.
|
280
|
+
eac_ruby_gem_support (0.8.2)
|
272
281
|
eac_ruby_utils (~> 0.119, >= 0.119.2)
|
273
282
|
rspec (~> 3.12)
|
274
|
-
rubocop (~> 1.
|
283
|
+
rubocop (~> 1.57, >= 1.57.1)
|
275
284
|
rubocop-rails (~> 2.21, >= 2.21.2)
|
276
285
|
rubocop-rspec (~> 2.24, >= 2.24.1)
|
277
286
|
eac_ruby_utils (0.119.2)
|
@@ -343,8 +352,7 @@ GEM
|
|
343
352
|
diff-lcs (>= 1.2.0, < 2.0)
|
344
353
|
rspec-support (~> 3.12.0)
|
345
354
|
rspec-support (3.12.1)
|
346
|
-
rubocop (1.57.
|
347
|
-
base64 (~> 0.1.1)
|
355
|
+
rubocop (1.57.2)
|
348
356
|
json (~> 2.3)
|
349
357
|
language_server-protocol (>= 3.17.0)
|
350
358
|
parallel (~> 1.10)
|
@@ -355,18 +363,18 @@ GEM
|
|
355
363
|
rubocop-ast (>= 1.28.1, < 2.0)
|
356
364
|
ruby-progressbar (~> 1.7)
|
357
365
|
unicode-display_width (>= 2.4.0, < 3.0)
|
358
|
-
rubocop-ast (1.
|
366
|
+
rubocop-ast (1.30.0)
|
359
367
|
parser (>= 3.2.1.0)
|
360
368
|
rubocop-capybara (2.19.0)
|
361
369
|
rubocop (~> 1.41)
|
362
370
|
rubocop-factory_bot (2.24.0)
|
363
371
|
rubocop (~> 1.33)
|
364
|
-
rubocop-rails (2.
|
372
|
+
rubocop-rails (2.22.1)
|
365
373
|
activesupport (>= 4.2.0)
|
366
374
|
rack (>= 1.1)
|
367
375
|
rubocop (>= 1.33.0, < 2.0)
|
368
|
-
rubocop-rspec (2.
|
369
|
-
rubocop (~> 1.
|
376
|
+
rubocop-rspec (2.25.0)
|
377
|
+
rubocop (~> 1.40)
|
370
378
|
rubocop-capybara (~> 2.17)
|
371
379
|
rubocop-factory_bot (~> 2.22)
|
372
380
|
ruby-filemagic (0.7.3)
|
@@ -385,6 +393,7 @@ DEPENDENCIES
|
|
385
393
|
avm!
|
386
394
|
avm-eac_asciidoctor_base0!
|
387
395
|
avm-eac_generic_base0!
|
396
|
+
avm-eac_github_base0!
|
388
397
|
avm-eac_latex_base0!
|
389
398
|
avm-eac_php_base0!
|
390
399
|
avm-eac_postgresql_base0!
|
@@ -407,4 +416,4 @@ DEPENDENCIES
|
|
407
416
|
eac_tools!
|
408
417
|
|
409
418
|
BUNDLED WITH
|
410
|
-
2.
|
419
|
+
2.4.19
|
data/lib/eac_tools/version.rb
CHANGED
data/sub/avm/avm.gemspec
CHANGED
@@ -13,12 +13,12 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.files = Dir['{lib}/**/*']
|
14
14
|
|
15
15
|
s.add_dependency 'aranha-parsers', '~> 0.21'
|
16
|
-
s.add_dependency 'eac_cli', '~> 0.
|
17
|
-
s.add_dependency 'eac_config', '~> 0.14'
|
16
|
+
s.add_dependency 'eac_cli', '~> 0.38'
|
17
|
+
s.add_dependency 'eac_config', '~> 0.14', '>= 0.14.1'
|
18
18
|
s.add_dependency 'eac_docker', '~> 0.7'
|
19
19
|
s.add_dependency 'eac_fs', '~> 0.16'
|
20
20
|
s.add_dependency 'eac_git', '~> 0.14', '>= 0.14.1'
|
21
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.119'
|
21
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.119', '>= 0.119.2'
|
22
22
|
s.add_dependency 'eac_templates', '~> 0.5'
|
23
23
|
s.add_dependency 'filesize', '~> 0.2'
|
24
24
|
s.add_dependency 'htmlbeautifier', '~> 1.4', '>= 1.4.2'
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module ApplicationScms
|
7
|
+
class Base
|
8
|
+
class << self
|
9
|
+
# @return [String]
|
10
|
+
def type_name
|
11
|
+
name.gsub(/#{Regexp.quote('::ApplicationScms::Base')}$/, '').demodulize
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# !method initialize(url)
|
16
|
+
# @param url [Addressable::URI]
|
17
|
+
common_constructor :url do
|
18
|
+
self.url = url.to_uri
|
19
|
+
end
|
20
|
+
delegate :type_name, to: :class
|
21
|
+
|
22
|
+
# @return [String]
|
23
|
+
def to_s
|
24
|
+
"#{type_name}[#{url}]"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/instances/ids'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Applications
|
8
|
+
class Base
|
9
|
+
module LocalInstance
|
10
|
+
LOCAL_INSTANCE_SUFFIX = 'dev'
|
11
|
+
|
12
|
+
# @return [String]
|
13
|
+
def local_instance_id
|
14
|
+
::Avm::Instances::Ids.build(id, local_instance_suffix)
|
15
|
+
end
|
16
|
+
|
17
|
+
# @return [String]
|
18
|
+
def local_instance_suffix
|
19
|
+
LOCAL_INSTANCE_SUFFIX
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
# @return [Avm::Instances::Base]
|
25
|
+
def local_instance_uncached
|
26
|
+
instance(local_instance_suffix)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/registry'
|
4
|
+
require 'eac_config/node'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module Applications
|
9
|
+
class Base
|
10
|
+
module LocalSource
|
11
|
+
# @return [Pathname]
|
12
|
+
def local_source_path
|
13
|
+
local_source_path_entry.value!.to_pathname
|
14
|
+
end
|
15
|
+
|
16
|
+
# @return [EacConfig::Entry]
|
17
|
+
def local_source_path_entry
|
18
|
+
::EacConfig::Node.context.current.entry([local_instance_id, 'install', 'path'])
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
# @return [Avm::Sources::Base]
|
24
|
+
def local_source_uncached
|
25
|
+
::Avm::Registry.sources.detect(local_source_path)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Applications
|
7
|
+
class Base
|
8
|
+
module Naming
|
9
|
+
DEFAULT_NAME = '_Undefined_'
|
10
|
+
|
11
|
+
# @return [String]
|
12
|
+
def default_name
|
13
|
+
DEFAULT_NAME
|
14
|
+
end
|
15
|
+
|
16
|
+
# @return [String]
|
17
|
+
def name
|
18
|
+
name_from_configuration || default_name
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [String]
|
22
|
+
def name_from_configuration
|
23
|
+
entry(::Avm::Instances::EntryKeys::NAME).optional_value
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/registry'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Applications
|
7
|
+
class Base
|
8
|
+
module Organization
|
9
|
+
DEFAULT_ORGANIZATION = '_undefined_'
|
10
|
+
ORGANIZATION_CONFIG_KEY = 'organization'
|
11
|
+
|
12
|
+
# @return [String]
|
13
|
+
def default_organization
|
14
|
+
DEFAULT_ORGANIZATION
|
15
|
+
end
|
16
|
+
|
17
|
+
# @return [String, nil]
|
18
|
+
def organization_by_configuration
|
19
|
+
entry(ORGANIZATION_CONFIG_KEY).optional_value
|
20
|
+
end
|
21
|
+
|
22
|
+
# @return [String]
|
23
|
+
def organization
|
24
|
+
organization_by_configuration || default_organization
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/registry'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Applications
|
8
|
+
class Base
|
9
|
+
module Scm
|
10
|
+
common_concern do
|
11
|
+
uri_components_entries_values 'scm', %w[repos_path type]
|
12
|
+
end
|
13
|
+
|
14
|
+
# @return [Avm::ApplicationScms::Base]
|
15
|
+
def scm
|
16
|
+
@scm ||= ::Avm::Registry.application_scms.detect(scm_type, scm_url)
|
17
|
+
end
|
18
|
+
|
19
|
+
# @param value [String]
|
20
|
+
# @return [String]
|
21
|
+
def scm_repos_path_inherited_value_proc(value)
|
22
|
+
value.to_pathname.join(id).to_path
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -1,19 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/entries/base'
|
4
|
-
require 'avm/instances/ids'
|
5
|
-
require 'avm/registry'
|
6
4
|
require 'eac_ruby_utils/core_ext'
|
7
5
|
|
8
6
|
module Avm
|
9
7
|
module Applications
|
10
8
|
class Base
|
11
9
|
enable_simple_cache
|
12
|
-
require_sub __FILE__, include_modules: true
|
13
10
|
include ::Avm::Entries::Base
|
14
11
|
|
15
12
|
AVM_TYPE = 'Application'
|
16
|
-
|
13
|
+
|
14
|
+
class << self
|
15
|
+
# @param id [String]
|
16
|
+
# @return [Avm::Applications::Base]
|
17
|
+
def by_id(id)
|
18
|
+
new(id)
|
19
|
+
end
|
20
|
+
end
|
17
21
|
|
18
22
|
common_constructor :id do
|
19
23
|
self.id = id.to_s
|
@@ -27,41 +31,7 @@ module Avm
|
|
27
31
|
stereotype.instance_class.new(self, suffix)
|
28
32
|
end
|
29
33
|
|
30
|
-
|
31
|
-
entry(::Avm::Instances::EntryKeys::NAME).read
|
32
|
-
end
|
33
|
-
|
34
|
-
# @return [String]
|
35
|
-
def local_instance_id
|
36
|
-
::Avm::Instances::Ids.build(id, local_instance_suffix)
|
37
|
-
end
|
38
|
-
|
39
|
-
# @return [Pathname]
|
40
|
-
def local_source_path
|
41
|
-
local_source_path_entry.value!.to_pathname
|
42
|
-
end
|
43
|
-
|
44
|
-
# @return [EacConfig::Entry]
|
45
|
-
def local_source_path_entry
|
46
|
-
::EacConfig::Node.context.current.entry([local_instance_id, 'install', 'path'])
|
47
|
-
end
|
48
|
-
|
49
|
-
# @return [String]
|
50
|
-
def local_instance_suffix
|
51
|
-
LOCAL_INSTANCE_SUFFIX
|
52
|
-
end
|
53
|
-
|
54
|
-
private
|
55
|
-
|
56
|
-
# @return [Avm::Instances::Base]
|
57
|
-
def local_instance_uncached
|
58
|
-
instance(local_instance_suffix)
|
59
|
-
end
|
60
|
-
|
61
|
-
# @return [Avm::Sources::Base]
|
62
|
-
def local_source_uncached
|
63
|
-
::Avm::Registry.sources.detect(local_source_path)
|
64
|
-
end
|
34
|
+
require_sub __FILE__, include_modules: true
|
65
35
|
end
|
66
36
|
end
|
67
37
|
end
|
@@ -18,8 +18,23 @@ module Avm
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
+
# @param provider_id [String]
|
22
|
+
# @return [Avm::Entries::Base]
|
23
|
+
def other_entries_provider(provider_id)
|
24
|
+
other_entries_provider_class.by_id(provider_id)
|
25
|
+
end
|
26
|
+
|
27
|
+
# @return [Class]
|
28
|
+
def other_entries_provider_class
|
29
|
+
[::Avm::Instances::Base, ::Avm::Applications::Base].each do |klass|
|
30
|
+
return klass if entries_provider.is_a?(klass)
|
31
|
+
end
|
32
|
+
|
33
|
+
raise "No provider class found for \"#{entries_provider}\""
|
34
|
+
end
|
35
|
+
|
21
36
|
def other_entry_value(instance_id)
|
22
|
-
|
37
|
+
other_entries_provider(instance_id).read_entry_optional(target_entry_suffix)
|
23
38
|
end
|
24
39
|
|
25
40
|
def self_entry_value
|
@@ -13,8 +13,9 @@ module Avm
|
|
13
13
|
common_constructor :uri_component_entry_value
|
14
14
|
delegate :component_entry_path, :entries_provider, to: :uri_component_entry_value
|
15
15
|
|
16
|
+
# @return [Symbol]
|
16
17
|
def default_value_method_name
|
17
|
-
|
18
|
+
component_entry_path.default_method_name
|
18
19
|
end
|
19
20
|
|
20
21
|
def result
|
@@ -28,8 +28,9 @@ module Avm
|
|
28
28
|
->(value) { entries_provider.send(inherited_value_block_method_name, value) }
|
29
29
|
end
|
30
30
|
|
31
|
+
# @return [Symbol]
|
31
32
|
def inherited_value_block_method_name
|
32
|
-
|
33
|
+
component_entry_path.inherited_block_method_name
|
33
34
|
end
|
34
35
|
end
|
35
36
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/entries/uri_builder'
|
4
|
+
require 'avm/patches/eac_config/entry_path'
|
4
5
|
require 'eac_ruby_utils/core_ext'
|
5
6
|
|
6
7
|
module Avm
|
@@ -10,14 +11,8 @@ module Avm
|
|
10
11
|
class GenericComponent
|
11
12
|
common_constructor :owner, :component
|
12
13
|
delegate :entries_provider_class, :prefix, to: :owner
|
13
|
-
|
14
|
-
|
15
|
-
['auto', component_method_name].join('_')
|
16
|
-
end
|
17
|
-
|
18
|
-
def component_method_name
|
19
|
-
[prefix, component].join('_')
|
20
|
-
end
|
14
|
+
delegate :auto_method_name, :get_method_name, :get_optional_method_name,
|
15
|
+
to: :entry_key_path
|
21
16
|
|
22
17
|
def define_auto_method
|
23
18
|
outer_self = self
|
@@ -48,22 +43,12 @@ module Avm
|
|
48
43
|
::EacConfig::EntryPath.assert([prefix, component])
|
49
44
|
end
|
50
45
|
|
51
|
-
# @return [String]
|
52
|
-
def get_method_name # rubocop:disable Naming/AccessorMethodName
|
53
|
-
component_method_name
|
54
|
-
end
|
55
|
-
|
56
|
-
# @return [String]
|
57
|
-
def get_optional_method_name # rubocop:disable Naming/AccessorMethodName
|
58
|
-
get_method_name + '_optional'
|
59
|
-
end
|
60
|
-
|
61
46
|
def id_component
|
62
47
|
@id_component ||= owner.component_factory('id')
|
63
48
|
end
|
64
49
|
|
65
50
|
def inherited_value_proc_name
|
66
|
-
|
51
|
+
entry_key_path.inherited_block_method_name
|
67
52
|
end
|
68
53
|
|
69
54
|
def setup
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_config/entry_path'
|
4
|
+
|
5
|
+
module EacConfig
|
6
|
+
class EntryPath
|
7
|
+
# @return [Symbol]
|
8
|
+
def auto_method_name
|
9
|
+
method_name('auto_', '')
|
10
|
+
end
|
11
|
+
|
12
|
+
# @return [Symbol]
|
13
|
+
def default_method_name
|
14
|
+
method_name('', '_default_value')
|
15
|
+
end
|
16
|
+
|
17
|
+
# @return [Symbol]
|
18
|
+
def get_method_name # rubocop:disable Naming/AccessorMethodName
|
19
|
+
method_name('', '')
|
20
|
+
end
|
21
|
+
|
22
|
+
# @return [Symbol]
|
23
|
+
def get_optional_method_name # rubocop:disable Naming/AccessorMethodName
|
24
|
+
method_name('', '_optional')
|
25
|
+
end
|
26
|
+
|
27
|
+
# @return [Symbol]
|
28
|
+
def inherited_block_method_name
|
29
|
+
method_name('', '_inherited_value_proc')
|
30
|
+
end
|
31
|
+
|
32
|
+
# @return [String]
|
33
|
+
def variableize
|
34
|
+
parts.join('_')
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
# @param before [String]
|
40
|
+
# @param after [String]
|
41
|
+
# @return [Symbol]
|
42
|
+
def method_name(before, after)
|
43
|
+
"#{before}#{variableize}#{after}".to_sym
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/registry/from_gems'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Registry
|
7
|
+
class ApplicationScms < ::Avm::Registry::FromGems
|
8
|
+
def class_detect(klass, detect_args)
|
9
|
+
return nil unless klass.type_name == detect_args[0]
|
10
|
+
|
11
|
+
klass.new(*detect_args[1..-1])
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/sub/avm/lib/avm/registry.rb
CHANGED
@@ -7,9 +7,9 @@ module Avm
|
|
7
7
|
module Registry
|
8
8
|
require_sub __FILE__
|
9
9
|
enable_listable
|
10
|
-
lists.add_symbol :category, :applications, :
|
11
|
-
:file_formats, :instances, :launcher_stereotypes, :runners,
|
12
|
-
:source_generators, :sources
|
10
|
+
lists.add_symbol :category, :applications, :application_scms, :application_stereotypes,
|
11
|
+
:config_objects, :file_formats, :instances, :launcher_stereotypes, :runners,
|
12
|
+
:scms, :source_generators, :sources
|
13
13
|
|
14
14
|
class << self
|
15
15
|
enable_simple_cache
|
@@ -13,8 +13,8 @@ require 'eac_ruby_utils/core_ext'
|
|
13
13
|
context "when a auto value is requested for \"#{instance_id}.#{input}\"" do
|
14
14
|
let(:instance) { described_class.by_id(instance_id) }
|
15
15
|
|
16
|
-
it ".
|
17
|
-
expect(instance.
|
16
|
+
it ".entry('#{input}').value should return \"#{expected}\"" do
|
17
|
+
expect(instance.entry(input).value).to eq(expected)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
data/sub/avm/lib/avm/version.rb
CHANGED