avm-tools 0.119.0 → 0.120.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avm/projects/stereotypes/ruby_gem/local_project_mixin.rb +3 -3
  3. data/lib/avm/tools/app_src.rb +1 -5
  4. data/lib/avm/tools/runner/app_src/ruby.rb +0 -1
  5. data/lib/avm/tools/version.rb +1 -1
  6. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/sources/base.rb +2 -2
  7. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/version.rb +1 -1
  8. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/base.rb +3 -3
  9. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
  10. metadata +6 -232
  11. data/lib/avm/patches/eac_ruby_gems_utils/gem.rb +0 -29
  12. data/lib/avm/patches/eac_ruby_gems_utils.rb +0 -4
  13. data/sub/avm/Gemfile +0 -5
  14. data/sub/avm/avm.gemspec +0 -26
  15. data/sub/avm/lib/avm/data/instance/files_unit.rb +0 -40
  16. data/sub/avm/lib/avm/data/instance/package.rb +0 -18
  17. data/sub/avm/lib/avm/data/instance/unit.rb +0 -17
  18. data/sub/avm/lib/avm/data/instance.rb +0 -11
  19. data/sub/avm/lib/avm/data/package/dump.rb +0 -119
  20. data/sub/avm/lib/avm/data/package/load.rb +0 -48
  21. data/sub/avm/lib/avm/data/package.rb +0 -42
  22. data/sub/avm/lib/avm/data/rotate.rb +0 -107
  23. data/sub/avm/lib/avm/data/unit.rb +0 -94
  24. data/sub/avm/lib/avm/docker/container.rb +0 -50
  25. data/sub/avm/lib/avm/docker/image.rb +0 -71
  26. data/sub/avm/lib/avm/docker/runner.rb +0 -125
  27. data/sub/avm/lib/avm/docker.rb +0 -9
  28. data/sub/avm/lib/avm/executables.rb +0 -24
  29. data/sub/avm/lib/avm/instances/application.rb +0 -29
  30. data/sub/avm/lib/avm/instances/base/auto_values/access.rb +0 -40
  31. data/sub/avm/lib/avm/instances/base/auto_values/admin.rb +0 -19
  32. data/sub/avm/lib/avm/instances/base/auto_values/data.rb +0 -26
  33. data/sub/avm/lib/avm/instances/base/auto_values/database.rb +0 -76
  34. data/sub/avm/lib/avm/instances/base/auto_values/filesystem.rb +0 -43
  35. data/sub/avm/lib/avm/instances/base/auto_values/mailer.rb +0 -34
  36. data/sub/avm/lib/avm/instances/base/auto_values/ruby.rb +0 -15
  37. data/sub/avm/lib/avm/instances/base/auto_values/source.rb +0 -15
  38. data/sub/avm/lib/avm/instances/base/auto_values/system.rb +0 -23
  39. data/sub/avm/lib/avm/instances/base/auto_values/web.rb +0 -46
  40. data/sub/avm/lib/avm/instances/base/auto_values.rb +0 -21
  41. data/sub/avm/lib/avm/instances/base/dockerizable.rb +0 -45
  42. data/sub/avm/lib/avm/instances/base/entry_keys.rb +0 -22
  43. data/sub/avm/lib/avm/instances/base.rb +0 -64
  44. data/sub/avm/lib/avm/instances/docker_image.rb +0 -15
  45. data/sub/avm/lib/avm/instances/entries.rb +0 -43
  46. data/sub/avm/lib/avm/instances/entry.rb +0 -60
  47. data/sub/avm/lib/avm/instances/entry_keys.rb +0 -60
  48. data/sub/avm/lib/avm/instances/runner.rb +0 -39
  49. data/sub/avm/lib/avm/instances.rb +0 -8
  50. data/sub/avm/lib/avm/jobs/base.rb +0 -63
  51. data/sub/avm/lib/avm/jobs/variables_source.rb +0 -22
  52. data/sub/avm/lib/avm/jobs.rb +0 -9
  53. data/sub/avm/lib/avm/launcher/errors/base.rb +0 -10
  54. data/sub/avm/lib/avm/launcher/errors/non_project.rb +0 -15
  55. data/sub/avm/lib/avm/launcher/paths/real.rb +0 -44
  56. data/sub/avm/lib/avm/launcher/publish/check_result.rb +0 -67
  57. data/sub/avm/lib/avm/path_string.rb +0 -27
  58. data/sub/avm/lib/avm/registry/base.rb +0 -67
  59. data/sub/avm/lib/avm/registry.rb +0 -29
  60. data/sub/avm/lib/avm/result.rb +0 -86
  61. data/sub/avm/lib/avm/rspec/setup.rb +0 -22
  62. data/sub/avm/lib/avm/rspec/shared_examples/in_avm_registry.rb +0 -11
  63. data/sub/avm/lib/avm/rspec/shared_examples/not_in_avm_registry.rb +0 -14
  64. data/sub/avm/lib/avm/rspec.rb +0 -9
  65. data/sub/avm/lib/avm/runners/base.rb +0 -27
  66. data/sub/avm/lib/avm/scms/base.rb +0 -46
  67. data/sub/avm/lib/avm/scms/commit.rb +0 -43
  68. data/sub/avm/lib/avm/scms/inflector.rb +0 -22
  69. data/sub/avm/lib/avm/self/docker_image.rb +0 -14
  70. data/sub/avm/lib/avm/self/instance/entry_keys.rb +0 -12
  71. data/sub/avm/lib/avm/self/instance.rb +0 -31
  72. data/sub/avm/lib/avm/sources/base/configuration.rb +0 -45
  73. data/sub/avm/lib/avm/sources/base/instance.rb +0 -28
  74. data/sub/avm/lib/avm/sources/base/parent.rb +0 -31
  75. data/sub/avm/lib/avm/sources/base/subs.rb +0 -55
  76. data/sub/avm/lib/avm/sources/base/subs_paths.rb +0 -32
  77. data/sub/avm/lib/avm/sources/base/testing.rb +0 -21
  78. data/sub/avm/lib/avm/sources/base.rb +0 -54
  79. data/sub/avm/lib/avm/sources/configuration/locale.rb +0 -18
  80. data/sub/avm/lib/avm/sources/configuration/rubocop.rb +0 -26
  81. data/sub/avm/lib/avm/sources/configuration/tests.rb +0 -29
  82. data/sub/avm/lib/avm/sources/configuration.rb +0 -59
  83. data/sub/avm/lib/avm/sources/tester.rb +0 -24
  84. data/sub/avm/lib/avm/sources/tests/builder.rb +0 -83
  85. data/sub/avm/lib/avm/sources/tests/performer.rb +0 -35
  86. data/sub/avm/lib/avm/sources/tests/result.rb +0 -15
  87. data/sub/avm/lib/avm/sources/tests/single.rb +0 -56
  88. data/sub/avm/lib/avm/sources/tests.rb +0 -11
  89. data/sub/avm/lib/avm/sources.rb +0 -9
  90. data/sub/avm/lib/avm/sync.rb +0 -94
  91. data/sub/avm/lib/avm/version.rb +0 -5
  92. data/sub/avm/lib/avm/version_number.rb +0 -45
  93. data/sub/avm/lib/avm.rb +0 -7
  94. data/sub/avm/spec/lib/avm/scms/base_spec.rb +0 -7
  95. data/sub/avm/spec/lib/avm/sources/base_spec.rb +0 -7
  96. data/sub/avm/spec/rubocop_spec.rb +0 -3
  97. data/sub/avm/spec/spec_helper.rb +0 -4
  98. data/sub/avm-eac_rails_base1/Gemfile +0 -5
  99. data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +0 -21
  100. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/apache_host.rb +0 -17
  101. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instance.rb +0 -24
  102. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/bundle.rb +0 -26
  103. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/code_runner.rb +0 -26
  104. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb +0 -43
  105. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/logs/clear.rb +0 -26
  106. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/logs.rb +0 -18
  107. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/rails_server.rb +0 -32
  108. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/tasks_scheduler/systemd_unit.rb +0 -46
  109. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/tasks_scheduler.rb +0 -17
  110. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner.rb +0 -12
  111. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/bundle.rb +0 -27
  112. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/rails_environment.rb +0 -47
  113. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/sources/base.rb +0 -27
  114. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit/service.rb +0 -70
  115. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.rb +0 -29
  116. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit.rb +0 -57
  117. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +0 -7
  118. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1.rb +0 -9
  119. data/sub/avm-eac_rails_base1/spec/rubocop_spec.rb +0 -3
  120. data/sub/avm-eac_rails_base1/spec/spec_helper.rb +0 -4
  121. data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/systemd_unit/tasks_scheduler.service +0 -12
  122. data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.sh +0 -6
  123. data/sub/avm-eac_ruby_base1/Gemfile +0 -5
  124. data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +0 -22
  125. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile/add_or_replace_gem_line.rb +0 -56
  126. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile/dependency.rb +0 -19
  127. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile.rb +0 -34
  128. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/depends_on.rb +0 -25
  129. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/gem_conflict.rb +0 -44
  130. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/in_gemfile.rb +0 -17
  131. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/line_buffer.rb +0 -73
  132. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/line_factory.rb +0 -31
  133. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/line_parser_base.rb +0 -19
  134. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/version_requirement.rb +0 -26
  135. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser.rb +0 -25
  136. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler.rb +0 -11
  137. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/configured.rb +0 -31
  138. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/envvar.rb +0 -17
  139. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/gemfile.rb +0 -41
  140. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop.rb +0 -55
  141. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/bundle_command.rb +0 -39
  142. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/bundler.rb +0 -39
  143. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/version_bump.rb +0 -23
  144. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb +0 -55
  145. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners/bundler/incompatible.rb +0 -76
  146. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners/bundler.rb +0 -19
  147. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners.rb +0 -13
  148. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/tester.rb +0 -38
  149. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update/sub_update.rb +0 -56
  150. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb +0 -52
  151. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources.rb +0 -11
  152. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +0 -7
  153. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1.rb +0 -9
  154. data/sub/avm-eac_ruby_base1/locale/en.yml +0 -8
  155. data/sub/avm-eac_ruby_base1/locale/pt-BR.yml +0 -8
  156. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/bundler/incompatible_parser_spec.rb +0 -7
  157. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/bundler/incompatible_parser_spec_files/1.source.out +0 -192
  158. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/bundler/incompatible_parser_spec_files/1.target.yaml +0 -300
  159. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/bundler/incompatible_parser_spec_files/2.source.out +0 -245
  160. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/bundler/incompatible_parser_spec_files/2.target.yaml +0 -355
  161. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/sources/base_spec.rb +0 -7
  162. data/sub/avm-eac_ruby_base1/spec/rubocop_spec.rb +0 -3
  163. data/sub/avm-eac_ruby_base1/spec/spec_helper.rb +0 -4
  164. data/sub/eac_ruby_base0/Gemfile +0 -5
  165. data/sub/eac_ruby_base0/eac_ruby_base0.gemspec +0 -21
  166. data/sub/eac_ruby_base0/lib/eac_ruby_base0/application.rb +0 -87
  167. data/sub/eac_ruby_base0/lib/eac_ruby_base0/application_xdg.rb +0 -34
  168. data/sub/eac_ruby_base0/lib/eac_ruby_base0/core_ext.rb +0 -5
  169. data/sub/eac_ruby_base0/lib/eac_ruby_base0/jobs_runner.rb +0 -31
  170. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/class/jobs_runner.rb +0 -10
  171. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/class.rb +0 -4
  172. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/object/runner_with.rb +0 -5
  173. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/object.rb +0 -5
  174. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches.rb +0 -4
  175. data/sub/eac_ruby_base0/lib/eac_ruby_base0/rspec/setup.rb +0 -14
  176. data/sub/eac_ruby_base0/lib/eac_ruby_base0/rspec.rb +0 -9
  177. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +0 -92
  178. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/confirmation.rb +0 -42
  179. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/filesystem_traverser.rb +0 -52
  180. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/input.rb +0 -36
  181. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/output.rb +0 -58
  182. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with.rb +0 -9
  183. data/sub/eac_ruby_base0/lib/eac_ruby_base0/version.rb +0 -5
  184. data/sub/eac_ruby_base0/lib/eac_ruby_base0.rb +0 -7
  185. data/sub/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/confirmation_spec.rb +0 -42
  186. data/sub/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/output_spec.rb +0 -81
  187. data/sub/eac_ruby_base0/spec/rubocop_spec.rb +0 -3
  188. data/sub/eac_ruby_base0/spec/spec_helper.rb +0 -4
  189. data/sub/eac_ruby_gems_utils/Gemfile +0 -5
  190. data/sub/eac_ruby_gems_utils/LICENCE +0 -16
  191. data/sub/eac_ruby_gems_utils/README.rdoc +0 -3
  192. data/sub/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +0 -31
  193. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/command.rb +0 -33
  194. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/version_file.rb +0 -41
  195. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem.rb +0 -97
  196. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/base.rb +0 -57
  197. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/minitest.rb +0 -25
  198. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/decorated_gem.rb +0 -48
  199. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/result.rb +0 -25
  200. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple.rb +0 -84
  201. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/rspec.rb +0 -21
  202. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests.rb +0 -9
  203. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +0 -5
  204. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils.rb +0 -7
  205. data/sub/eac_ruby_gems_utils/spec/code/rubocop_check_spec.rb +0 -3
  206. data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec.rb +0 -14
  207. data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec_files/a_version_file.rb +0 -7
  208. data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem_spec.rb +0 -20
  209. data/sub/eac_ruby_gems_utils/spec/spec_helper.rb +0 -4
  210. data/sub/eac_ruby_gems_utils/spec/support/mygem/Gemfile +0 -5
  211. data/sub/eac_ruby_gems_utils/spec/support/mygem/Gemfile.lock +0 -19
  212. data/sub/eac_ruby_gems_utils/spec/support/mygem/Rakefile +0 -14
  213. data/sub/eac_ruby_gems_utils/spec/support/mygem/exe/myrunner +0 -5
  214. data/sub/eac_ruby_gems_utils/spec/support/mygem/lib/mygem/version.rb +0 -5
  215. data/sub/eac_ruby_gems_utils/spec/support/mygem/lib/mygem.rb +0 -5
  216. data/sub/eac_ruby_gems_utils/spec/support/mygem/mygem.gemspec +0 -16
@@ -1,60 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module Instances
7
- module EntryKeys
8
- class << self
9
- def all
10
- all_keys.to_a
11
- end
12
-
13
- def keys_consts_set(prefix, suffixes)
14
- if suffixes.is_a?(::Hash)
15
- keys_consts_set_from_hash(prefix, suffixes)
16
- elsif suffixes.is_a?(::Enumerable)
17
- keys_consts_set_from_enum(prefix, suffixes)
18
- else
19
- raise "Unmapped suffixes class: #{suffixes.class}"
20
- end
21
- end
22
-
23
- def key_const_set(prefix, suffix)
24
- key = [prefix, suffix].reject(&:blank?).join('.')
25
- const_set(key.gsub('.', '_').upcase, key)
26
- all_keys << key
27
- end
28
-
29
- private
30
-
31
- def all_keys
32
- @all_keys ||= ::Set.new
33
- end
34
-
35
- def keys_consts_set_from_enum(prefix, suffixes)
36
- suffixes.each { |suffix| key_const_set(prefix, suffix) }
37
- end
38
-
39
- def keys_consts_set_from_hash(prefix, suffixes)
40
- suffixes.each { |k, v| keys_consts_set(prefix.to_s + (k.blank? ? '' : ".#{k}"), v) }
41
- end
42
- end
43
-
44
- {
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],
48
- docker: %w[registry],
49
- fs: %w[url],
50
- mailer: {
51
- '' => %w[id from reply_to],
52
- smtp: %w[address port domain username password authentication openssl_verify_mode
53
- starttls_auto tls]
54
- },
55
- ssh: %w[hostname port url username],
56
- web: %w[authority hostname path port scheme url userinfo]
57
- }.each { |prefix, suffixes| keys_consts_set(prefix, suffixes) }
58
- end
59
- end
60
- end
@@ -1,39 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/runners/base'
4
- require 'eac_cli/core_ext'
5
-
6
- module Avm
7
- module Instances
8
- class Runner < ::Avm::Runners::Base
9
- class << self
10
- def instance_class
11
- ::Avm.const_get(stereotype_name).const_get('Instance')
12
- end
13
-
14
- def stereotype_module
15
- ::Avm.const_get(stereotype_name)
16
- end
17
-
18
- def stereotype_name
19
- name.demodulize
20
- end
21
- end
22
-
23
- description = "Utilities for #{stereotype_name} instances."
24
- runner_with :help, :subcommands do
25
- desc description
26
- pos_arg 'instance-id'
27
- subcommands
28
- end
29
-
30
- delegate :instance_class, :stereotype_module, :stereotype_name, to: :class
31
-
32
- private
33
-
34
- def instance_uncached
35
- self.class.instance_class.by_id(parsed.instance_id)
36
- end
37
- end
38
- end
39
- end
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module Instances
5
- require 'avm/instances/application'
6
- require 'avm/instances/entries'
7
- end
8
- end
@@ -1,63 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/jobs/variables_source'
4
- require 'avm/result'
5
- require 'eac_cli/core_ext'
6
-
7
- module Avm
8
- module Jobs
9
- module Base
10
- common_concern do
11
- include ::ActiveSupport::Callbacks
12
-
13
- enable_speaker
14
- enable_simple_cache
15
- enable_listable
16
- common_constructor :instance, :options, default: [{}] do
17
- if option_list.present?
18
- self.options = option_list.hash_keys_validate!(options.symbolize_keys)
19
- end
20
- end
21
- define_callbacks(*jobs)
22
- end
23
-
24
- module ClassMethods
25
- def jobs
26
- const_get('JOBS').dup
27
- end
28
- end
29
-
30
- module InstanceMethods
31
- def option_list
32
- nil
33
- end
34
-
35
- def run
36
- start_banner if respond_to?(:start_banner)
37
- run_jobs
38
- ::Avm::Result.success('Done!')
39
- rescue ::Avm::Result::Error => e
40
- e.to_result
41
- end
42
-
43
- def variables_source
44
- ::Avm::Jobs::VariablesSource.new(self, instance)
45
- end
46
-
47
- protected
48
-
49
- def run_jobs
50
- jobs.each do |job|
51
- run_callbacks job do
52
- send(job)
53
- end
54
- end
55
- end
56
-
57
- def jobs
58
- self.class.jobs
59
- end
60
- end
61
- end
62
- end
63
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module Jobs
7
- class VariablesSource
8
- common_constructor :job, :instance
9
-
10
- def read_entry(path, options = {})
11
- entry_from_job(path) || instance.read_entry(path, options)
12
- end
13
-
14
- private
15
-
16
- def entry_from_job(path)
17
- method = path.gsub('.', '_').underscore
18
- return job.send(method) if job.respond_to?(method, true)
19
- end
20
- end
21
- end
22
- end
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module Jobs
7
- require_sub __FILE__
8
- end
9
- end
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module Launcher
5
- module Errors
6
- class Base < ::StandardError
7
- end
8
- end
9
- end
10
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/launcher/errors/base'
4
-
5
- module Avm
6
- module Launcher
7
- module Errors
8
- class NonProject < ::Avm::Launcher::Errors::Base
9
- def initialize(path)
10
- super("#{path} is not a project")
11
- end
12
- end
13
- end
14
- end
15
- end
@@ -1,44 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module Launcher
5
- module Paths
6
- class Real < String
7
- def initialize(path)
8
- raise "Argument path is not a string: \"#{path}\"|#{path.class}" unless path.is_a?(String)
9
-
10
- super(path)
11
- end
12
-
13
- def subpath(relative_path)
14
- ::Avm::Launcher::Paths::Real.new(::File.expand_path(relative_path, self))
15
- end
16
-
17
- def basename
18
- ::File.basename(self)
19
- end
20
-
21
- def dirname
22
- return nil if self == '/'
23
-
24
- self.class.new(::File.dirname(self))
25
- end
26
-
27
- def find_file_with_extension(extension)
28
- r = find_files_with_extension(extension)
29
- return r.first if r.any?
30
-
31
- raise "Extension \"#{extension}\" not found in directory \"#{self}\""
32
- end
33
-
34
- def find_files_with_extension(extension)
35
- r = []
36
- ::Dir.entries(self).each do |i|
37
- r << ::File.expand_path(i, self) if i =~ /#{::Regexp.quote(extension)}\z/
38
- end
39
- r
40
- end
41
- end
42
- end
43
- end
44
- end
@@ -1,67 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'active_support/concern' # Missing on "eac/listable"
4
- require 'active_support/hash_with_indifferent_access'
5
- require 'eac_ruby_utils/listable'
6
-
7
- module Avm
8
- module Launcher
9
- module Publish
10
- class CheckResult
11
- include ::EacRubyUtils::Listable
12
-
13
- lists.add_string :status, :updated, :pending, :blocked, :outdated
14
-
15
- lists.status.values.each do |status| # rubocop:disable Style/HashEachMethods
16
- class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
17
- def self.#{status}(message)
18
- new('#{status}', message)
19
- end
20
- RUBY_EVAL
21
- end
22
-
23
- class << self
24
- def pending_status?(status)
25
- [STATUS_PENDING].include?(status)
26
- end
27
-
28
- def updated_color
29
- 'green'
30
- end
31
-
32
- def pending_color
33
- 'yellow'
34
- end
35
-
36
- def blocked_color
37
- 'red'
38
- end
39
-
40
- def outdated_color
41
- 'light_blue'
42
- end
43
- end
44
-
45
- attr_reader :status, :message
46
-
47
- def initialize(status, message)
48
- raise "Status \"#{status}\" not in #{self.class.lists.status.values}" unless
49
- self.class.lists.status.values.include?(status)
50
-
51
- @status = status
52
- @message = message
53
- end
54
-
55
- def to_s
56
- message.light_white.send("on_#{background_color}")
57
- end
58
-
59
- private
60
-
61
- def background_color
62
- self.class.send("#{status}_color")
63
- end
64
- end
65
- end
66
- end
67
- end
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'active_support/core_ext/object/blank'
4
-
5
- module Avm
6
- # String with paths like PATH variable.
7
- # Note: the separator is not system dependent.
8
- class PathString < String
9
- SEPARATOR = ':'
10
-
11
- class << self
12
- # Shortcut for [Avm::Paths.new(string).paths].
13
- def paths(string)
14
- new(string).paths
15
- end
16
- end
17
-
18
- def initialize(string = nil)
19
- super(string.to_s)
20
- end
21
-
22
- # @return [Array] List of paths. Blank paths are rejected.
23
- def paths
24
- split(SEPARATOR).reject(&:blank?)
25
- end
26
- end
27
- end
@@ -1,67 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
- require 'eac_ruby_utils/gems_registry'
5
-
6
- module Avm
7
- module Registry
8
- class Base
9
- enable_simple_cache
10
- common_constructor :module_suffix
11
-
12
- def detect(*registered_initialize_args)
13
- detect_optional(*registered_initialize_args) ||
14
- raise("No registered module valid for #{registered_initialize_args}" \
15
- " (Module suffix: #{module_suffix}, Available: #{registered_modules.join(', ')})")
16
- end
17
-
18
- def detect_optional(*registered_initialize_args)
19
- registered_modules.reverse.lazy.map { |klass| klass.new(*registered_initialize_args) }
20
- .find(&:valid?)
21
- end
22
-
23
- def provider_module_suffix
24
- "#{module_suffix}::Provider"
25
- end
26
-
27
- def single_module_suffix
28
- "#{module_suffix}::Base"
29
- end
30
-
31
- def to_s
32
- "#{self.class}[#{module_suffix}]"
33
- end
34
-
35
- def valid_registered_module?(a_module)
36
- a_module.is_a?(::Class) && !a_module.abstract?
37
- end
38
-
39
- private
40
-
41
- def registered_modules_uncached
42
- registered_gems.flat_map { |registry| modules_from_registry(registry) }
43
- .select { |v| valid_registered_module?(v) }.uniq
44
- end
45
-
46
- def modules_from_registry(registry)
47
- if registry.registry.module_suffix == provider_module_suffix
48
- registry.registered_module.new.all
49
- else
50
- [registry.registered_module]
51
- end
52
- end
53
-
54
- def registered_gems
55
- (single_instance_registry.registered + provider_registry.registered).sort
56
- end
57
-
58
- def single_instance_registry_uncached
59
- ::EacRubyUtils::GemsRegistry.new(single_module_suffix)
60
- end
61
-
62
- def provider_registry_uncached
63
- ::EacRubyUtils::GemsRegistry.new(provider_module_suffix)
64
- end
65
- end
66
- end
67
- end
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
- require 'eac_ruby_utils/gems_registry'
5
-
6
- module Avm
7
- module Registry
8
- require_sub __FILE__
9
- enable_listable
10
- lists.add_symbol :category, :instance_stereotypes, :runners, :scms, :sources
11
-
12
- class << self
13
- enable_simple_cache
14
-
15
- # @return [Array<Avm::Registry::Base>]
16
- def registries
17
- lists.category.values.map { |c| send(c) }
18
- end
19
-
20
- private
21
-
22
- ::Avm::Registry.lists.category.each_value do |category|
23
- define_method "#{category}_uncached" do
24
- ::Avm::Registry::Base.new(category.to_s.camelize)
25
- end
26
- end
27
- end
28
- end
29
- end
@@ -1,86 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'colorized_string'
4
- require 'eac_ruby_utils/listable'
5
- require 'eac_ruby_utils/core_ext'
6
-
7
- module Avm
8
- class Result < ::SimpleDelegator
9
- include ::EacRubyUtils::Listable
10
-
11
- lists.add_string :type, :success, :error, :neutral, :pending, :outdated
12
-
13
- lists.type.values.each do |type| # rubocop:disable Style/HashEachMethods
14
- class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
15
- def self.#{type}(value)
16
- new(value, TYPE_#{type.upcase})
17
- end
18
- RUBY_EVAL
19
- end
20
-
21
- TYPE_SUCCESS_COLOR = 'green'
22
- TYPE_ERROR_COLOR = 'red'
23
- TYPE_NEUTRAL_COLOR = 'light_black'
24
- TYPE_PENDING_COLOR = 'yellow'
25
- TYPE_OUTDATED_COLOR = 'blue'
26
-
27
- class << self
28
- # Return Avm::Result.success(success_value) if +success+ is truthy.
29
- # Return Avm::Result.error(error_value || success_value) if +success+ is falsely.
30
- # @return [Avm::Result]
31
- def success_or_error(success, success_value, error_value = nil)
32
- if success
33
- self.success(success_value)
34
- else
35
- error(error_value.presence || success_value)
36
- end
37
- end
38
- end
39
-
40
- attr_reader :type
41
-
42
- def initialize(value, type)
43
- super(value)
44
- validate_type(type)
45
- @type = type
46
- end
47
-
48
- def label
49
- label_fg
50
- end
51
-
52
- def label_fg
53
- ColorizedString.new(to_s).send(type_color)
54
- end
55
-
56
- def label_bg
57
- ColorizedString.new(to_s).light_white.send("on_#{type_color}")
58
- end
59
-
60
- def type_color
61
- self.class.const_get("type_#{type}_color".upcase)
62
- end
63
-
64
- lists.type.values.each do |type| # rubocop:disable Style/HashEachMethods
65
- class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
66
- def #{type}?
67
- @type == '#{type}'
68
- end
69
- RUBY_EVAL
70
- end
71
-
72
- private
73
-
74
- def validate_type(type)
75
- return if self.class.lists.type.values.include?(type)
76
-
77
- raise "Tipo desconhecido: \"#{type}\" (Válido: #{self.class.lists.type.values.join(', ')})"
78
- end
79
-
80
- class Error < StandardError
81
- def to_result
82
- ::Avm::Result.error(message)
83
- end
84
- end
85
- end
86
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module Rspec
7
- module Setup
8
- def self.extended(obj)
9
- obj.setup_in_avm_registry_example
10
- obj.setup_not_in_avm_registry_example
11
- end
12
-
13
- def setup_in_avm_registry_example
14
- require 'avm/rspec/shared_examples/in_avm_registry'
15
- end
16
-
17
- def setup_not_in_avm_registry_example
18
- require 'avm/rspec/shared_examples/not_in_avm_registry'
19
- end
20
- end
21
- end
22
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/registry'
4
-
5
- ::RSpec.shared_examples 'in_avm_registry' do |registry_method|
6
- let(:avm_registry) { ::Avm::Registry.send(registry_method) }
7
-
8
- it 'is in the avm registry' do
9
- expect(avm_registry.registered_modules).to include(described_class)
10
- end
11
- end
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/registry'
4
-
5
- ::RSpec.shared_examples 'not_in_avm_registry' do |registry_method = nil|
6
- registry_method.if_present(::Avm::Registry.registries) { |v| [::Avm::Registry.send(v)] }
7
- .each do |registry|
8
- context "when registry is #{registry}" do
9
- it 'is not in the avm registry' do
10
- expect(registry.registered_modules).not_to include(described_class)
11
- end
12
- end
13
- end
14
- end
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module Rspec
7
- require_sub __FILE__
8
- end
9
- end
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_cli/core_ext'
4
-
5
- module Avm
6
- module Runners
7
- class Base
8
- enable_abstract_methods
9
-
10
- class << self
11
- def command_argument
12
- stereotype_name.underscore.dasherize
13
- end
14
-
15
- def stereotype_name
16
- name.split('::')[-3]
17
- end
18
- end
19
-
20
- delegate :command_argument, :stereotype_name, to: :class
21
-
22
- def to_s
23
- stereotype_name
24
- end
25
- end
26
- end
27
- end
@@ -1,46 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module Scms
7
- class Base
8
- enable_abstract_methods
9
- enable_simple_cache
10
- abstract_methods :update, :valid?
11
- common_constructor :path do
12
- self.path = path.to_pathname
13
- end
14
-
15
- # @return [Avm::Scms::Commit,NilClass]
16
- def commit_if_change(_message = nil)
17
- raise_abstract_method __method__
18
- end
19
-
20
- def name
21
- self.class.name.demodulize
22
- end
23
-
24
- # @return [Enumerable<Avm::Scms::Base>]
25
- def subs
26
- raise_abstract_method __method__
27
- end
28
-
29
- def to_s
30
- name
31
- end
32
-
33
- private
34
-
35
- # @return [Avm::Scms::Base]
36
- def parent_scm
37
- parent_path = path.parent
38
- until parent_path.root?
39
- ::Avm::Registry.scms.detect_optional(parent_path).if_present { |v| return v }
40
- parent_path = parent_path.parent
41
- end
42
- nil
43
- end
44
- end
45
- end
46
- end