eac_tools 0.7.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +43 -31
  3. data/lib/eac_tools/version.rb +1 -1
  4. data/sub/avm/avm.gemspec +1 -0
  5. data/sub/avm/lib/avm/application_stereotypes/base/by_gem.rb +17 -0
  6. data/sub/avm/lib/avm/application_stereotypes/base/detection.rb +34 -0
  7. data/sub/avm/lib/avm/application_stereotypes/base.rb +21 -0
  8. data/sub/avm/lib/avm/application_stereotypes.rb +9 -0
  9. data/sub/avm/lib/avm/{instances/application.rb → applications/base.rb} +5 -6
  10. data/sub/avm/lib/avm/applications.rb +9 -0
  11. data/sub/avm/lib/avm/docker/image.rb +12 -2
  12. data/sub/avm/lib/avm/instances/base.rb +7 -2
  13. data/sub/avm/lib/avm/instances.rb +1 -1
  14. data/sub/avm/lib/avm/registry/application_stereotypes/build_available.rb +46 -0
  15. data/sub/avm/lib/avm/registry/application_stereotypes/stereotype_builder.rb +30 -0
  16. data/sub/avm/lib/avm/registry/application_stereotypes.rb +36 -0
  17. data/sub/avm/lib/avm/registry/{base.rb → from_gems.rb} +13 -4
  18. data/sub/avm/lib/avm/registry/instances.rb +16 -0
  19. data/sub/avm/lib/avm/registry/runners.rb +10 -0
  20. data/sub/avm/lib/avm/registry/scms.rb +10 -0
  21. data/sub/avm/lib/avm/registry/sources.rb +10 -0
  22. data/sub/avm/lib/avm/registry/with_path/cache.rb +31 -0
  23. data/sub/avm/lib/avm/registry/with_path.rb +33 -7
  24. data/sub/avm/lib/avm/registry.rb +3 -7
  25. data/sub/avm/lib/avm/rspec/shared_examples/not_in_avm_registry.rb +1 -1
  26. data/sub/avm/lib/avm/sources/base/configuration.rb +23 -2
  27. data/sub/avm/lib/avm/sources/base/instance.rb +2 -2
  28. data/sub/avm/lib/avm/sources/base/locale.rb +1 -1
  29. data/sub/avm/lib/avm/sources/base/parent.rb +8 -11
  30. data/sub/avm/lib/avm/sources/base/subs_paths.rb +1 -1
  31. data/sub/avm/lib/avm/sources/base/testing.rb +4 -4
  32. data/sub/avm/lib/avm/sources/base.rb +4 -0
  33. data/sub/avm/lib/avm/sources/tests/builder.rb +5 -10
  34. data/sub/avm/lib/avm/version.rb +1 -1
  35. data/sub/avm/lib/avm/with_application_stereotype.rb +23 -0
  36. data/sub/avm/lib/avm/with_dynamic_runners.rb +42 -0
  37. data/sub/{avm-tools/spec/lib/avm/instances/application_spec.rb → avm/spec/lib/avm/applications/base_spec.rb} +3 -3
  38. data/sub/{avm-tools/spec/lib/avm/instances/application_spec_fixture.yml → avm/spec/lib/avm/applications/base_spec_fixture.yml} +0 -0
  39. data/sub/{avm-tools → avm}/spec/lib/avm/instances/base_spec.rb +0 -0
  40. data/sub/{avm-tools → avm}/spec/lib/avm/instances/base_spec_configs_storage.yml +0 -0
  41. data/sub/avm-eac_generic_base0/avm-eac_generic_base0.gemspec +2 -2
  42. data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources/docker/runner.rb +61 -0
  43. data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources/docker.rb +13 -0
  44. data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/version.rb +1 -1
  45. data/sub/avm-eac_rails_base0/Gemfile +3 -0
  46. data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +1 -0
  47. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners/docker.rb +19 -0
  48. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
  49. data/sub/avm-eac_redmine_plugin_base0/avm-eac_redmine_plugin_base0.gemspec +1 -1
  50. data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base.rb +15 -4
  51. data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/version.rb +1 -1
  52. data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +1 -1
  53. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/bundler.rb +1 -1
  54. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/rake.rb +14 -0
  55. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
  56. data/sub/avm-tools/Gemfile +3 -0
  57. data/sub/avm-tools/avm-tools.gemspec +1 -1
  58. data/sub/avm-tools/lib/avm/tools/runner/app_src/info.rb +19 -0
  59. data/sub/avm-tools/lib/avm/tools/runner/application_stereotypes/list.rb +31 -0
  60. data/sub/avm-tools/lib/avm/tools/runner/application_stereotypes.rb +16 -0
  61. data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
  62. data/sub/eac_cli/Gemfile +3 -0
  63. data/sub/eac_cli/lib/eac_cli/version.rb +1 -1
  64. data/sub/eac_config/Gemfile +8 -0
  65. data/sub/{avm-tools/sub/eac_config → eac_config}/eac_config.gemspec +0 -0
  66. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/entry.rb +0 -0
  67. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/entry_path.rb +5 -0
  68. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/envvars_node/entry.rb +0 -0
  69. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/envvars_node.rb +0 -0
  70. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/load_nodes_search.rb +0 -0
  71. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/load_path.rb +0 -0
  72. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/node.rb +6 -0
  73. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/node_entry.rb +0 -0
  74. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/node_uri.rb +0 -0
  75. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/old_configs/base.rb +0 -0
  76. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/old_configs/file.rb +0 -0
  77. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/old_configs.rb +0 -0
  78. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/paths_hash/entry_key_error.rb +0 -0
  79. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/paths_hash/node.rb +0 -0
  80. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/paths_hash/path_search.rb +0 -0
  81. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/paths_hash.rb +0 -0
  82. data/sub/eac_config/lib/eac_config/prefixed_path_node/entry.rb +25 -0
  83. data/sub/eac_config/lib/eac_config/prefixed_path_node.rb +19 -0
  84. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/rspec/setup.rb +0 -0
  85. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/rspec.rb +0 -0
  86. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/version.rb +1 -1
  87. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/yaml_file_node/entry.rb +0 -0
  88. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config/yaml_file_node.rb +0 -0
  89. data/sub/{avm-tools/sub/eac_config → eac_config}/lib/eac_config.rb +0 -0
  90. data/sub/{avm-tools/sub/eac_config → eac_config}/spec/lib/eac_config/entry_path_spec.rb +0 -0
  91. data/sub/{avm-tools/sub/eac_config → eac_config}/spec/lib/eac_config/envvars_node/entry_spec.rb +0 -0
  92. data/sub/{avm-tools/sub/eac_config → eac_config}/spec/lib/eac_config/envvars_node_spec.rb +0 -0
  93. data/sub/{avm-tools/sub/eac_config → eac_config}/spec/lib/eac_config/old_configs_spec.rb +0 -0
  94. data/sub/{avm-tools/sub/eac_config → eac_config}/spec/lib/eac_config/paths_hash_spec.rb +0 -0
  95. data/sub/{avm-tools/sub/eac_config → eac_config}/spec/lib/eac_config/yaml_file_node_spec.rb +0 -0
  96. data/sub/{avm-tools/sub/eac_config → eac_config}/spec/lib/eac_config/yaml_file_node_spec_files/storage1.yaml +0 -0
  97. data/sub/{avm-tools/sub/eac_config → eac_config}/spec/lib/eac_config/yaml_file_node_spec_files/storage1_1.yaml +0 -0
  98. data/sub/{avm-tools/sub/eac_config → eac_config}/spec/lib/eac_config/yaml_file_node_spec_files/storage1_2/storage1_2_1.yaml +0 -0
  99. data/sub/{avm-tools/sub/eac_config → eac_config}/spec/lib/eac_config/yaml_file_node_spec_files/storage1_2.yaml +0 -0
  100. data/sub/{avm-tools/sub/eac_config → eac_config}/spec/rubocop_spec.rb +0 -0
  101. data/sub/{avm-tools/sub/eac_config → eac_config}/spec/spec_helper.rb +0 -0
  102. data/sub/eac_docker/Gemfile +8 -0
  103. data/sub/{avm-tools/sub/eac_docker → eac_docker}/eac_docker.gemspec +3 -3
  104. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/container.rb +4 -3
  105. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/debug.rb +0 -0
  106. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/executables.rb +0 -0
  107. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/images/base.rb +0 -0
  108. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/images/coded.rb +0 -0
  109. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/images/named.rb +0 -0
  110. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/images/templatized.rb +0 -0
  111. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/images.rb +0 -0
  112. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/registry.rb +0 -0
  113. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/rspec/setup.rb +0 -0
  114. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/rspec.rb +0 -0
  115. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker/version.rb +1 -1
  116. data/sub/{avm-tools/sub/eac_docker → eac_docker}/lib/eac_docker.rb +0 -0
  117. data/sub/{avm-tools/sub/eac_docker → eac_docker}/spec/lib/eac_docker/executables_spec.rb +0 -0
  118. data/sub/{avm-tools/sub/eac_docker → eac_docker}/spec/lib/eac_docker/images/coded_spec.rb +0 -0
  119. data/sub/{avm-tools/sub/eac_docker → eac_docker}/spec/lib/eac_docker/images/coded_spec_files/image1/Dockerfile +0 -0
  120. data/sub/{avm-tools/sub/eac_docker → eac_docker}/spec/lib/eac_docker/images/templatized_spec.rb +0 -0
  121. data/sub/{avm-tools/sub/eac_docker → eac_docker}/spec/lib/eac_docker/images/templatized_spec_files/stub_docker_image/Dockerfile +0 -0
  122. data/sub/{avm-tools/sub/eac_docker → eac_docker}/spec/rubocop_spec.rb +0 -0
  123. data/sub/{avm-tools/sub/eac_docker → eac_docker}/spec/spec_helper.rb +0 -0
  124. data/sub/eac_fs/Gemfile +3 -0
  125. data/sub/eac_fs/lib/eac_fs/version.rb +1 -1
  126. data/sub/eac_ruby_base0/Gemfile +3 -0
  127. data/sub/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
  128. data/sub/eac_ruby_utils/Gemfile +2 -10
  129. data/sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/array_accessor.rb +22 -5
  130. data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  131. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/immutable_spec.rb +34 -0
  132. metadata +101 -87
  133. data/sub/avm/lib/avm/sources/base/runners.rb +0 -47
  134. data/sub/avm-tools/Gemfile.lock +0 -296
  135. data/sub/avm-tools/lib/avm/tools/runner/eac_redmine_base0/dev_docker.rb +0 -17
  136. data/sub/avm-tools/sub/eac_config/Gemfile +0 -5
  137. data/sub/avm-tools/sub/eac_docker/Gemfile +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2a2823e5a682fec9ab91720f10d7783faa49fa2015806b7a5d39580bc218001
4
- data.tar.gz: f5fd98b06fe0fa9d9e31e55d9c9f5ca31f7efef2e78a80cd9a6c4157ed1a06ee
3
+ metadata.gz: 8d89f91fc9b0ac96c2510d38c9aa06d37d8697339bde9ce7c8cf877a4af28eaf
4
+ data.tar.gz: 6bc8567322b54c5aa52ec0006980678c0866970d4048fec767d7ecf3df958b68
5
5
  SHA512:
6
- metadata.gz: e8c12e5907f1977602dbaedc5d6bd278d2ff4f34090ca74ce9b5b3bd2ec38e55936412e1cf161c43594d760d940f24f1fcfa90b4a80e871077797c8906241cee
7
- data.tar.gz: c92d636d848558c31f0b51213e464573a30a70de11ccda7853f0e70f96d8e9853ba9d5298142a939926b65f9f5fe33c906a4fbf22d66dbaca0a2c9fa0dcc13b9
6
+ metadata.gz: 02bde179ac70148302c0a0ee45aff95c0db7e871df595cfbb079d3a17fca772305a593af8a4031b0a1ece78997863cb30c3a0c2d309120ab807b7e0df6cc43dd
7
+ data.tar.gz: '048c5163c663b61878bdad6c327a282c2eff64a7ab709ed02fc35d5e856002e950baf924af186c062b627183c7c2687ecf7c6c906f22118a7149d62156a18d8f'
data/Gemfile.lock CHANGED
@@ -1,22 +1,22 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eac_tools (0.7.0)
5
- avm-eac_generic_base0 (~> 0.3)
4
+ eac_tools (0.10.0)
5
+ avm-eac_generic_base0 (~> 0.4)
6
6
  avm-eac_rails_base0 (~> 0.5)
7
7
  avm-eac_rails_base1 (~> 0.4, >= 0.4.1)
8
- avm-eac_redmine_base0 (~> 0.9)
9
- avm-eac_redmine_plugin_base0 (~> 0.2)
10
- avm-eac_ruby_base1 (~> 0.10)
11
- avm-tools (~> 0.121)
12
- eac_ruby_utils (~> 0.95, >= 0.95.2)
8
+ avm-eac_redmine_base0 (~> 0.10)
9
+ avm-eac_redmine_plugin_base0 (~> 0.3)
10
+ avm-eac_ruby_base1 (~> 0.11)
11
+ avm-tools (~> 0.124)
12
+ eac_ruby_utils (~> 0.96)
13
13
 
14
14
  PATH
15
15
  remote: sub/avm-eac_generic_base0
16
16
  specs:
17
- avm-eac_generic_base0 (0.3.0)
18
- avm (~> 0.24)
19
- eac_ruby_utils (~> 0.05, >= 0.95.2)
17
+ avm-eac_generic_base0 (0.4.0)
18
+ avm (~> 0.28)
19
+ eac_ruby_utils (~> 0.96)
20
20
 
21
21
  PATH
22
22
  remote: sub/avm-eac_rails_base0
@@ -36,7 +36,8 @@ PATH
36
36
  PATH
37
37
  remote: sub/avm-eac_redmine_base0
38
38
  specs:
39
- avm-eac_redmine_base0 (0.9.0)
39
+ avm-eac_redmine_base0 (0.10.0)
40
+ avm-eac_generic_base0 (~> 0.4)
40
41
  avm-eac_rails_base1 (~> 0.4, >= 0.4.1)
41
42
  avm-eac_ubuntu_base0 (~> 0.3)
42
43
  curb (~> 0.9.11)
@@ -47,24 +48,24 @@ PATH
47
48
  PATH
48
49
  remote: sub/avm-eac_redmine_plugin_base0
49
50
  specs:
50
- avm-eac_redmine_plugin_base0 (0.2.0)
51
- avm-eac_ruby_base1 (~> 0.10)
51
+ avm-eac_redmine_plugin_base0 (0.3.0)
52
+ avm-eac_ruby_base1 (~> 0.11)
52
53
  eac_ruby_utils (~> 0.95, >= 0.95.1)
53
54
 
54
55
  PATH
55
56
  remote: sub/avm-eac_ruby_base1
56
57
  specs:
57
- avm-eac_ruby_base1 (0.10.0)
58
- avm (~> 0.23)
58
+ avm-eac_ruby_base1 (0.11.0)
59
+ avm (~> 0.26)
59
60
  avm-eac_generic_base0 (~> 0.2)
60
61
  eac_ruby_utils (~> 0.95, >= 0.95.1)
61
62
 
62
63
  PATH
63
64
  remote: sub/avm-tools
64
65
  specs:
65
- avm-tools (0.121.2)
66
+ avm-tools (0.124.0)
66
67
  aranha-parsers (~> 0.4)
67
- avm (~> 0.22)
68
+ avm (~> 0.27)
68
69
  avm-eac_asciidoctor_base0 (~> 0.3, >= 0.3.4)
69
70
  avm-eac_rails_base0 (~> 0.3)
70
71
  avm-eac_redmine_base0 (~> 0.5, >= 0.5.2)
@@ -81,8 +82,9 @@ PATH
81
82
  PATH
82
83
  remote: sub/avm
83
84
  specs:
84
- avm (0.25.0)
85
+ avm (0.28.0)
85
86
  eac_cli (~> 0.27, >= 0.27.6)
87
+ eac_config (~> 0.9)
86
88
  eac_docker (~> 0.3)
87
89
  eac_git (~> 0.6)
88
90
  eac_ruby_utils (~> 0.95)
@@ -94,15 +96,29 @@ PATH
94
96
  PATH
95
97
  remote: sub/eac_cli
96
98
  specs:
97
- eac_cli (0.27.6)
99
+ eac_cli (0.27.7)
98
100
  colorize (~> 0.8.1)
99
101
  eac_config (~> 0.8)
100
102
  eac_ruby_utils (~> 0.95)
101
103
 
104
+ PATH
105
+ remote: sub/eac_config
106
+ specs:
107
+ eac_config (0.9.0)
108
+ addressable
109
+ eac_ruby_utils (~> 0.83)
110
+
111
+ PATH
112
+ remote: sub/eac_docker
113
+ specs:
114
+ eac_docker (0.4.2)
115
+ eac_ruby_utils (~> 0.96)
116
+ eac_templates (~> 0.3, >= 0.3.1)
117
+
102
118
  PATH
103
119
  remote: sub/eac_fs
104
120
  specs:
105
- eac_fs (0.12.2)
121
+ eac_fs (0.12.3)
106
122
  content-type
107
123
  eac_ruby_utils (~> 0.70)
108
124
  ruby-filemagic
@@ -110,7 +126,7 @@ PATH
110
126
  PATH
111
127
  remote: sub/eac_ruby_base0
112
128
  specs:
113
- eac_ruby_base0 (0.16.5)
129
+ eac_ruby_base0 (0.16.6)
114
130
  avm-eac_ruby_base1 (~> 0.8)
115
131
  eac_cli (~> 0.27, >= 0.27.5)
116
132
  eac_fs (~> 0.10)
@@ -119,7 +135,7 @@ PATH
119
135
  PATH
120
136
  remote: sub/eac_ruby_utils
121
137
  specs:
122
- eac_ruby_utils (0.95.2)
138
+ eac_ruby_utils (0.96.0)
123
139
  activesupport (>= 4, < 7)
124
140
  addressable (~> 2.6)
125
141
  bundler
@@ -183,12 +199,6 @@ GEM
183
199
  parslet (~> 2.0)
184
200
  curb (0.9.11)
185
201
  diff-lcs (1.5.0)
186
- eac_config (0.8.1)
187
- addressable
188
- eac_ruby_utils (~> 0.83)
189
- eac_docker (0.4.1)
190
- eac_ruby_utils (~> 0.74)
191
- eac_templates (~> 0.1)
192
202
  eac_git (0.12.1)
193
203
  eac_ruby_utils (~> 0.83)
194
204
  parseconfig (~> 1.0, >= 1.0.8)
@@ -243,7 +253,7 @@ GEM
243
253
  minitest (5.16.2)
244
254
  multipart-post (2.2.3)
245
255
  net-ssh (4.2.0)
246
- nokogiri (1.13.7-x86_64-linux)
256
+ nokogiri (1.13.8-x86_64-linux)
247
257
  racc (~> 1.4)
248
258
  ofx-parser (1.1.0)
249
259
  hpricot (>= 0.6)
@@ -289,7 +299,7 @@ GEM
289
299
  ruby-filemagic (0.7.3)
290
300
  ruby-progressbar (1.11.0)
291
301
  ruby2_keywords (0.0.5)
292
- tzinfo (2.0.4)
302
+ tzinfo (2.0.5)
293
303
  concurrent-ruby (~> 1.0)
294
304
  unicode-display_width (1.6.1)
295
305
  zeitwerk (2.6.0)
@@ -308,6 +318,8 @@ DEPENDENCIES
308
318
  avm-eac_ruby_base1!
309
319
  avm-tools!
310
320
  eac_cli!
321
+ eac_config!
322
+ eac_docker!
311
323
  eac_fs!
312
324
  eac_ruby_base0!
313
325
  eac_ruby_gem_support (~> 0.5.1)
@@ -315,4 +327,4 @@ DEPENDENCIES
315
327
  eac_tools!
316
328
 
317
329
  BUNDLED WITH
318
- 2.3.17
330
+ 2.3.18
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacTools
4
- VERSION = '0.7.0'
4
+ VERSION = '0.10.0'
5
5
  end
data/sub/avm/avm.gemspec CHANGED
@@ -13,6 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.files = Dir['{lib}/**/*']
14
14
 
15
15
  s.add_dependency 'eac_cli', '~> 0.27', '>= 0.27.6'
16
+ s.add_dependency 'eac_config', '~> 0.9'
16
17
  s.add_dependency 'eac_docker', '~> 0.3'
17
18
  s.add_dependency 'eac_git', '~> 0.6'
18
19
  s.add_dependency 'eac_ruby_utils', '~> 0.95'
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avm
4
+ module ApplicationStereotypes
5
+ class Base
6
+ module ByGem
7
+ common_concern
8
+
9
+ module ClassMethods
10
+ def by_gem(gem_name)
11
+ new(gem_name.gsub('-', '/').camelize)
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avm
4
+ module ApplicationStereotypes
5
+ class Base
6
+ module Detection
7
+ common_concern
8
+
9
+ module ClassMethods
10
+ # @return [Class<Avm::Sources::Base>, nil]
11
+ def detect(object)
12
+ return singleton_instance if
13
+ %w[name instance_class source_class].any? { |t| send("detect_by_#{t}?", object) }
14
+ end
15
+
16
+ # @return [Boolean]
17
+ def detect_by_instance_class?(object)
18
+ object.is_a?(::Class) && singleton_instance.instance_class == object
19
+ end
20
+
21
+ # @return [Boolean]
22
+ def detect_by_name?(object)
23
+ object.is_a?(::String) && singleton_instance.name == object
24
+ end
25
+
26
+ # @return [Boolean]
27
+ def detect_by_source_class?(object)
28
+ object.is_a?(::Class) && singleton_instance.source_class == object
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module ApplicationStereotypes
7
+ class Base
8
+ common_constructor :namespace_module, :instance_class, :source_class
9
+
10
+ # @return [String]
11
+ def name
12
+ namespace_module.name.demodulize
13
+ end
14
+
15
+ # @return [String]
16
+ def to_s
17
+ name
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module ApplicationStereotypes
7
+ require_sub __FILE__
8
+ end
9
+ end
@@ -1,16 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'avm/instances/entries'
4
+ require 'eac_ruby_utils/core_ext'
4
5
 
5
6
  module Avm
6
- module Instances
7
- class Application
7
+ module Applications
8
+ class Base
8
9
  include ::Avm::Instances::Entries
9
10
 
10
- attr_reader :id
11
-
12
- def initialize(id)
13
- @id = id.to_s
11
+ common_constructor :id do
12
+ self.id = id.to_s
14
13
  end
15
14
 
16
15
  def to_s
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Applications
7
+ require_sub __FILE__
8
+ end
9
+ end
@@ -3,16 +3,26 @@
3
3
  require 'avm/version'
4
4
  require 'eac_ruby_utils/core_ext'
5
5
  require 'eac_docker/images/templatized'
6
+ require 'eac_docker/registry'
6
7
 
7
8
  module Avm
8
9
  module Docker
9
10
  class Image < ::EacDocker::Images::Templatized
11
+ DEFAULT_REGISTRY_NAME = 'local'
12
+
13
+ class << self
14
+ # @return [EacDocker::Registry]
15
+ def default_registry
16
+ ::EacDocker::Registry.new(DEFAULT_REGISTRY_NAME)
17
+ end
18
+ end
19
+
10
20
  attr_reader :registry
11
21
  attr_accessor :snapshot
12
22
  attr_accessor :version
13
23
 
14
- def initialize(registry)
15
- @registry = registry
24
+ def initialize(registry = nil)
25
+ @registry = registry || self.class.default_registry
16
26
  self.snapshot = true
17
27
  self.version = true
18
28
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/with_application_stereotype'
4
+ require 'avm/with_dynamic_runners'
3
5
  require 'eac_ruby_utils/require_sub'
4
6
  require 'eac_ruby_utils/simple_cache'
5
7
  require 'avm/instances/entries'
@@ -7,10 +9,13 @@ require 'avm/instances/entries'
7
9
  module Avm
8
10
  module Instances
9
11
  class Base
12
+ enable_abstract_methods
10
13
  enable_listable
11
14
  enable_simple_cache
12
15
  require_sub __FILE__, include_modules: true
13
16
  include ::Avm::Instances::Entries
17
+ include ::Avm::WithDynamicRunners
18
+ include ::Avm::WithApplicationStereotype
14
19
 
15
20
  lists.add_string :access, :local, :ssh
16
21
 
@@ -19,8 +24,8 @@ module Avm
19
24
  class << self
20
25
  def by_id(id)
21
26
  application_id, suffix = parse_id(id)
22
- require 'avm/instances/application'
23
- new(::Avm::Instances::Application.new(application_id), suffix)
27
+ require 'avm/applications/base'
28
+ new(::Avm::Applications::Base.new(application_id), suffix)
24
29
  end
25
30
 
26
31
  private
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Avm
4
4
  module Instances
5
- require 'avm/instances/application'
5
+ require 'avm/applications/base'
6
6
  require 'avm/instances/entries'
7
7
  end
8
8
  end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/registry/application_stereotypes/stereotype_builder'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module Registry
8
+ class ApplicationStereotypes
9
+ class BuildAvailable
10
+ enable_method_class
11
+
12
+ common_constructor :owner
13
+
14
+ def result
15
+ reset_buffer
16
+ read_instances_registry
17
+ read_sources_registry
18
+ buffer.values.map(&:build)
19
+ end
20
+
21
+ private
22
+
23
+ attr_accessor :buffer
24
+
25
+ def read_object(type, object)
26
+ buffer[object.stereotype_namespace_module] ||=
27
+ ::Avm::Registry::ApplicationStereotypes::StereotypeBuilder
28
+ .new(object.stereotype_namespace_module)
29
+ buffer[object.stereotype_namespace_module].add_object(type, object)
30
+ end
31
+
32
+ def read_instances_registry
33
+ ::Avm::Registry.instances.available.each { |instance| read_object(:instance, instance) }
34
+ end
35
+
36
+ def read_sources_registry
37
+ ::Avm::Registry.sources.available.each { |source| read_object(:source, source) }
38
+ end
39
+
40
+ def reset_buffer
41
+ self.buffer = {}
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/application_stereotypes/base'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module Registry
8
+ class ApplicationStereotypes
9
+ class StereotypeBuilder
10
+ common_constructor :namespace_module
11
+
12
+ def add_object(type, object)
13
+ attr_method = "#{type}_class"
14
+ raise "#{attr_method} is already present" if send(attr_method).present?
15
+
16
+ send("#{attr_method}=", object)
17
+ end
18
+
19
+ # @return [Avm::ApplicationStereotypes::Base]
20
+ def build
21
+ ::Avm::ApplicationStereotypes::Base.new(namespace_module, instance_class, source_class)
22
+ end
23
+
24
+ private
25
+
26
+ attr_accessor :instance_class, :source_class
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Registry
7
+ class ApplicationStereotypes
8
+ require_sub __FILE__, require_dependency: true
9
+ enable_simple_cache
10
+
11
+ common_constructor :module_suffix
12
+
13
+ private
14
+
15
+ def available_uncached
16
+ build_available
17
+ end
18
+
19
+ # @return [Avm::Instances::Base, nil]
20
+ def class_detect(klass, detect_args)
21
+ r = ::Avm::Instances::Base.by_id(*detect_args)
22
+ r.application.stereotype.instance_class == klass ? r : nil
23
+ end
24
+
25
+ def detect(*registered_initialize_args)
26
+ detect_optional(*registered_initialize_args) ||
27
+ raise_not_found(*registered_initialize_args)
28
+ end
29
+
30
+ def detect_optional(*registered_initialize_args)
31
+ registered_modules.reverse.lazy
32
+ .map { |klass| class_detect(klass, registered_initialize_args) }.find(&:present?)
33
+ end
34
+ end
35
+ end
36
+ end
@@ -5,18 +5,27 @@ require 'eac_ruby_utils/gems_registry'
5
5
 
6
6
  module Avm
7
7
  module Registry
8
- class Base
8
+ class FromGems
9
+ enable_abstract_methods
9
10
  enable_simple_cache
10
11
  common_constructor :module_suffix
11
12
 
13
+ def available
14
+ registered_modules.reject(&:abstract?)
15
+ end
16
+
17
+ def class_detect(_klass, _detect_args)
18
+ raise_abstract_method __method__
19
+ end
20
+
12
21
  def detect(*registered_initialize_args)
13
22
  detect_optional(*registered_initialize_args) ||
14
23
  raise_not_found(*registered_initialize_args)
15
24
  end
16
25
 
17
26
  def detect_optional(*registered_initialize_args)
18
- registered_modules.reverse.lazy.map { |klass| klass.new(*registered_initialize_args) }
19
- .find(&:valid?)
27
+ available.reverse.lazy
28
+ .map { |klass| class_detect(klass, registered_initialize_args) }.find(&:present?)
20
29
  end
21
30
 
22
31
  def provider_module_suffix
@@ -39,7 +48,7 @@ module Avm
39
48
 
40
49
  def raise_not_found(*args)
41
50
  raise("No registered module valid for #{args}" \
42
- " (Module suffix: #{module_suffix}, Available: #{registered_modules.join(', ')})")
51
+ " (Module suffix: #{module_suffix}, Available: #{available.join(', ')})")
43
52
  end
44
53
 
45
54
  def registered_modules_uncached
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/instances/base'
4
+ require 'avm/registry/from_gems'
5
+
6
+ module Avm
7
+ module Registry
8
+ class Instances < ::Avm::Registry::FromGems
9
+ # @return [Avm::Instances::Base, nil]
10
+ def class_detect(klass, detect_args)
11
+ r = ::Avm::Instances::Base.by_id(*detect_args)
12
+ r.application.stereotype.instance_class == klass ? r : nil
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/registry/from_gems'
4
+
5
+ module Avm
6
+ module Registry
7
+ class Runners < ::Avm::Registry::FromGems
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/registry/with_path'
4
+
5
+ module Avm
6
+ module Registry
7
+ class Scms < ::Avm::Registry::WithPath
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/registry/with_path'
4
+
5
+ module Avm
6
+ module Registry
7
+ class Sources < ::Avm::Registry::WithPath
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/registry/from_gems'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module Registry
8
+ class WithPath < ::Avm::Registry::FromGems
9
+ class Cache
10
+ enable_simple_cache
11
+ common_constructor :owner
12
+
13
+ def detect_optional(path)
14
+ return nil if path.root?
15
+ return cached_paths.fetch(path) if cached_paths.key?(path)
16
+
17
+ detected = owner.detect_optional(path)
18
+ detected = detect_optional(path.parent) if detected.blank?
19
+ cached_paths[path] = detected
20
+ detected
21
+ end
22
+
23
+ private
24
+
25
+ def cached_paths_uncached
26
+ {}
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end