eac_tools 0.78.0 → 0.80.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +40 -31
  3. data/lib/eac_tools/version.rb +1 -1
  4. data/sub/avm/lib/avm/application_scms/base.rb +28 -0
  5. data/sub/avm/lib/avm/application_scms.rb +9 -0
  6. data/sub/avm/lib/avm/applications/base/scm.rb +27 -0
  7. data/sub/avm/lib/avm/applications/base.rb +10 -1
  8. data/sub/avm/lib/avm/entries/base/inherited_entry_value.rb +16 -1
  9. data/sub/avm/lib/avm/entries/base/uri_component_entry_value/default_value.rb +2 -1
  10. data/sub/avm/lib/avm/entries/base/uri_component_entry_value/inherited_value.rb +2 -1
  11. data/sub/avm/lib/avm/entries/base/uri_components_entries_values/generic_component.rb +4 -19
  12. data/sub/avm/lib/avm/patches/eac_config/entry_path.rb +46 -0
  13. data/sub/avm/lib/avm/registry/application_scms.rb +15 -0
  14. data/sub/avm/lib/avm/registry.rb +3 -3
  15. data/sub/avm/lib/avm/rspec/shared_examples/entries_values.rb +2 -2
  16. data/sub/avm/lib/avm/version.rb +1 -1
  17. data/sub/avm/spec/lib/avm/applications/base/entries_spec.rb +29 -0
  18. data/sub/avm/spec/lib/avm/applications/base/entries_spec_files/config.yml +11 -0
  19. data/sub/avm/spec/lib/avm/patches/eac_config/entry_path_spec.rb +28 -0
  20. data/sub/avm-eac_github_base0/Gemfile +8 -0
  21. data/sub/avm-eac_github_base0/avm-eac_github_base0.gemspec +21 -0
  22. data/sub/avm-eac_github_base0/lib/avm/eac_github_base0/api/entity.rb +24 -0
  23. data/sub/avm-eac_github_base0/lib/avm/eac_github_base0/api/organization.rb +19 -0
  24. data/sub/avm-eac_github_base0/lib/avm/eac_github_base0/api/repository.rb +14 -0
  25. data/sub/avm-eac_github_base0/lib/avm/eac_github_base0/api/root.rb +20 -0
  26. data/sub/avm-eac_github_base0/lib/avm/eac_github_base0/api.rb +18 -0
  27. data/sub/avm-eac_github_base0/lib/avm/eac_github_base0/application_scms/base.rb +13 -0
  28. data/sub/avm-eac_github_base0/lib/avm/eac_github_base0/application_scms.rb +11 -0
  29. data/sub/avm-eac_github_base0/lib/avm/eac_github_base0/version.rb +7 -0
  30. data/sub/avm-eac_github_base0/lib/avm/eac_github_base0.rb +9 -0
  31. data/sub/avm-eac_github_base0/spec/avm/eac_github_base0/application_scms/base_spec.rb +7 -0
  32. data/sub/avm-eac_github_base0/spec/rubocop_spec.rb +3 -0
  33. data/sub/avm-eac_github_base0/spec/spec_helper.rb +4 -0
  34. data/sub/avm-eac_rails_base0/Gemfile +2 -2
  35. data/sub/avm-eac_rails_base0/avm-eac_rails_base0.gemspec +4 -3
  36. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/instances/deploy.rb +2 -2
  37. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/version.rb +1 -1
  38. data/sub/avm-eac_rails_base0/spec/lib/avm/eac_rails_base0/instances/apache_host_spec.rb +3 -3
  39. data/sub/avm-eac_rails_base0/spec/lib/avm/eac_rails_base0/instances/apache_path_spec.rb +4 -4
  40. data/sub/avm-eac_rails_base0/spec/rubocop_spec.rb +1 -1
  41. data/sub/avm-eac_rails_base0/spec/spec_helper.rb +2 -2
  42. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config/application.rb +1 -1
  43. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config/puma.rb +4 -4
  44. data/sub/avm-eac_rails_base1/Gemfile +2 -2
  45. data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +5 -4
  46. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/base.rb +5 -0
  47. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/deploy.rb +23 -0
  48. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/tasks_scheduler/systemd_unit.rb +1 -1
  49. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/rails_environment.rb +2 -2
  50. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
  51. data/sub/avm-eac_rails_base1/spec/rubocop_spec.rb +1 -1
  52. data/sub/avm-eac_rails_base1/spec/spec_helper.rb +1 -1
  53. data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +3 -3
  54. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/gitolite.rb +3 -1
  55. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/deploy.rb +2 -2
  56. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
  57. data/sub/avm-eac_ruby_base1/Gemfile +2 -2
  58. data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +3 -2
  59. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/launcher/gem/build.rb +2 -2
  60. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/launcher_stereotypes/base/publish.rb +1 -1
  61. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/gemfile.rb +2 -1
  62. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubygems/gemspec.rb +1 -1
  63. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/source_generators/base/options.rb +3 -3
  64. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/source_generators/base.rb +2 -2
  65. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/bundler.rb +9 -0
  66. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/namespace_replacer.rb +1 -1
  67. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners/bundler/gemfile_local.rb +3 -4
  68. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners/bundler/incompatible.rb +1 -1
  69. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/tests/multiple/decorated_gem.rb +2 -2
  70. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update_dependency_requirements.rb +1 -1
  71. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
  72. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/bundler/incompatible_parser_spec.rb +1 -1
  73. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/file_formats/base_spec.rb +1 -1
  74. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/file_formats/base_spec_files/Gemfile.target +0 -2
  75. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/file_formats/base_spec_files/ruby_code.rb.target +0 -2
  76. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb +9 -9
  77. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/specification_spec.rb +3 -3
  78. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher_stereotypes/base/publish_spec.rb +2 -2
  79. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher_stereotypes/base_spec.rb +3 -3
  80. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/preferred_version_requirements_spec.rb +1 -1
  81. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/rubygems/version_file_spec.rb +3 -3
  82. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/runners/base/rubocop_spec.rb +9 -9
  83. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/source_generators/base_spec.rb +1 -1
  84. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/source_generators/base_spec_files/dashed-mygem/dashed-mygem.gemspec +1 -0
  85. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/source_generators/base_spec_files/mygem/mygem.gemspec +1 -0
  86. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/sources/base/bundler_spec.rb +8 -2
  87. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/sources/base/bundler_spec_files/mygem/mygem.gemspec +1 -0
  88. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/sources/base_spec.rb +2 -2
  89. data/sub/avm-eac_ruby_base1/spec/rubocop_spec.rb +1 -1
  90. data/sub/avm-eac_ruby_base1/spec/spec_helper.rb +2 -2
  91. data/sub/avm-eac_ruby_base1/template/avm/eac_ruby_base1/source_generators/base/gemspec.template +1 -0
  92. data/sub/avm-tools/avm-tools.gemspec +1 -1
  93. data/sub/avm-tools/lib/avm/tools/runner/application/info.rb +2 -1
  94. data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
  95. metadata +51 -38
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e227d70bad6dcda0603a56c57f8114622444ff56a3ddf61ff742be65ba94992
4
- data.tar.gz: fce72f0ff11ad9c7cf4287351015bb8337a5b56af81d6edd386d13f821ff68ea
3
+ metadata.gz: 4c7d9d14e62f4976d146dd5a901953270551a16e154e5d08a7d525552848b706
4
+ data.tar.gz: 7b2f94a28c65415e62cd6983b4b501dfff63a67265010c8e54e12f690073b519
5
5
  SHA512:
6
- metadata.gz: 553f7235db1e49048bb2444554ed9f4a4c3cc2281a19ee054196f7bd4f6fbbc71951a4a87fe5a8bc09dc4b6b6165d59ffee2df92b70998e1d8f17fc84974eb52
7
- data.tar.gz: f1c8903587ee95c26bf744c95f9704c7ffb27f75391e26f83e95544377655b36714029bae0e0b5232c230ba35752748169e08855d1f020e99478f72f148dfe38
6
+ metadata.gz: 747cdfc35f0f0cfb9a2b783b857c41208b80a2e5b28683336b35258a34541b1ebf1bf90b201ce3eb1b71e97a16ba61008a0f19cbc73f8650c73cbd423fb4074d
7
+ data.tar.gz: 53c4d156592347bbf7143ee2b5a0dc860d7d93aa6b5fb40cf6faec55dd4e2d7a7f529a99c1539495d1ad50cbfa659bdd4ee4218edc004e45f9a0a5d5f39e5fbc
data/Gemfile.lock CHANGED
@@ -1,23 +1,24 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eac_tools (0.78.0)
5
- avm (~> 0.80)
4
+ eac_tools (0.80.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
- avm-eac_rails_base0 (~> 0.10, >= 0.10.3)
13
- avm-eac_rails_base1 (~> 0.9, >= 0.9.3)
14
- avm-eac_redmine_base0 (~> 0.21, >= 0.21.1)
13
+ avm-eac_rails_base0 (~> 0.11)
14
+ avm-eac_rails_base1 (~> 0.10)
15
+ avm-eac_redmine_base0 (~> 0.22)
15
16
  avm-eac_redmine_plugin_base0 (~> 0.4)
16
- avm-eac_ruby_base1 (~> 0.32, >= 0.32.1)
17
+ avm-eac_ruby_base1 (~> 0.33)
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.156)
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:
@@ -70,26 +79,26 @@ PATH
70
79
  PATH
71
80
  remote: sub/avm-eac_rails_base0
72
81
  specs:
73
- avm-eac_rails_base0 (0.10.3)
74
- avm-eac_rails_base1 (~> 0.9, >= 0.9.2)
75
- eac_ruby_utils (~> 0.119, >= 0.119.1)
82
+ avm-eac_rails_base0 (0.11.0)
83
+ avm-eac_rails_base1 (~> 0.10)
84
+ eac_ruby_utils (~> 0.119, >= 0.119.2)
76
85
 
77
86
  PATH
78
87
  remote: sub/avm-eac_rails_base1
79
88
  specs:
80
- avm-eac_rails_base1 (0.9.3)
81
- avm (~> 0.79)
82
- avm-eac_ruby_base1 (~> 0.31, >= 0.31.1)
89
+ avm-eac_rails_base1 (0.10.0)
90
+ avm (~> 0.81)
91
+ avm-eac_ruby_base1 (~> 0.33)
83
92
  avm-eac_webapp_base0 (~> 0.18, >= 0.18.2)
84
- eac_ruby_utils (~> 0.119, >= 0.119.1)
93
+ eac_ruby_utils (~> 0.119, >= 0.119.2)
85
94
 
86
95
  PATH
87
96
  remote: sub/avm-eac_redmine_base0
88
97
  specs:
89
- avm-eac_redmine_base0 (0.21.1)
90
- avm (~> 0.80)
98
+ avm-eac_redmine_base0 (0.22.0)
99
+ avm (~> 0.81)
91
100
  avm-eac_generic_base0 (~> 0.12, >= 0.12.1)
92
- avm-eac_rails_base1 (~> 0.9, >= 0.9.3)
101
+ avm-eac_rails_base1 (~> 0.10)
93
102
  avm-eac_ubuntu_base0 (~> 0.5)
94
103
  curb (~> 0.9, >= 0.9.11)
95
104
  eac_fs (~> 0.16)
@@ -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.1)
118
+ avm-eac_ruby_base1 (0.33.0)
110
119
  aranha-parsers (~> 0.21)
111
- avm (~> 0.80)
120
+ avm (~> 0.81)
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,9 +172,9 @@ PATH
163
172
  PATH
164
173
  remote: sub/avm-tools
165
174
  specs:
166
- avm-tools (0.156.0)
175
+ avm-tools (0.157.0)
167
176
  aranha-parsers (~> 0.21)
168
- avm (~> 0.80)
177
+ avm (~> 0.81)
169
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)
@@ -181,7 +190,7 @@ PATH
181
190
  PATH
182
191
  remote: sub/avm
183
192
  specs:
184
- avm (0.80.0)
193
+ avm (0.81.0)
185
194
  aranha-parsers (~> 0.21)
186
195
  eac_cli (~> 0.38)
187
196
  eac_config (~> 0.14, >= 0.14.1)
@@ -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.1)
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.56, >= 1.56.4)
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.1)
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.29.0)
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.21.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.24.1)
369
- rubocop (~> 1.33)
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.3.26
419
+ 2.4.19
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacTools
4
- VERSION = '0.78.0'
4
+ VERSION = '0.80.0'
5
5
  end
@@ -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,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module ApplicationScms
7
+ require_sub __FILE__
8
+ end
9
+ 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
@@ -7,11 +7,18 @@ module Avm
7
7
  module Applications
8
8
  class Base
9
9
  enable_simple_cache
10
- require_sub __FILE__, include_modules: true
11
10
  include ::Avm::Entries::Base
12
11
 
13
12
  AVM_TYPE = 'Application'
14
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
21
+
15
22
  common_constructor :id do
16
23
  self.id = id.to_s
17
24
  end
@@ -23,6 +30,8 @@ module Avm
23
30
  def instance(suffix)
24
31
  stereotype.instance_class.new(self, suffix)
25
32
  end
33
+
34
+ require_sub __FILE__, include_modules: true
26
35
  end
27
36
  end
28
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
- ::Avm::Instances::Base.by_id(instance_id).read_entry_optional(target_entry_suffix)
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
- "#{component_entry_path.parts.join('_').variableize}_default_value"
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
- "#{component_entry_path.parts.join('_').variableize}_inherited_value_proc".to_sym
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
- def auto_method_name
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
- [component_method_name, 'inherited_value_proc'].join('_')
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
@@ -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, :application_stereotypes, :config_objects,
11
- :file_formats, :instances, :launcher_stereotypes, :runners, :scms,
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 ".read_entry should return \"#{expected}\"" do
17
- expect(instance.read_entry(input)).to eq(expected)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avm
4
- VERSION = '0.80.0'
4
+ VERSION = '0.81.0'
5
5
  end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/applications/base'
4
+
5
+ RSpec.describe ::Avm::Applications::Base do
6
+ include_examples 'entries_values', __FILE__, {
7
+ 'app0' => {
8
+ 'name' => 'Application 0',
9
+ 'organization' => nil,
10
+ 'scm.id' => 'app1',
11
+ 'scm.type' => 'ScmX',
12
+ 'scm.url' => 'http://nowhere.net/anypath',
13
+ 'scm.repos_path' => 'mygroup/app0'
14
+ },
15
+ 'app1' => {
16
+ 'name' => nil,
17
+ 'organization' => 'org1',
18
+ 'scm.id' => nil,
19
+ 'scm.type' => 'ScmX',
20
+ 'scm.url' => 'http://nowhere.net/anypath',
21
+ 'scm.repos_path' => 'mygroup'
22
+ }
23
+ }
24
+
25
+ # @return [Avm::Entries::Base]
26
+ def build_instance(instance_id)
27
+ described_class.new(instance_id)
28
+ end
29
+ end
@@ -0,0 +1,11 @@
1
+ ---
2
+ app0:
3
+ name: Application 0
4
+ scm:
5
+ id: app1
6
+ app1:
7
+ organization: org1
8
+ scm:
9
+ url: http://nowhere.net/anypath
10
+ type: ScmX
11
+ repos_path: mygroup
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/patches/eac_config/entry_path'
4
+
5
+ ::RSpec.describe ::EacConfig::EntryPath do
6
+ {
7
+ 'install.path' => {
8
+ auto: 'auto_install_path',
9
+ default: 'install_path_default_value',
10
+ get: 'install_path',
11
+ get_optional: 'install_path_optional',
12
+ inherited_block: 'install_path_inherited_value_proc'
13
+ }
14
+ }.each do |instance_path, test_data|
15
+ context "when path is \"#{instance_path}\"" do
16
+ let(:instance) { described_class.assert(instance_path) }
17
+
18
+ test_data.each do |method_prefix, expected_value|
19
+ method_name = "#{method_prefix}_method_name"
20
+ context "when method name is \"#{method_name}\"" do
21
+ it do
22
+ expect(instance.send(method_name)).to eq(expected_value.to_sym)
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
6
+
7
+ local_gemfile = ::File.join(::File.dirname(__FILE__), 'Gemfile.local')
8
+ eval_gemfile local_gemfile if ::File.exist?(local_gemfile)
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.push File.expand_path('lib', __dir__)
4
+
5
+ require 'avm/eac_github_base0/version'
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = 'avm-eac_github_base0'
9
+ s.version = Avm::EacGithubBase0::VERSION
10
+ s.authors = ['Put here the authors']
11
+ s.summary = 'Put here de description.'
12
+
13
+ s.files = Dir['{lib}/**/*']
14
+ s.required_ruby_version = '>= 2.7'
15
+
16
+ s.add_dependency 'avm', '~> 0.81'
17
+ s.add_dependency 'eac_rest', '~> 0.10'
18
+ s.add_dependency 'eac_ruby_utils', '~> 0.119', '>= 0.119.2'
19
+
20
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.8', '>= 0.8.2'
21
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_rest/api'
4
+ require 'eac_rest/entity'
5
+ require 'eac_ruby_utils/core_ext'
6
+
7
+ module Avm
8
+ module EacGithubBase0
9
+ class Api < ::EacRest::Api
10
+ class Entity < ::EacRest::Entity
11
+ def all_from_list(entity_class, url_suffix)
12
+ r = []
13
+ while url_suffix.present?
14
+ response = api.request_json(url_suffix).response
15
+ r += response.body_data_or_raise
16
+ .map { |child_data| child_entity(entity_class, child_data) }
17
+ url_suffix = response.link('next')
18
+ end
19
+ r
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_github_base0/api/entity'
4
+ require 'avm/eac_github_base0/api/repository'
5
+ require 'eac_rest/api'
6
+ require 'eac_ruby_utils/core_ext'
7
+
8
+ module Avm
9
+ module EacGithubBase0
10
+ class Api < ::EacRest::Api
11
+ class Organization < ::Avm::EacGithubBase0::Api::Entity
12
+ # @return [Array<Avm::EacGithubBase0::Api::Repository>]
13
+ def repositories
14
+ all_from_list(::Avm::EacGithubBase0::Api::Repository, "/orgs/#{id}/repos")
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_github_base0/api/entity'
4
+ require 'eac_rest/api'
5
+ require 'eac_ruby_utils/core_ext'
6
+
7
+ module Avm
8
+ module EacGithubBase0
9
+ class Api < ::EacRest::Api
10
+ class Repository < ::Avm::EacGithubBase0::Api::Entity
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_github_base0/api/entity'
4
+ require 'avm/eac_github_base0/api/organization'
5
+ require 'eac_rest/api'
6
+ require 'eac_ruby_utils/core_ext'
7
+
8
+ module Avm
9
+ module EacGithubBase0
10
+ class Api < ::EacRest::Api
11
+ class Root < ::Avm::EacGithubBase0::Api::Entity
12
+ # @param id [String]
13
+ # @return [Avm::EacGithubBase0::Api::Organization]
14
+ def organization(id)
15
+ child_entity(::Avm::EacGithubBase0::Api::Organization, id)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end