eac_tools 0.12.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +46 -34
  3. data/lib/eac_tools/version.rb +1 -1
  4. data/sub/avm/avm.gemspec +2 -2
  5. data/sub/avm/lib/avm/applications/base.rb +2 -2
  6. data/sub/avm/lib/avm/entries/auto_values/entry.rb +32 -0
  7. data/sub/avm/lib/avm/entries/auto_values.rb +11 -0
  8. data/sub/avm/lib/avm/{instances/entries.rb → entries/base.rb} +9 -5
  9. data/sub/avm/lib/avm/{instances → entries}/entry.rb +3 -12
  10. data/sub/avm/lib/avm/entries.rb +9 -0
  11. data/sub/avm/lib/avm/instances/base/auto_values/admin.rb +2 -2
  12. data/sub/avm/lib/avm/instances/base/auto_values/database.rb +1 -1
  13. data/sub/avm/lib/avm/instances/base/auto_values/filesystem.rb +9 -8
  14. data/sub/avm/lib/avm/instances/base/auto_values/install.rb +48 -0
  15. data/sub/avm/lib/avm/instances/base/auto_values/mailer.rb +5 -4
  16. data/sub/avm/lib/avm/instances/base/auto_values/ruby.rb +1 -1
  17. data/sub/avm/lib/avm/instances/base/auto_values/system.rb +3 -3
  18. data/sub/avm/lib/avm/instances/base/auto_values.rb +4 -5
  19. data/sub/avm/lib/avm/instances/base.rb +10 -10
  20. data/sub/avm/lib/avm/instances/entry_keys.rb +8 -7
  21. data/sub/avm/lib/avm/instances.rb +3 -2
  22. data/sub/avm/lib/avm/scms/base.rb +2 -2
  23. data/sub/avm/lib/avm/source_generators/base.rb +2 -2
  24. data/sub/avm/lib/avm/sources/base.rb +4 -4
  25. data/sub/avm/lib/avm/version.rb +1 -1
  26. data/sub/avm/lib/avm/with/application_stereotype.rb +35 -0
  27. data/sub/avm/lib/avm/with/extra_subcommands.rb +44 -0
  28. data/sub/avm/spec/lib/avm/instances/base_spec.rb +50 -50
  29. data/sub/avm/spec/lib/avm/instances/base_spec_configs_storage.yml +5 -3
  30. data/sub/avm-eac_asciidoctor_base0/Gemfile +8 -0
  31. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/avm-eac_asciidoctor_base0.gemspec +0 -0
  32. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/apache_host.rb +0 -0
  33. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/apache_path.rb +0 -0
  34. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/deploy.rb +0 -0
  35. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/instance.rb +0 -0
  36. data/sub/{avm-tools/lib/avm/tools/runner/eac_asciidoctor_base0.rb → avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/runners/base.rb} +3 -4
  37. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/runners.rb +11 -0
  38. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/base.rb +0 -0
  39. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/build/file.rb +0 -0
  40. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/build.rb +0 -0
  41. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/runner/build.rb +0 -0
  42. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/runner.rb +0 -0
  43. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners/build.rb +54 -0
  44. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners.rb +13 -0
  45. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources.rb +0 -0
  46. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
  47. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0.rb +0 -0
  48. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/spec/lib/avm/eac_asciidoctor_base0/sources/base_spec.rb +0 -0
  49. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/spec/rubocop_spec.rb +0 -0
  50. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/spec/spec_helper.rb +0 -0
  51. data/sub/avm-eac_rails_base0/avm-eac_rails_base0.gemspec +3 -3
  52. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/version.rb +1 -1
  53. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/spec/{ruby_style_spec.rb → code/rubocop_spec.rb} +0 -0
  54. data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +3 -2
  55. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit.rb +1 -1
  56. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
  57. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubygems/gemspec/add_or_replace_gem_line.rb +62 -0
  58. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubygems/gemspec/dependency.rb +19 -0
  59. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubygems/gemspec.rb +42 -0
  60. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
  61. data/sub/avm-eac_webapp_base0/Gemfile +8 -0
  62. data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +22 -0
  63. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_host.rb +78 -0
  64. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_path.rb +51 -0
  65. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/appended_directories.rb +25 -0
  66. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/build.rb +48 -0
  67. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb +42 -0
  68. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/git_info.rb +62 -0
  69. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/version.rb +24 -0
  70. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/write_on_target.rb +18 -0
  71. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy.rb +73 -0
  72. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instance/subcommand_parent.rb +24 -0
  73. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instance.rb +62 -0
  74. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/apache_host.rb +35 -0
  75. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/apache_path.rb +40 -0
  76. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data/dump.rb +63 -0
  77. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data/load.rb +55 -0
  78. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data.rb +17 -0
  79. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/deploy.rb +39 -0
  80. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner.rb +12 -0
  81. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/sources/base.rb +15 -0
  82. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/sources.rb +11 -0
  83. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +7 -0
  84. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0.rb +9 -0
  85. data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/sources/base_spec.rb +7 -0
  86. data/sub/avm-eac_webapp_base0/spec/rubocop_spec.rb +3 -0
  87. data/sub/avm-eac_webapp_base0/spec/spec_helper.rb +4 -0
  88. data/sub/avm-eac_webapp_base0/template/avm/eac_webapp_base0/apache_host/no_ssl.conf +11 -0
  89. data/sub/avm-eac_webapp_base0/template/avm/eac_webapp_base0/apache_path/default.conf +9 -0
  90. data/sub/avm-tools/avm-tools.gemspec +0 -1
  91. data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
  92. data/sub/eac_config/eac_config.gemspec +1 -1
  93. data/sub/eac_config/lib/eac_config/entry_path.rb +15 -4
  94. data/sub/eac_config/lib/eac_config/version.rb +1 -1
  95. data/sub/eac_ruby_utils/lib/eac_ruby_utils/regexp_parser.rb +5 -0
  96. data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  97. metadata +112 -42
  98. data/sub/avm/lib/avm/instances/base/auto_values/access.rb +0 -40
  99. data/sub/avm/lib/avm/with_application_stereotype.rb +0 -33
  100. data/sub/avm/lib/avm/with_dynamic_runners.rb +0 -42
  101. data/sub/avm-tools/lib/avm/tools/runner/app_src/eac_asciidoctor_base0/build.rb +0 -56
  102. data/sub/avm-tools/lib/avm/tools/runner/app_src/eac_asciidoctor_base0.rb +0 -14
  103. data/sub/avm-tools/sub/avm-eac_asciidoctor_base0/Gemfile +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8e7fe08b68334a93a53b8f91d2becce812f7e5489d36af3718477d77d651cbc
4
- data.tar.gz: 484af66fe24d6907d195fb67af719ad79299d3ba978e2387e92737b2c1c72c8b
3
+ metadata.gz: 435984e41a0bf529de374dc9e4640143f9e9caf7a26118d11ce65e6879488ed2
4
+ data.tar.gz: 99c63bd9a4b686211df32d65762873913e21b245a21535e3bc0f3ef8d9e81080
5
5
  SHA512:
6
- metadata.gz: 76be1cd01e6f3874a9c3a0a987592cdee9957b723f0ed0dab109f95a0541abd49d62e76a1f3f6da2d633de6ba6bcc115893eb5b44f18180c1deba40c5c7c9b5d
7
- data.tar.gz: 8d814b9bfa7c899a56a2721088e6285ca17af658c3e500ff64075682a59eccb0c7347145c2887313c2520cd9315916ff4c73529dc775f5714561b2c3581711b0
6
+ metadata.gz: 31d1736330d976d3a50e14fa312b2ce826227fea5da3fb3a9bfd846a9a870a7a36244f11f7ac77989bd6773f6f8dbf797ed4065b0061256dbaacd4468d047052
7
+ data.tar.gz: ec2df47e102ed54df74f8f35ffb52038d272c20879900c88aaf27058be34c0d2527a96b6f21c4c0dd81b0a70d42d1ff6e166d045a311c9cd411cdc89ebb2afbe
data/Gemfile.lock CHANGED
@@ -1,15 +1,27 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eac_tools (0.12.0)
4
+ eac_tools (0.15.0)
5
+ avm-eac_asciidoctor_base0 (~> 0.4)
5
6
  avm-eac_generic_base0 (~> 0.4)
6
- avm-eac_rails_base0 (~> 0.6)
7
- avm-eac_rails_base1 (~> 0.4, >= 0.4.1)
7
+ avm-eac_rails_base0 (~> 0.6, >= 0.6.1)
8
+ avm-eac_rails_base1 (~> 0.4, >= 0.4.2)
8
9
  avm-eac_redmine_base0 (~> 0.11)
9
10
  avm-eac_redmine_plugin_base0 (~> 0.3)
10
- avm-eac_ruby_base1 (~> 0.11)
11
- avm-tools (~> 0.127)
12
- eac_ruby_utils (~> 0.96, >= 0.96.1)
11
+ avm-eac_ruby_base1 (~> 0.12)
12
+ avm-eac_webapp_base0 (~> 0.3, >= 0.3.1)
13
+ avm-tools (~> 0.128)
14
+ eac_ruby_utils (~> 0.97)
15
+
16
+ PATH
17
+ remote: sub/avm-eac_asciidoctor_base0
18
+ specs:
19
+ avm-eac_asciidoctor_base0 (0.4.0)
20
+ asciidoctor (~> 2.0, >= 2.0.12)
21
+ avm-eac_webapp_base0 (~> 0.2)
22
+ eac_ruby_utils (~> 0.63)
23
+ os
24
+ rouge (~> 3.26)
13
25
 
14
26
  PATH
15
27
  remote: sub/avm-eac_generic_base0
@@ -21,17 +33,18 @@ PATH
21
33
  PATH
22
34
  remote: sub/avm-eac_rails_base0
23
35
  specs:
24
- avm-eac_rails_base0 (0.6.0)
25
- avm-eac_rails_base1 (~> 0.3)
26
- eac_ruby_utils (~> 0.80, >= 0.80.2)
36
+ avm-eac_rails_base0 (0.6.1)
37
+ avm-eac_rails_base1 (~> 0.4, >= 0.4.2)
38
+ eac_ruby_utils (~> 0.97)
27
39
 
28
40
  PATH
29
41
  remote: sub/avm-eac_rails_base1
30
42
  specs:
31
- avm-eac_rails_base1 (0.4.1)
32
- avm-eac_ruby_base1 (~> 0.9, >= 0.9.1)
43
+ avm-eac_rails_base1 (0.4.2)
44
+ avm (~> 0.31)
45
+ avm-eac_ruby_base1 (~> 0.11)
33
46
  avm-eac_webapp_base0 (~> 0.3)
34
- eac_ruby_utils (~> 0.95, >= 0.95.2)
47
+ eac_ruby_utils (~> 0.97)
35
48
 
36
49
  PATH
37
50
  remote: sub/avm-eac_redmine_base0
@@ -56,18 +69,27 @@ PATH
56
69
  PATH
57
70
  remote: sub/avm-eac_ruby_base1
58
71
  specs:
59
- avm-eac_ruby_base1 (0.11.0)
72
+ avm-eac_ruby_base1 (0.12.0)
60
73
  avm (~> 0.26)
61
74
  avm-eac_generic_base0 (~> 0.2)
62
75
  eac_ruby_utils (~> 0.95, >= 0.95.1)
63
76
 
77
+ PATH
78
+ remote: sub/avm-eac_webapp_base0
79
+ specs:
80
+ avm-eac_webapp_base0 (0.3.1)
81
+ avm (~> 0.1)
82
+ avm-eac_generic_base0 (~> 0.1)
83
+ avm-eac_postgresql_base0 (~> 0.1)
84
+ avm-eac_ubuntu_base0 (~> 0.3)
85
+ eac_ruby_utils (~> 0.68)
86
+
64
87
  PATH
65
88
  remote: sub/avm-tools
66
89
  specs:
67
- avm-tools (0.127.0)
90
+ avm-tools (0.128.0)
68
91
  aranha-parsers (~> 0.4)
69
92
  avm (~> 0.30)
70
- avm-eac_asciidoctor_base0 (~> 0.3, >= 0.3.4)
71
93
  avm-eac_ruby_base1 (~> 0.8)
72
94
  avm-eac_ubuntu_base0 (~> 0.3)
73
95
  avm-files (~> 0.1)
@@ -81,12 +103,12 @@ PATH
81
103
  PATH
82
104
  remote: sub/avm
83
105
  specs:
84
- avm (0.30.0)
106
+ avm (0.33.0)
85
107
  eac_cli (~> 0.27, >= 0.27.6)
86
- eac_config (~> 0.9)
108
+ eac_config (~> 0.10)
87
109
  eac_docker (~> 0.3)
88
110
  eac_git (~> 0.6)
89
- eac_ruby_utils (~> 0.95)
111
+ eac_ruby_utils (~> 0.97)
90
112
  eac_templates (~> 0.1, >= 0.1.1)
91
113
  filesize (~> 0.2)
92
114
  htmlbeautifier (~> 1.3, >= 1.3.1)
@@ -103,9 +125,9 @@ PATH
103
125
  PATH
104
126
  remote: sub/eac_config
105
127
  specs:
106
- eac_config (0.9.0)
128
+ eac_config (0.10.0)
107
129
  addressable
108
- eac_ruby_utils (~> 0.83)
130
+ eac_ruby_utils (~> 0.97)
109
131
 
110
132
  PATH
111
133
  remote: sub/eac_docker
@@ -134,7 +156,7 @@ PATH
134
156
  PATH
135
157
  remote: sub/eac_ruby_utils
136
158
  specs:
137
- eac_ruby_utils (0.96.1)
159
+ eac_ruby_utils (0.97.0)
138
160
  activesupport (>= 4, < 7)
139
161
  addressable (~> 2.6)
140
162
  bundler
@@ -163,12 +185,6 @@ GEM
163
185
  ofx-parser (~> 1.1.0)
164
186
  asciidoctor (2.0.17)
165
187
  ast (2.4.2)
166
- avm-eac_asciidoctor_base0 (0.3.4)
167
- asciidoctor (~> 2.0, >= 2.0.12)
168
- avm-eac_webapp_base0 (~> 0.2)
169
- eac_ruby_utils (~> 0.63)
170
- os
171
- rouge (~> 3.26)
172
188
  avm-eac_postgresql_base0 (0.2.0)
173
189
  avm (~> 0.12, >= 0.12.1)
174
190
  eac_ruby_utils (~> 0.82)
@@ -176,12 +192,6 @@ GEM
176
192
  avm (~> 0.7)
177
193
  eac_ruby_utils (~> 0.77, >= 0.77.1)
178
194
  eac_templates (~> 0.3)
179
- avm-eac_webapp_base0 (0.3.0)
180
- avm (~> 0.1)
181
- avm-eac_generic_base0 (~> 0.1)
182
- avm-eac_postgresql_base0 (~> 0.1)
183
- avm-eac_ubuntu_base0 (~> 0.3)
184
- eac_ruby_utils (~> 0.68)
185
195
  avm-files (0.3.2)
186
196
  avm (~> 0.6)
187
197
  eac_fs (~> 0.5)
@@ -268,7 +278,7 @@ GEM
268
278
  rainbow (3.1.1)
269
279
  rchardet (1.8.0)
270
280
  rexml (3.2.5)
271
- rouge (3.29.0)
281
+ rouge (3.30.0)
272
282
  rspec (3.11.0)
273
283
  rspec-core (~> 3.11.0)
274
284
  rspec-expectations (~> 3.11.0)
@@ -309,12 +319,14 @@ PLATFORMS
309
319
 
310
320
  DEPENDENCIES
311
321
  avm!
322
+ avm-eac_asciidoctor_base0!
312
323
  avm-eac_generic_base0!
313
324
  avm-eac_rails_base0!
314
325
  avm-eac_rails_base1!
315
326
  avm-eac_redmine_base0!
316
327
  avm-eac_redmine_plugin_base0!
317
328
  avm-eac_ruby_base1!
329
+ avm-eac_webapp_base0!
318
330
  avm-tools!
319
331
  eac_cli!
320
332
  eac_config!
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacTools
4
- VERSION = '0.12.0'
4
+ VERSION = '0.15.0'
5
5
  end
data/sub/avm/avm.gemspec CHANGED
@@ -13,10 +13,10 @@ 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
+ s.add_dependency 'eac_config', '~> 0.10'
17
17
  s.add_dependency 'eac_docker', '~> 0.3'
18
18
  s.add_dependency 'eac_git', '~> 0.6'
19
- s.add_dependency 'eac_ruby_utils', '~> 0.95'
19
+ s.add_dependency 'eac_ruby_utils', '~> 0.97'
20
20
  s.add_dependency 'eac_templates', '~> 0.1', '>= 0.1.1'
21
21
  s.add_dependency 'filesize', '~> 0.2'
22
22
  s.add_dependency 'htmlbeautifier', '~> 1.3', '>= 1.3.1'
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/instances/entries'
3
+ require 'avm/entries/base'
4
4
  require 'avm/registry'
5
5
  require 'eac_ruby_utils/core_ext'
6
6
 
@@ -9,7 +9,7 @@ module Avm
9
9
  class Base
10
10
  enable_simple_cache
11
11
  require_sub __FILE__, include_modules: true
12
- include ::Avm::Instances::Entries
12
+ include ::Avm::Entries::Base
13
13
 
14
14
  LOCAL_INSTANCE_SUFFIX = 'dev'
15
15
 
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_config/node'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module Entries
8
+ module AutoValues
9
+ class Entry
10
+ class << self
11
+ def auto_value_method_name(suffix)
12
+ "auto_#{suffix.to_s.gsub('.', '_')}"
13
+ end
14
+ end
15
+
16
+ common_constructor :entries_provider, :suffix
17
+
18
+ def auto_value_method
19
+ self.class.auto_value_method_name(suffix)
20
+ end
21
+
22
+ def found?
23
+ entries_provider.respond_to?(auto_value_method, true)
24
+ end
25
+
26
+ def value
27
+ entries_provider.if_respond(auto_value_method)
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Entries
7
+ module AutoValues
8
+ require_sub __FILE__
9
+ end
10
+ end
11
+ end
@@ -1,17 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'eac_ruby_utils/core_ext'
4
- require 'avm/instances/entry'
4
+ require 'avm/entries/entry'
5
5
 
6
6
  module Avm
7
- module Instances
8
- module Entries
7
+ module Entries
8
+ module Base
9
+ def entries_provider_id
10
+ id
11
+ end
12
+
9
13
  def entry(suffix, options = {})
10
- ::Avm::Instances::Entry.new(self, suffix, options)
14
+ ::Avm::Entries::Entry.new(self, suffix, options)
11
15
  end
12
16
 
13
17
  def path_prefix
14
- @path_prefix ||= [id].freeze
18
+ @path_prefix ||= [entries_provider_id].freeze
15
19
  end
16
20
 
17
21
  def read_entry(entry_suffix, options = {})
@@ -1,25 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/entries/auto_values/entry'
3
4
  require 'eac_config/node'
4
5
  require 'eac_ruby_utils/core_ext'
5
6
 
6
7
  module Avm
7
- module Instances
8
+ module Entries
8
9
  class Entry
9
- class << self
10
- def auto_value_method_name(suffix)
11
- "auto_#{suffix.to_s.gsub('.', '_')}"
12
- end
13
- end
14
-
15
10
  common_constructor :parent, :suffix, :options
16
11
 
17
12
  def auto_value
18
- parent.respond_to?(auto_value_method, true) ? parent.send(auto_value_method) : nil
19
- end
20
-
21
- def auto_value_method
22
- self.class.auto_value_method_name(suffix)
13
+ ::Avm::Entries::AutoValues::Entry.new(parent, suffix).value
23
14
  end
24
15
 
25
16
  def full_path
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Entries
7
+ require_sub __FILE__
8
+ end
9
+ end
@@ -6,11 +6,11 @@ module Avm
6
6
  module AutoValues
7
7
  module Admin
8
8
  def auto_admin_email
9
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'admin.email')
9
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, 'admin.email')
10
10
  end
11
11
 
12
12
  def auto_admin_name
13
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'admin.name')
13
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, 'admin.name')
14
14
  end
15
15
  end
16
16
  end
@@ -61,7 +61,7 @@ module Avm
61
61
  def database_auto_common(suffix)
62
62
  database_key = ::Avm::Instances::EntryKeys.const_get("database_#{suffix}".upcase)
63
63
  inherited_entry_value(::Avm::Instances::EntryKeys::DATABASE_ID, database_key) ||
64
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, database_key)
64
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, database_key)
65
65
  end
66
66
 
67
67
  def database_port_by_system
@@ -8,29 +8,30 @@ module Avm
8
8
  module AutoValues
9
9
  module Filesystem
10
10
  def auto_fs_path
11
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
11
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
12
12
  ::Avm::Instances::EntryKeys::FS_PATH) { |v| v + '/' + id }
13
13
  end
14
14
 
15
15
  def auto_data_fs_path
16
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
16
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
17
17
  ::Avm::Instances::EntryKeys::DATA_FS_PATH) { |v| v + '/' + id }
18
18
  end
19
19
 
20
20
  def auto_fs_url
21
- auto_fs_url_with_ssh || auto_fs_url_without_ssh
21
+ auto_fs_url_with_install || auto_fs_url_without_install
22
22
  end
23
23
 
24
- def auto_fs_url_with_ssh
25
- read_entry_optional('ssh.url').if_present do |ssh_url|
24
+ def auto_fs_url_with_install
25
+ read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_URL)
26
+ .if_present do |install_url|
26
27
  read_entry_optional('fs_path').if_present do |fs_path|
27
- "#{ssh_url}#{fs_path}"
28
+ "#{install_url}#{fs_path}"
28
29
  end
29
30
  end
30
31
  end
31
32
 
32
- def auto_fs_url_without_ssh
33
- return nil if read_entry_optional('ssh.url').present?
33
+ def auto_fs_url_without_install
34
+ return nil if read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_URL).present?
34
35
 
35
36
  read_entry_optional('fs_path').if_present do |fs_path|
36
37
  "file://#{fs_path}"
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/instances/entry_keys'
4
+
5
+ module Avm
6
+ module Instances
7
+ class Base
8
+ module AutoValues
9
+ module Install
10
+ def auto_access
11
+ read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_URL).present? ? 'ssh' : 'local'
12
+ end
13
+
14
+ def auto_install_hostname
15
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
16
+ ::Avm::Instances::EntryKeys::INSTALL_HOSTNAME)
17
+ end
18
+
19
+ def auto_install_port
20
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
21
+ ::Avm::Instances::EntryKeys::INSTALL_PORT) || 22
22
+ end
23
+
24
+ def auto_install_username
25
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
26
+ ::Avm::Instances::EntryKeys::INSTALL_USERNAME)
27
+ end
28
+
29
+ def auto_install_url
30
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
31
+ ::Avm::Instances::EntryKeys::INSTALL_URL) ||
32
+ auto_install_url_by_parts
33
+ end
34
+
35
+ def auto_install_url_by_parts
36
+ read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_HOSTNAME).if_present do |a|
37
+ a = read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_USERNAME)
38
+ .if_present(a) { |v| "#{v}@#{a}" }
39
+ a = read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_PORT)
40
+ .if_present(a) { |v| "#{a}:#{v}" }
41
+ "ssh://#{a}"
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/instances/entry'
3
+ require 'avm/entries/auto_values/entry'
4
+ require 'avm/entries/entry'
4
5
  require 'avm/instances/entry_keys'
5
6
 
6
7
  module Avm
@@ -11,15 +12,15 @@ module Avm
11
12
  ::Avm::Instances::EntryKeys.all.select { |c| c.to_s.start_with?('mailer.') }
12
13
  .reject { |c| c == ::Avm::Instances::EntryKeys::MAILER_ID }
13
14
  .each do |mailer_key|
14
- define_method ::Avm::Instances::Entry.auto_value_method_name(mailer_key) do
15
+ define_method ::Avm::Entries::AutoValues::Entry.auto_value_method_name(mailer_key) do
15
16
  mailer_auto_common(mailer_key)
16
17
  end
17
18
  end
18
19
 
19
20
  def auto_mailer_id
20
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
21
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
21
22
  ::Avm::Instances::EntryKeys::MAILER_ID) ||
22
- read_entry_optional(::Avm::Instances::EntryKeys::HOST_ID)
23
+ read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_ID)
23
24
  end
24
25
 
25
26
  private
@@ -6,7 +6,7 @@ module Avm
6
6
  module AutoValues
7
7
  module Ruby
8
8
  def auto_ruby_version
9
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'ruby.version')
9
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, 'ruby.version')
10
10
  end
11
11
  end
12
12
  end
@@ -8,12 +8,12 @@ module Avm
8
8
  module AutoValues
9
9
  module System
10
10
  def auto_system_username
11
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'system.username') ||
12
- read_entry_optional('ssh.username')
11
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, 'system.username') ||
12
+ read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_USERNAME)
13
13
  end
14
14
 
15
15
  def auto_system_groupname
16
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'system.groupname') ||
16
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, 'system.groupname') ||
17
17
  read_entry_optional('system.username')
18
18
  end
19
19
  end
@@ -1,16 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/require_sub'
4
- ::EacRubyUtils.require_sub(__FILE__)
3
+ require 'eac_ruby_utils/core_ext'
5
4
 
6
5
  module Avm
7
6
  module Instances
8
7
  class Base
9
8
  module AutoValues
10
- extend ::ActiveSupport::Concern
9
+ require_sub __FILE__
11
10
 
12
- included do
13
- %w[Access Admin Data Database Filesystem Mailer Ruby Source System Web]
11
+ common_concern do
12
+ %w[Admin Data Database Filesystem Install Mailer Ruby Source System Web]
14
13
  .each do |class_name|
15
14
  include const_get(class_name)
16
15
  end
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/with_application_stereotype'
4
- require 'avm/with_dynamic_runners'
3
+ require 'avm/with/application_stereotype'
4
+ require 'avm/with/extra_subcommands'
5
5
  require 'eac_ruby_utils/require_sub'
6
6
  require 'eac_ruby_utils/simple_cache'
7
- require 'avm/instances/entries'
7
+ require 'avm/entries/base'
8
8
 
9
9
  module Avm
10
10
  module Instances
@@ -13,9 +13,9 @@ module Avm
13
13
  enable_listable
14
14
  enable_simple_cache
15
15
  require_sub __FILE__, include_modules: true
16
- include ::Avm::Instances::Entries
17
- include ::Avm::WithDynamicRunners
18
- include ::Avm::WithApplicationStereotype
16
+ include ::Avm::Entries::Base
17
+ include ::Avm::With::ExtraSubcommands
18
+ include ::Avm::With::ApplicationStereotype
19
19
 
20
20
  lists.add_string :access, :local, :ssh
21
21
 
@@ -51,11 +51,11 @@ module Avm
51
51
  end
52
52
 
53
53
  def host_env_uncached
54
- access = read_entry(:access, list: ::Avm::Instances::Base.lists.access.values)
55
- case access
54
+ install_uri = entry(::Avm::Instances::EntryKeys::INSTALL_URL).value.to_uri
55
+ case install_uri.scheme
56
56
  when 'local' then ::EacRubyUtils::Envs.local
57
- when 'ssh' then ::EacRubyUtils::Envs.ssh(read_entry('ssh.url'))
58
- else raise("Unmapped access value: \"#{access}\"")
57
+ when 'ssh' then ::EacRubyUtils::Envs.ssh(install_uri)
58
+ else raise("Unmapped access value: \"#{install_uri}\"")
59
59
  end
60
60
  end
61
61
 
@@ -5,6 +5,8 @@ require 'eac_ruby_utils/core_ext'
5
5
  module Avm
6
6
  module Instances
7
7
  module EntryKeys
8
+ URI_FIELDS = %i[fragment hostname password path port query scheme url username].freeze
9
+
8
10
  class << self
9
11
  def all
10
12
  all_keys.to_a
@@ -42,18 +44,17 @@ module Avm
42
44
  end
43
45
 
44
46
  {
45
- '' => %w[data_fs_path fs_path host_id name source_instance_id],
46
- admin: %w[username password api_key],
47
- database: %w[id hostname limit name password port system timeout username extra],
47
+ '' => %w[data_fs_path fs_path name source_instance_id],
48
+ admin: URI_FIELDS + %w[api_key],
49
+ database: URI_FIELDS + %w[id limit name system timeout extra],
48
50
  docker: %w[registry],
49
51
  fs: %w[url],
52
+ install: URI_FIELDS + %w[id],
50
53
  mailer: {
51
54
  '' => %w[id from reply_to],
52
- smtp: %w[address port domain username password authentication openssl_verify_mode
53
- starttls_auto tls]
55
+ smtp: URI_FIELDS + %w[address domain authentication openssl_verify_mode starttls_auto tls]
54
56
  },
55
- ssh: %w[hostname port url username],
56
- web: %w[authority hostname path port scheme url userinfo]
57
+ web: URI_FIELDS + %w[authority userinfo]
57
58
  }.each { |prefix, suffixes| keys_consts_set(prefix, suffixes) }
58
59
  end
59
60
  end
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'eac_ruby_utils/core_ext'
4
+
3
5
  module Avm
4
6
  module Instances
5
- require 'avm/applications/base'
6
- require 'avm/instances/entries'
7
+ require_sub __FILE__
7
8
  end
8
9
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/with_application_stereotype'
3
+ require 'avm/with/application_stereotype'
4
4
  require 'eac_ruby_utils/core_ext'
5
5
 
6
6
  module Avm
@@ -8,7 +8,7 @@ module Avm
8
8
  class Base
9
9
  enable_abstract_methods
10
10
  enable_simple_cache
11
- include ::Avm::WithApplicationStereotype
11
+ include ::Avm::With::ApplicationStereotype
12
12
  abstract_methods :update, :valid?
13
13
  common_constructor :path do
14
14
  self.path = path.to_pathname
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/with_application_stereotype'
3
+ require 'avm/with/application_stereotype'
4
4
  require 'eac_ruby_utils/core_ext'
5
5
 
6
6
  module Avm
7
7
  module SourceGenerators
8
8
  class Base
9
- include ::Avm::WithApplicationStereotype
9
+ include ::Avm::With::ApplicationStereotype
10
10
  common_constructor :target_path do
11
11
  self.target_path = target_path.to_pathname
12
12
  end