avm-tools 0.120.0 → 0.120.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (212) 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/runner/app_src/ruby.rb +0 -1
  4. data/lib/avm/tools/version.rb +1 -1
  5. metadata +6 -233
  6. data/lib/avm/patches/eac_ruby_gems_utils/gem.rb +0 -29
  7. data/lib/avm/patches/eac_ruby_gems_utils.rb +0 -4
  8. data/sub/avm/Gemfile +0 -5
  9. data/sub/avm/avm.gemspec +0 -26
  10. data/sub/avm/lib/avm/data/instance/files_unit.rb +0 -40
  11. data/sub/avm/lib/avm/data/instance/package.rb +0 -18
  12. data/sub/avm/lib/avm/data/instance/unit.rb +0 -17
  13. data/sub/avm/lib/avm/data/instance.rb +0 -11
  14. data/sub/avm/lib/avm/data/package/dump.rb +0 -119
  15. data/sub/avm/lib/avm/data/package/load.rb +0 -48
  16. data/sub/avm/lib/avm/data/package.rb +0 -42
  17. data/sub/avm/lib/avm/data/rotate.rb +0 -107
  18. data/sub/avm/lib/avm/data/unit.rb +0 -94
  19. data/sub/avm/lib/avm/docker/container.rb +0 -50
  20. data/sub/avm/lib/avm/docker/image.rb +0 -71
  21. data/sub/avm/lib/avm/docker/runner.rb +0 -125
  22. data/sub/avm/lib/avm/docker.rb +0 -9
  23. data/sub/avm/lib/avm/executables.rb +0 -24
  24. data/sub/avm/lib/avm/instances/application.rb +0 -29
  25. data/sub/avm/lib/avm/instances/base/auto_values/access.rb +0 -40
  26. data/sub/avm/lib/avm/instances/base/auto_values/admin.rb +0 -19
  27. data/sub/avm/lib/avm/instances/base/auto_values/data.rb +0 -26
  28. data/sub/avm/lib/avm/instances/base/auto_values/database.rb +0 -76
  29. data/sub/avm/lib/avm/instances/base/auto_values/filesystem.rb +0 -43
  30. data/sub/avm/lib/avm/instances/base/auto_values/mailer.rb +0 -34
  31. data/sub/avm/lib/avm/instances/base/auto_values/ruby.rb +0 -15
  32. data/sub/avm/lib/avm/instances/base/auto_values/source.rb +0 -15
  33. data/sub/avm/lib/avm/instances/base/auto_values/system.rb +0 -23
  34. data/sub/avm/lib/avm/instances/base/auto_values/web.rb +0 -46
  35. data/sub/avm/lib/avm/instances/base/auto_values.rb +0 -21
  36. data/sub/avm/lib/avm/instances/base/dockerizable.rb +0 -45
  37. data/sub/avm/lib/avm/instances/base/entry_keys.rb +0 -22
  38. data/sub/avm/lib/avm/instances/base.rb +0 -64
  39. data/sub/avm/lib/avm/instances/docker_image.rb +0 -15
  40. data/sub/avm/lib/avm/instances/entries.rb +0 -43
  41. data/sub/avm/lib/avm/instances/entry.rb +0 -60
  42. data/sub/avm/lib/avm/instances/entry_keys.rb +0 -60
  43. data/sub/avm/lib/avm/instances/runner.rb +0 -39
  44. data/sub/avm/lib/avm/instances.rb +0 -8
  45. data/sub/avm/lib/avm/jobs/base.rb +0 -63
  46. data/sub/avm/lib/avm/jobs/variables_source.rb +0 -22
  47. data/sub/avm/lib/avm/jobs.rb +0 -9
  48. data/sub/avm/lib/avm/launcher/errors/base.rb +0 -10
  49. data/sub/avm/lib/avm/launcher/errors/non_project.rb +0 -15
  50. data/sub/avm/lib/avm/launcher/paths/real.rb +0 -44
  51. data/sub/avm/lib/avm/launcher/publish/check_result.rb +0 -67
  52. data/sub/avm/lib/avm/path_string.rb +0 -27
  53. data/sub/avm/lib/avm/registry/base.rb +0 -71
  54. data/sub/avm/lib/avm/registry/with_path.rb +0 -23
  55. data/sub/avm/lib/avm/registry.rb +0 -39
  56. data/sub/avm/lib/avm/result.rb +0 -86
  57. data/sub/avm/lib/avm/rspec/setup.rb +0 -22
  58. data/sub/avm/lib/avm/rspec/shared_examples/in_avm_registry.rb +0 -11
  59. data/sub/avm/lib/avm/rspec/shared_examples/not_in_avm_registry.rb +0 -14
  60. data/sub/avm/lib/avm/rspec.rb +0 -9
  61. data/sub/avm/lib/avm/runners/base.rb +0 -27
  62. data/sub/avm/lib/avm/scms/base.rb +0 -41
  63. data/sub/avm/lib/avm/scms/commit.rb +0 -43
  64. data/sub/avm/lib/avm/scms/inflector.rb +0 -22
  65. data/sub/avm/lib/avm/scms/null.rb +0 -14
  66. data/sub/avm/lib/avm/self/docker_image.rb +0 -14
  67. data/sub/avm/lib/avm/self/instance/entry_keys.rb +0 -12
  68. data/sub/avm/lib/avm/self/instance.rb +0 -31
  69. data/sub/avm/lib/avm/sources/base/configuration.rb +0 -55
  70. data/sub/avm/lib/avm/sources/base/instance.rb +0 -28
  71. data/sub/avm/lib/avm/sources/base/locale.rb +0 -26
  72. data/sub/avm/lib/avm/sources/base/parent.rb +0 -31
  73. data/sub/avm/lib/avm/sources/base/subs.rb +0 -55
  74. data/sub/avm/lib/avm/sources/base/subs_paths.rb +0 -32
  75. data/sub/avm/lib/avm/sources/base/testing.rb +0 -27
  76. data/sub/avm/lib/avm/sources/base.rb +0 -53
  77. data/sub/avm/lib/avm/sources/configuration/rubocop.rb +0 -26
  78. data/sub/avm/lib/avm/sources/configuration.rb +0 -59
  79. data/sub/avm/lib/avm/sources/tester.rb +0 -24
  80. data/sub/avm/lib/avm/sources/tests/builder.rb +0 -83
  81. data/sub/avm/lib/avm/sources/tests/performer.rb +0 -35
  82. data/sub/avm/lib/avm/sources/tests/result.rb +0 -15
  83. data/sub/avm/lib/avm/sources/tests/single.rb +0 -56
  84. data/sub/avm/lib/avm/sources/tests.rb +0 -11
  85. data/sub/avm/lib/avm/sources.rb +0 -9
  86. data/sub/avm/lib/avm/sync.rb +0 -94
  87. data/sub/avm/lib/avm/version.rb +0 -5
  88. data/sub/avm/lib/avm/version_number.rb +0 -45
  89. data/sub/avm/lib/avm.rb +0 -7
  90. data/sub/avm/spec/lib/avm/scms/base_spec.rb +0 -7
  91. data/sub/avm/spec/lib/avm/sources/base_spec.rb +0 -7
  92. data/sub/avm/spec/rubocop_spec.rb +0 -3
  93. data/sub/avm/spec/spec_helper.rb +0 -4
  94. data/sub/avm-eac_rails_base1/Gemfile +0 -5
  95. data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +0 -21
  96. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/apache_host.rb +0 -17
  97. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instance.rb +0 -24
  98. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/bundle.rb +0 -26
  99. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/code_runner.rb +0 -26
  100. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb +0 -43
  101. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/logs/clear.rb +0 -26
  102. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/logs.rb +0 -18
  103. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/rails_server.rb +0 -32
  104. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/tasks_scheduler/systemd_unit.rb +0 -46
  105. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/tasks_scheduler.rb +0 -17
  106. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner.rb +0 -12
  107. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/bundle.rb +0 -27
  108. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/rails_environment.rb +0 -47
  109. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/sources/base.rb +0 -27
  110. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit/service.rb +0 -70
  111. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.rb +0 -29
  112. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit.rb +0 -57
  113. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +0 -7
  114. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1.rb +0 -9
  115. data/sub/avm-eac_rails_base1/spec/rubocop_spec.rb +0 -3
  116. data/sub/avm-eac_rails_base1/spec/spec_helper.rb +0 -4
  117. data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/systemd_unit/tasks_scheduler.service +0 -12
  118. data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.sh +0 -6
  119. data/sub/avm-eac_ruby_base1/Gemfile +0 -5
  120. data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +0 -22
  121. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile/add_or_replace_gem_line.rb +0 -56
  122. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile/dependency.rb +0 -19
  123. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile.rb +0 -34
  124. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/depends_on.rb +0 -25
  125. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/gem_conflict.rb +0 -44
  126. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/in_gemfile.rb +0 -17
  127. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/line_buffer.rb +0 -73
  128. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/line_factory.rb +0 -31
  129. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/line_parser_base.rb +0 -19
  130. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/version_requirement.rb +0 -26
  131. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser.rb +0 -25
  132. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler.rb +0 -11
  133. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/configured.rb +0 -31
  134. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/envvar.rb +0 -17
  135. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/gemfile.rb +0 -41
  136. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop.rb +0 -55
  137. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/bundle_command.rb +0 -39
  138. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/bundler.rb +0 -39
  139. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/version_bump.rb +0 -23
  140. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb +0 -55
  141. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners/bundler/incompatible.rb +0 -76
  142. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners/bundler.rb +0 -19
  143. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners.rb +0 -13
  144. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/tester.rb +0 -38
  145. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update/sub_update.rb +0 -56
  146. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb +0 -52
  147. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources.rb +0 -11
  148. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +0 -7
  149. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1.rb +0 -9
  150. data/sub/avm-eac_ruby_base1/locale/en.yml +0 -8
  151. data/sub/avm-eac_ruby_base1/locale/pt-BR.yml +0 -8
  152. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/bundler/incompatible_parser_spec.rb +0 -7
  153. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/bundler/incompatible_parser_spec_files/1.source.out +0 -192
  154. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/bundler/incompatible_parser_spec_files/1.target.yaml +0 -300
  155. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/bundler/incompatible_parser_spec_files/2.source.out +0 -245
  156. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/bundler/incompatible_parser_spec_files/2.target.yaml +0 -355
  157. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/sources/base_spec.rb +0 -7
  158. data/sub/avm-eac_ruby_base1/spec/rubocop_spec.rb +0 -3
  159. data/sub/avm-eac_ruby_base1/spec/spec_helper.rb +0 -4
  160. data/sub/eac_ruby_base0/Gemfile +0 -5
  161. data/sub/eac_ruby_base0/eac_ruby_base0.gemspec +0 -21
  162. data/sub/eac_ruby_base0/lib/eac_ruby_base0/application.rb +0 -87
  163. data/sub/eac_ruby_base0/lib/eac_ruby_base0/application_xdg.rb +0 -34
  164. data/sub/eac_ruby_base0/lib/eac_ruby_base0/core_ext.rb +0 -5
  165. data/sub/eac_ruby_base0/lib/eac_ruby_base0/jobs_runner.rb +0 -31
  166. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/class/jobs_runner.rb +0 -10
  167. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/class.rb +0 -4
  168. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/object/runner_with.rb +0 -5
  169. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/object.rb +0 -5
  170. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches.rb +0 -4
  171. data/sub/eac_ruby_base0/lib/eac_ruby_base0/rspec/setup.rb +0 -14
  172. data/sub/eac_ruby_base0/lib/eac_ruby_base0/rspec.rb +0 -9
  173. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +0 -92
  174. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/confirmation.rb +0 -42
  175. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/filesystem_traverser.rb +0 -52
  176. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/input.rb +0 -36
  177. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/output.rb +0 -58
  178. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with.rb +0 -9
  179. data/sub/eac_ruby_base0/lib/eac_ruby_base0/version.rb +0 -5
  180. data/sub/eac_ruby_base0/lib/eac_ruby_base0.rb +0 -7
  181. data/sub/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/confirmation_spec.rb +0 -42
  182. data/sub/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/output_spec.rb +0 -81
  183. data/sub/eac_ruby_base0/spec/rubocop_spec.rb +0 -3
  184. data/sub/eac_ruby_base0/spec/spec_helper.rb +0 -4
  185. data/sub/eac_ruby_gems_utils/Gemfile +0 -5
  186. data/sub/eac_ruby_gems_utils/LICENCE +0 -16
  187. data/sub/eac_ruby_gems_utils/README.rdoc +0 -3
  188. data/sub/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +0 -31
  189. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/command.rb +0 -33
  190. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/version_file.rb +0 -41
  191. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem.rb +0 -97
  192. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/base.rb +0 -57
  193. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/minitest.rb +0 -25
  194. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/decorated_gem.rb +0 -48
  195. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/result.rb +0 -25
  196. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple.rb +0 -84
  197. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/rspec.rb +0 -21
  198. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests.rb +0 -9
  199. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +0 -5
  200. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils.rb +0 -7
  201. data/sub/eac_ruby_gems_utils/spec/code/rubocop_check_spec.rb +0 -3
  202. data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec.rb +0 -14
  203. data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec_files/a_version_file.rb +0 -7
  204. data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem_spec.rb +0 -20
  205. data/sub/eac_ruby_gems_utils/spec/spec_helper.rb +0 -4
  206. data/sub/eac_ruby_gems_utils/spec/support/mygem/Gemfile +0 -5
  207. data/sub/eac_ruby_gems_utils/spec/support/mygem/Gemfile.lock +0 -19
  208. data/sub/eac_ruby_gems_utils/spec/support/mygem/Rakefile +0 -14
  209. data/sub/eac_ruby_gems_utils/spec/support/mygem/exe/myrunner +0 -5
  210. data/sub/eac_ruby_gems_utils/spec/support/mygem/lib/mygem/version.rb +0 -5
  211. data/sub/eac_ruby_gems_utils/spec/support/mygem/lib/mygem.rb +0 -5
  212. data/sub/eac_ruby_gems_utils/spec/support/mygem/mygem.gemspec +0 -16
@@ -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,71 +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_not_found(*registered_initialize_args)
15
- end
16
-
17
- def detect_optional(*registered_initialize_args)
18
- registered_modules.reverse.lazy.map { |klass| klass.new(*registered_initialize_args) }
19
- .find(&:valid?)
20
- end
21
-
22
- def provider_module_suffix
23
- "#{module_suffix}::Provider"
24
- end
25
-
26
- def single_module_suffix
27
- "#{module_suffix}::Base"
28
- end
29
-
30
- def to_s
31
- "#{self.class}[#{module_suffix}]"
32
- end
33
-
34
- def valid_registered_module?(a_module)
35
- a_module.is_a?(::Class) && !a_module.abstract?
36
- end
37
-
38
- private
39
-
40
- def raise_not_found(*args)
41
- raise("No registered module valid for #{args}" \
42
- " (Module suffix: #{module_suffix}, Available: #{registered_modules.join(', ')})")
43
- end
44
-
45
- def registered_modules_uncached
46
- registered_gems.flat_map { |registry| modules_from_registry(registry) }
47
- .select { |v| valid_registered_module?(v) }.uniq
48
- end
49
-
50
- def modules_from_registry(registry)
51
- if registry.registry.module_suffix == provider_module_suffix
52
- registry.registered_module.new.all
53
- else
54
- [registry.registered_module]
55
- end
56
- end
57
-
58
- def registered_gems
59
- (single_instance_registry.registered + provider_registry.registered).sort
60
- end
61
-
62
- def single_instance_registry_uncached
63
- ::EacRubyUtils::GemsRegistry.new(single_module_suffix)
64
- end
65
-
66
- def provider_registry_uncached
67
- ::EacRubyUtils::GemsRegistry.new(provider_module_suffix)
68
- end
69
- end
70
- end
71
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/registry/base'
4
- require 'eac_ruby_utils/core_ext'
5
-
6
- module Avm
7
- module Registry
8
- class WithPath < ::Avm::Registry::Base
9
- def detect_by_path(path)
10
- detect_by_path_optional(path) || raise_not_found(path)
11
- end
12
-
13
- def detect_by_path_optional(path)
14
- current_path = path.to_pathname.expand_path
15
- until current_path.root?
16
- detect_optional(current_path).if_present { |v| return v }
17
- current_path = current_path.parent
18
- end
19
- nil
20
- end
21
- end
22
- end
23
- end
@@ -1,39 +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
- WITH_PATH = [CATEGORY_SCMS, CATEGORY_SOURCES].freeze
13
-
14
- class << self
15
- enable_simple_cache
16
-
17
- # @return [Array<Avm::Registry::Base>]
18
- def registries
19
- lists.category.values.map { |c| send(c) }
20
- end
21
-
22
- private
23
-
24
- ::Avm::Registry.lists.category.each_value do |category|
25
- define_method "#{category}_uncached" do
26
- registry_class(category).new(category.to_s.camelize)
27
- end
28
- end
29
-
30
- def registry_class(category)
31
- if WITH_PATH.include?(category)
32
- ::Avm::Registry::WithPath
33
- else
34
- ::Avm::Registry::Base
35
- end
36
- end
37
- end
38
- end
39
- 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,41 +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_uncached
37
- ::Avm::Registry.scms.detect_by_path_optional(path.parent)
38
- end
39
- end
40
- end
41
- end
@@ -1,43 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module Scms
7
- class Commit
8
- enable_abstract_methods
9
-
10
- # @return [Array<Pathname>]
11
- def changed_files
12
- raise_abstract_method __method__
13
- end
14
-
15
- # @param other [Avm::Scms::Commit]
16
- # @return [Avm::Scms::Commit]
17
- def merge_with(_other)
18
- raise_abstract_method __method__
19
- end
20
-
21
- # @return [Array<Pathname>]
22
- def no_scm_changed_files
23
- changed_files.reject { |path| scm_file?(path) }
24
- end
25
-
26
- # @param new_message [String]
27
- def reword(_new_message)
28
- raise_abstract_method __method__
29
- end
30
-
31
- # @return [Array<Pathname>]
32
- def scm_changed_files
33
- changed_files.select { |path| scm_file?(path) }
34
- end
35
-
36
- # @param path [Pathname]
37
- # @return [TrueClass,FalseClass]
38
- def scm_file?(_path)
39
- raise_abstract_method __method__
40
- end
41
- end
42
- end
43
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module Scms
5
- class Inflector
6
- class << self
7
- def default_instance
8
- @default_instance ||= new
9
- end
10
- end
11
-
12
- ISSUE_POINTER_NAME_PREFIX = 'issue_'
13
- POINTER_NAME_TO_ISSUE_PATTERN = /\A#{Regexp.quote(ISSUE_POINTER_NAME_PREFIX)}(\d+)\z/.freeze
14
- POINTER_NAME_TO_ISSUE_PARSER = POINTER_NAME_TO_ISSUE_PATTERN.to_parser { |m| m[1] }
15
-
16
- # @return [String, nil]
17
- def pointer_name_to_issue_id(pointer_name)
18
- POINTER_NAME_TO_ISSUE_PARSER.parse(pointer_name)
19
- end
20
- end
21
- end
22
- end