avm-tools 0.118.0 → 0.120.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) 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/runner/app_src.rb +2 -0
  6. data/lib/avm/tools/version.rb +1 -1
  7. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/sources/base.rb +2 -2
  8. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/version.rb +1 -1
  9. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/base.rb +3 -3
  10. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
  11. data/sub/{avm-eac_rails_base1 → avm-eac_redmine_plugin_base0}/Gemfile +0 -0
  12. data/sub/avm-eac_redmine_plugin_base0/avm-eac_redmine_plugin_base0.gemspec +19 -0
  13. data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base.rb +30 -0
  14. data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/version.rb +7 -0
  15. data/sub/{avm-eac_ruby_base1/lib/avm/eac_ruby_base1.rb → avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0.rb} +1 -1
  16. data/sub/{avm-eac_rails_base1 → avm-eac_redmine_plugin_base0}/spec/rubocop_spec.rb +0 -0
  17. data/sub/{avm-eac_rails_base1 → avm-eac_redmine_plugin_base0}/spec/spec_helper.rb +0 -0
  18. metadata +27 -223
  19. data/lib/avm/patches/eac_ruby_gems_utils/gem.rb +0 -29
  20. data/lib/avm/patches/eac_ruby_gems_utils.rb +0 -4
  21. data/lib/avm/ruby/bundler/incompatible_parser/depends_on.rb +0 -25
  22. data/lib/avm/ruby/bundler/incompatible_parser/gem_conflict.rb +0 -39
  23. data/lib/avm/ruby/bundler/incompatible_parser/in_gemfile.rb +0 -17
  24. data/lib/avm/ruby/bundler/incompatible_parser/line_buffer.rb +0 -73
  25. data/lib/avm/ruby/bundler/incompatible_parser/line_factory.rb +0 -31
  26. data/lib/avm/ruby/bundler/incompatible_parser/line_parser_base.rb +0 -19
  27. data/lib/avm/ruby/bundler/incompatible_parser/version_requirement.rb +0 -26
  28. data/lib/avm/ruby/bundler/incompatible_parser.rb +0 -25
  29. data/lib/avm/tools/runner/app_src/ruby/bundler/incompatible.rb +0 -82
  30. data/sub/avm/Gemfile +0 -5
  31. data/sub/avm/avm.gemspec +0 -26
  32. data/sub/avm/lib/avm/data/instance/files_unit.rb +0 -40
  33. data/sub/avm/lib/avm/data/instance/package.rb +0 -18
  34. data/sub/avm/lib/avm/data/instance/unit.rb +0 -17
  35. data/sub/avm/lib/avm/data/instance.rb +0 -11
  36. data/sub/avm/lib/avm/data/package/dump.rb +0 -119
  37. data/sub/avm/lib/avm/data/package/load.rb +0 -48
  38. data/sub/avm/lib/avm/data/package.rb +0 -42
  39. data/sub/avm/lib/avm/data/rotate.rb +0 -107
  40. data/sub/avm/lib/avm/data/unit.rb +0 -94
  41. data/sub/avm/lib/avm/docker/container.rb +0 -50
  42. data/sub/avm/lib/avm/docker/image.rb +0 -71
  43. data/sub/avm/lib/avm/docker/runner.rb +0 -125
  44. data/sub/avm/lib/avm/docker.rb +0 -9
  45. data/sub/avm/lib/avm/executables.rb +0 -24
  46. data/sub/avm/lib/avm/instances/application.rb +0 -29
  47. data/sub/avm/lib/avm/instances/base/auto_values/access.rb +0 -40
  48. data/sub/avm/lib/avm/instances/base/auto_values/admin.rb +0 -19
  49. data/sub/avm/lib/avm/instances/base/auto_values/data.rb +0 -26
  50. data/sub/avm/lib/avm/instances/base/auto_values/database.rb +0 -76
  51. data/sub/avm/lib/avm/instances/base/auto_values/filesystem.rb +0 -43
  52. data/sub/avm/lib/avm/instances/base/auto_values/mailer.rb +0 -34
  53. data/sub/avm/lib/avm/instances/base/auto_values/ruby.rb +0 -15
  54. data/sub/avm/lib/avm/instances/base/auto_values/source.rb +0 -15
  55. data/sub/avm/lib/avm/instances/base/auto_values/system.rb +0 -23
  56. data/sub/avm/lib/avm/instances/base/auto_values/web.rb +0 -46
  57. data/sub/avm/lib/avm/instances/base/auto_values.rb +0 -21
  58. data/sub/avm/lib/avm/instances/base/dockerizable.rb +0 -45
  59. data/sub/avm/lib/avm/instances/base/entry_keys.rb +0 -22
  60. data/sub/avm/lib/avm/instances/base.rb +0 -64
  61. data/sub/avm/lib/avm/instances/docker_image.rb +0 -15
  62. data/sub/avm/lib/avm/instances/entries.rb +0 -43
  63. data/sub/avm/lib/avm/instances/entry.rb +0 -60
  64. data/sub/avm/lib/avm/instances/entry_keys.rb +0 -60
  65. data/sub/avm/lib/avm/instances/runner.rb +0 -39
  66. data/sub/avm/lib/avm/instances.rb +0 -8
  67. data/sub/avm/lib/avm/jobs/base.rb +0 -63
  68. data/sub/avm/lib/avm/jobs/variables_source.rb +0 -22
  69. data/sub/avm/lib/avm/jobs.rb +0 -9
  70. data/sub/avm/lib/avm/launcher/errors/base.rb +0 -10
  71. data/sub/avm/lib/avm/launcher/errors/non_project.rb +0 -15
  72. data/sub/avm/lib/avm/launcher/paths/real.rb +0 -44
  73. data/sub/avm/lib/avm/launcher/publish/check_result.rb +0 -67
  74. data/sub/avm/lib/avm/path_string.rb +0 -27
  75. data/sub/avm/lib/avm/registry/base.rb +0 -67
  76. data/sub/avm/lib/avm/registry.rb +0 -29
  77. data/sub/avm/lib/avm/result.rb +0 -86
  78. data/sub/avm/lib/avm/rspec/setup.rb +0 -22
  79. data/sub/avm/lib/avm/rspec/shared_examples/in_avm_registry.rb +0 -11
  80. data/sub/avm/lib/avm/rspec/shared_examples/not_in_avm_registry.rb +0 -14
  81. data/sub/avm/lib/avm/rspec.rb +0 -9
  82. data/sub/avm/lib/avm/runners/base.rb +0 -27
  83. data/sub/avm/lib/avm/scms/base.rb +0 -46
  84. data/sub/avm/lib/avm/scms/commit.rb +0 -43
  85. data/sub/avm/lib/avm/scms/inflector.rb +0 -22
  86. data/sub/avm/lib/avm/self/docker_image.rb +0 -14
  87. data/sub/avm/lib/avm/self/instance/entry_keys.rb +0 -12
  88. data/sub/avm/lib/avm/self/instance.rb +0 -31
  89. data/sub/avm/lib/avm/sources/base/configuration.rb +0 -45
  90. data/sub/avm/lib/avm/sources/base/instance.rb +0 -28
  91. data/sub/avm/lib/avm/sources/base/parent.rb +0 -31
  92. data/sub/avm/lib/avm/sources/base/subs.rb +0 -55
  93. data/sub/avm/lib/avm/sources/base/subs_paths.rb +0 -32
  94. data/sub/avm/lib/avm/sources/base/testing.rb +0 -21
  95. data/sub/avm/lib/avm/sources/base.rb +0 -44
  96. data/sub/avm/lib/avm/sources/configuration/locale.rb +0 -18
  97. data/sub/avm/lib/avm/sources/configuration/rubocop.rb +0 -26
  98. data/sub/avm/lib/avm/sources/configuration/tests.rb +0 -29
  99. data/sub/avm/lib/avm/sources/configuration.rb +0 -59
  100. data/sub/avm/lib/avm/sources/tester.rb +0 -24
  101. data/sub/avm/lib/avm/sources/tests/builder.rb +0 -83
  102. data/sub/avm/lib/avm/sources/tests/performer.rb +0 -35
  103. data/sub/avm/lib/avm/sources/tests/result.rb +0 -15
  104. data/sub/avm/lib/avm/sources/tests/single.rb +0 -56
  105. data/sub/avm/lib/avm/sources/tests.rb +0 -11
  106. data/sub/avm/lib/avm/sources.rb +0 -9
  107. data/sub/avm/lib/avm/sync.rb +0 -94
  108. data/sub/avm/lib/avm/version.rb +0 -5
  109. data/sub/avm/lib/avm/version_number.rb +0 -45
  110. data/sub/avm/lib/avm.rb +0 -7
  111. data/sub/avm/spec/lib/avm/scms/base_spec.rb +0 -7
  112. data/sub/avm/spec/lib/avm/sources/base_spec.rb +0 -7
  113. data/sub/avm/spec/rubocop_spec.rb +0 -3
  114. data/sub/avm/spec/spec_helper.rb +0 -4
  115. data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +0 -21
  116. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/apache_host.rb +0 -17
  117. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instance.rb +0 -24
  118. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/bundle.rb +0 -26
  119. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/code_runner.rb +0 -26
  120. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb +0 -43
  121. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/logs/clear.rb +0 -26
  122. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/logs.rb +0 -18
  123. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/rails_server.rb +0 -32
  124. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/tasks_scheduler/systemd_unit.rb +0 -46
  125. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/tasks_scheduler.rb +0 -17
  126. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner.rb +0 -12
  127. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/bundle.rb +0 -27
  128. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/rails_environment.rb +0 -47
  129. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/sources/base.rb +0 -27
  130. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit/service.rb +0 -70
  131. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.rb +0 -29
  132. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit.rb +0 -57
  133. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +0 -7
  134. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1.rb +0 -9
  135. data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/systemd_unit/tasks_scheduler.service +0 -12
  136. data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.sh +0 -6
  137. data/sub/avm-eac_ruby_base1/Gemfile +0 -5
  138. data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +0 -21
  139. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile/add_or_replace_gem_line.rb +0 -56
  140. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile/dependency.rb +0 -19
  141. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile.rb +0 -34
  142. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler.rb +0 -11
  143. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/configured.rb +0 -31
  144. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/envvar.rb +0 -17
  145. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/gemfile.rb +0 -41
  146. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop.rb +0 -55
  147. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/version_bump.rb +0 -23
  148. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb +0 -50
  149. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/tester.rb +0 -38
  150. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update/sub_update.rb +0 -56
  151. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb +0 -52
  152. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources.rb +0 -11
  153. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +0 -7
  154. data/sub/avm-eac_ruby_base1/locale/en.yaml +0 -8
  155. data/sub/avm-eac_ruby_base1/locale/pt-BR.yaml +0 -8
  156. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/sources/base_spec.rb +0 -7
  157. data/sub/avm-eac_ruby_base1/spec/rubocop_spec.rb +0 -3
  158. data/sub/avm-eac_ruby_base1/spec/spec_helper.rb +0 -4
  159. data/sub/eac_ruby_base0/Gemfile +0 -5
  160. data/sub/eac_ruby_base0/eac_ruby_base0.gemspec +0 -21
  161. data/sub/eac_ruby_base0/lib/eac_ruby_base0/application.rb +0 -87
  162. data/sub/eac_ruby_base0/lib/eac_ruby_base0/application_xdg.rb +0 -34
  163. data/sub/eac_ruby_base0/lib/eac_ruby_base0/core_ext.rb +0 -5
  164. data/sub/eac_ruby_base0/lib/eac_ruby_base0/jobs_runner.rb +0 -31
  165. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/class/jobs_runner.rb +0 -10
  166. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/class.rb +0 -4
  167. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/object/runner_with.rb +0 -5
  168. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/object.rb +0 -5
  169. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches.rb +0 -4
  170. data/sub/eac_ruby_base0/lib/eac_ruby_base0/rspec/setup.rb +0 -14
  171. data/sub/eac_ruby_base0/lib/eac_ruby_base0/rspec.rb +0 -9
  172. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +0 -92
  173. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/confirmation.rb +0 -42
  174. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/filesystem_traverser.rb +0 -52
  175. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/input.rb +0 -36
  176. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/output.rb +0 -58
  177. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with.rb +0 -9
  178. data/sub/eac_ruby_base0/lib/eac_ruby_base0/version.rb +0 -5
  179. data/sub/eac_ruby_base0/lib/eac_ruby_base0.rb +0 -7
  180. data/sub/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/confirmation_spec.rb +0 -42
  181. data/sub/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/output_spec.rb +0 -81
  182. data/sub/eac_ruby_base0/spec/rubocop_spec.rb +0 -3
  183. data/sub/eac_ruby_base0/spec/spec_helper.rb +0 -4
  184. data/sub/eac_ruby_gems_utils/Gemfile +0 -5
  185. data/sub/eac_ruby_gems_utils/LICENCE +0 -16
  186. data/sub/eac_ruby_gems_utils/README.rdoc +0 -3
  187. data/sub/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +0 -31
  188. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/command.rb +0 -33
  189. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/version_file.rb +0 -41
  190. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem.rb +0 -97
  191. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/base.rb +0 -57
  192. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/minitest.rb +0 -25
  193. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/decorated_gem.rb +0 -48
  194. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/result.rb +0 -25
  195. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple.rb +0 -84
  196. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/rspec.rb +0 -21
  197. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests.rb +0 -9
  198. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +0 -5
  199. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils.rb +0 -7
  200. data/sub/eac_ruby_gems_utils/spec/code/rubocop_check_spec.rb +0 -3
  201. data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec.rb +0 -14
  202. data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec_files/a_version_file.rb +0 -7
  203. data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem_spec.rb +0 -20
  204. data/sub/eac_ruby_gems_utils/spec/spec_helper.rb +0 -4
  205. data/sub/eac_ruby_gems_utils/spec/support/mygem/Gemfile +0 -5
  206. data/sub/eac_ruby_gems_utils/spec/support/mygem/Gemfile.lock +0 -19
  207. data/sub/eac_ruby_gems_utils/spec/support/mygem/Rakefile +0 -14
  208. data/sub/eac_ruby_gems_utils/spec/support/mygem/exe/myrunner +0 -5
  209. data/sub/eac_ruby_gems_utils/spec/support/mygem/lib/mygem/version.rb +0 -5
  210. data/sub/eac_ruby_gems_utils/spec/support/mygem/lib/mygem.rb +0 -5
  211. data/sub/eac_ruby_gems_utils/spec/support/mygem/mygem.gemspec +0 -16
@@ -1,55 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/sources/base/subs_paths'
4
- require 'eac_ruby_utils/core_ext'
5
-
6
- module Avm
7
- module Sources
8
- class Base
9
- module Subs
10
- CONFIGURATION_SUBS_EXCLUDE_PATHS_KEY = 'subs.exclude_path'
11
- CONFIGURATION_SUBS_INCLUDE_PATHS_KEY = 'subs.include_path'
12
- SUBS_EXCLUDE_PATHS_DEFAULT = [].freeze
13
- SUBS_INCLUDE_PATHS_DEFAULT = ['sub/*'].freeze
14
-
15
- # @return [Enumerable<Avm::Sources::Base>]
16
- def subs
17
- subs_paths_to_search
18
- .map { |sub_path| ::Avm::Registry.sources.detect_optional(sub_path, parent: self) }
19
- .reject(&:blank?)
20
- .sort_by { |sub| [sub.path] }
21
- end
22
-
23
- def subs_paths_to_search
24
- subs_include_paths.flat_map do |subs_include_path|
25
- ::Pathname.glob(path.join(subs_include_path)).reject do |sub_path|
26
- subs_exclude_paths.any? do |subs_exclude_path|
27
- sub_path.fnmatch?(path.join(subs_exclude_path).to_path)
28
- end
29
- end
30
- end
31
- end
32
-
33
- %i[include exclude].each do |type|
34
- %i[path paths configured_paths default_paths].each do |method_suffix|
35
- obj_method_name = "subs_#{type}_path_obj"
36
-
37
- define_method "subs_#{type}_#{method_suffix}" do
38
- send(obj_method_name).send(method_suffix)
39
- end
40
-
41
- define_method "#{obj_method_name}_uncached" do
42
- ::Avm::Sources::Base::SubsPaths.new(
43
- self,
44
- self.class.const_get("CONFIGURATION_SUBS_#{type}_PATHS_KEY".upcase),
45
- self.class.const_get("SUBS_#{type}_PATHS_DEFAULT".upcase)
46
- )
47
- end
48
-
49
- private "#{obj_method_name}_uncached" # rubocop:disable Style/AccessModifierDeclarations
50
- end
51
- end
52
- end
53
- end
54
- end
55
- end
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module Sources
7
- class Base
8
- class SubsPaths
9
- SUBS_PATH_SEPARATOR = ':'
10
-
11
- common_constructor :source, :configuration_key, :default_paths
12
-
13
- # @return [String]
14
- def path
15
- paths.join(SUBS_PATH_SEPARATOR)
16
- end
17
-
18
- # @return [Array<String>]
19
- def paths
20
- configured_paths || default_paths
21
- end
22
-
23
- # @return [Array<String>]
24
- def configured_paths
25
- source.configuration.entry(configuration_key).value.if_present do |v|
26
- v.split(SUBS_PATH_SEPARATOR)
27
- end
28
- end
29
- end
30
- end
31
- end
32
- end
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module Sources
7
- class Base
8
- module Testing
9
- # @return [Avm::Sources::Tester]
10
- def tester
11
- tester_class.new(self)
12
- end
13
-
14
- # @return [Class<Avm::Sources::Tester>
15
- def tester_class
16
- Avm::Sources::Tester
17
- end
18
- end
19
- end
20
- end
21
- end
@@ -1,44 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/registry'
4
- require 'eac_git'
5
- require 'eac_ruby_utils/core_ext'
6
-
7
- module Avm
8
- module Sources
9
- class Base
10
- require_sub __FILE__, include_modules: true
11
- compare_by :path
12
- enable_abstract_methods
13
- enable_simple_cache
14
- enable_listable
15
- lists.add_symbol :option, :parent
16
- common_constructor :path, :options, default: [{}] do
17
- self.path = path.to_pathname.expand_path
18
- self.options = ::Avm::Sources::Base.lists.option.hash_keys_validate!(options)
19
- end
20
-
21
- abstract_methods :update, :valid?
22
-
23
- delegate :locale, to: :old_configuration
24
-
25
- # @return [Pathname]
26
- def relative_path
27
- return path if parent.blank?
28
-
29
- path.relative_path_from(parent.path)
30
- end
31
-
32
- def to_s
33
- "#{self.class}[#{path}]"
34
- end
35
-
36
- private
37
-
38
- # @return [Avm::Scms::Base]
39
- def scm_uncached
40
- ::Avm::Registry.scms.detect(path)
41
- end
42
- end
43
- end
44
- end
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/patches/eac_ruby_gems_utils/gem'
4
- require 'i18n'
5
-
6
- module Avm
7
- module Sources
8
- class Configuration < ::EacConfig::OldConfigs
9
- module Locale
10
- LOCALE_KEY = :locale
11
-
12
- def locale
13
- read_entry(LOCALE_KEY) || ::I18n.default_locale
14
- end
15
- end
16
- end
17
- end
18
- end
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module Sources
5
- class Configuration < ::EacConfig::OldConfigs
6
- module Rubocop
7
- RUBOCOP_COMMAND_KEY = 'ruby.rubocop.command'
8
- RUBOCOP_GEMFILE_KEY = 'ruby.rubocop.gemfile'
9
-
10
- def rubocop_command
11
- read_command(RUBOCOP_COMMAND_KEY)
12
- end
13
-
14
- def rubocop_gemfile
15
- gemfile_path = read_entry(RUBOCOP_GEMFILE_KEY)
16
- return nil if gemfile_path.blank?
17
-
18
- gemfile_path = gemfile_path.to_pathname.expand_path(storage_path.parent)
19
- return gemfile_path if gemfile_path.file?
20
-
21
- raise "Gemfile path \"#{gemfile_path}\" does not exist or is not a file"
22
- end
23
- end
24
- end
25
- end
26
- end
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/patches/eac_ruby_gems_utils/gem'
4
-
5
- module Avm
6
- module Sources
7
- class Configuration < ::EacConfig::OldConfigs
8
- module Tests
9
- BUNDLE_TEST_COMMAND_KEY = 'test.bundle_command'
10
- TEST_COMMAND_KEY = 'test.command'
11
-
12
- def any_test_command
13
- bundle_test_command || test_command
14
- end
15
-
16
- def test_command
17
- read_command(TEST_COMMAND_KEY)
18
- end
19
-
20
- def bundle_test_command
21
- read_entry(BUNDLE_TEST_COMMAND_KEY).if_present do |v|
22
- args = v.is_a?(::Enumerable) ? v.map(&:to_s) : ::Shellwords.split(v)
23
- ::EacRubyGemsUtils::Gem.new(::File.dirname(storage_path)).bundle(*args).chdir_root
24
- end
25
- end
26
- end
27
- end
28
- end
29
- end
@@ -1,59 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_config/old_configs'
4
- require 'eac_ruby_utils/core_ext'
5
- require 'yaml'
6
-
7
- module Avm
8
- module Sources
9
- class Configuration < ::EacConfig::OldConfigs
10
- require_sub __FILE__, include_modules: true
11
-
12
- FILENAMES = %w[.avm.yml .avm.yaml].freeze
13
-
14
- class << self
15
- def find_by_path(path)
16
- path = ::Pathname.new(path.to_s) unless path.is_a?(::Pathname)
17
- internal_find_path(path.expand_path)
18
- end
19
-
20
- def find_in_path(path)
21
- absolute_pathname = path.to_pathname.expand_path
22
- if absolute_pathname.directory?
23
- FILENAMES.each do |filename|
24
- file = absolute_pathname.join(filename)
25
- return new(file) if file.exist?
26
- end
27
- end
28
- nil
29
- end
30
-
31
- def temp_instance
32
- new(::Tempfile.new(['.avm', '.yaml']))
33
- end
34
-
35
- private
36
-
37
- def internal_find_path(absolute_pathname)
38
- r = find_in_path(absolute_pathname)
39
- return r if r.present?
40
-
41
- internal_find_path(absolute_pathname.dirname) unless absolute_pathname.root?
42
- end
43
- end
44
-
45
- def initialize(path)
46
- super(nil, storage_path: path)
47
- end
48
-
49
- # Utility to read a configuration as a [EacRubyUtils::Envs::Command].
50
- # @return [EacRubyUtils::Envs::Command]
51
- def read_command(key)
52
- read_entry(key).if_present do |v|
53
- args = v.is_a?(::Enumerable) ? v.map(&:to_s) : ::Shellwords.split(v)
54
- ::EacRubyUtils::Envs.local.command(args).chdir(::File.dirname(storage_path))
55
- end
56
- end
57
- end
58
- end
59
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module Sources
7
- class Tester
8
- enable_abstract_methods
9
- common_constructor :source
10
-
11
- abstract_methods :result, :logs
12
-
13
- # @return [EacFs::Logs]
14
- def logs
15
- raise_abstract_method __method__
16
- end
17
-
18
- # @return [Avm::Sources::Tests::Result]
19
- def result
20
- raise_abstract_method __method__
21
- end
22
- end
23
- end
24
- end
@@ -1,83 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/sources/tests/performer'
4
- require 'avm/sources/tests/single'
5
- require 'eac_ruby_utils/core_ext'
6
-
7
- module Avm
8
- module Sources
9
- module Tests
10
- class Builder
11
- require_sub __FILE__
12
- enable_immutable
13
-
14
- immutable_accessor :include_main, :include_subs, type: :boolean
15
- immutable_accessor :include_id, type: :array
16
- common_constructor :main_source
17
-
18
- def immutable_constructor_args
19
- [main_source]
20
- end
21
-
22
- # @return [Avm::Sources::Tests::Performer]
23
- def performer
24
- ::Avm::Sources::Tests::Performer.new(self)
25
- end
26
-
27
- def selected_units
28
- (select_units_from_subs + select_units_from_main + select_units_from_ids).sort.uniq
29
- end
30
-
31
- private
32
-
33
- # @return [Array<Avm::Sources::Tests::Single>]
34
- def available_units
35
- @available_units ||= ([main_source] + main_source.subs)
36
- .map { |a_source| create_unit(a_source) }
37
- end
38
-
39
- def available_units_from_main
40
- create_units([main_source])
41
- end
42
-
43
- def available_units_from_subs
44
- create_units(main_source.subs)
45
- end
46
-
47
- # @return [Avm::Sources::Tests::Single]
48
- def create_unit(source)
49
- ::Avm::Sources::Tests::Single.new(self, source)
50
- end
51
-
52
- # @return [Array<Avm::Sources::Tests::Single>]
53
- def create_units(sources)
54
- sources.map { |a_source| create_unit(a_source) }
55
- end
56
-
57
- # @return [Avm::Sources::Tests::Single]
58
- def create_unit_by_id(source_id)
59
- r = available_units.find { |unit| unit.id == source_id }
60
- return r if r
61
-
62
- raise ::ArgumentError, "Source not found with ID=#{source_id}" \
63
- "(Available: #{available_units.map(&:id).join(', ')})"
64
- end
65
-
66
- # @return [Array<Avm::Sources::Tests::Single>]
67
- def select_units_from_ids
68
- include_ids.map { |source_id| create_unit_by_id(source_id) }
69
- end
70
-
71
- # @return [Array<Avm::Sources::Tests::Single>]
72
- def select_units_from_main
73
- include_main? ? available_units_from_main : []
74
- end
75
-
76
- # @return [Array<Avm::Sources::Tests::Single>]
77
- def select_units_from_subs
78
- include_subs? ? available_units_from_subs : []
79
- end
80
- end
81
- end
82
- end
83
- end
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/sources/tests/result'
4
- require 'eac_ruby_utils/core_ext'
5
-
6
- module Avm
7
- module Sources
8
- module Tests
9
- class Performer
10
- enable_simple_cache
11
-
12
- common_constructor(:owner)
13
-
14
- def non_failed_units
15
- units.reject(&:failed?)
16
- end
17
-
18
- def failed_units
19
- units.select(&:failed?)
20
- end
21
-
22
- # @return [Boolean]
23
- def successful?
24
- failed_units.none?
25
- end
26
-
27
- protected
28
-
29
- def units_uncached
30
- owner.selected_units
31
- end
32
- end
33
- end
34
- end
35
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_cli/enum'
4
-
5
- module Avm
6
- module Sources
7
- module Tests
8
- class Result < ::EacCli::Enum
9
- enum :failed, :red
10
- enum :nonexistent, :white
11
- enum :sucessful, :green
12
- end
13
- end
14
- end
15
- end
@@ -1,56 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/sources/tests/result'
4
- require 'eac_ruby_utils/core_ext'
5
- require 'eac_fs/logs'
6
-
7
- module Avm
8
- module Sources
9
- module Tests
10
- class Single
11
- MAIN_SOURCE_ID = '#main'
12
-
13
- compare_by :order_group, :id
14
- enable_simple_cache
15
- enable_speaker
16
-
17
- common_constructor :builder, :source
18
-
19
- delegate :logs, :result, to: :tester
20
- delegate :to_s, to: :id
21
-
22
- def failed?
23
- result == ::Avm::Sources::Tests::Result::FAILED
24
- end
25
-
26
- # @return [String]
27
- def id
28
- if main?
29
- MAIN_SOURCE_ID
30
- else
31
- relative_path_from_main_source.to_s
32
- end
33
- end
34
-
35
- def main?
36
- relative_path_from_main_source.to_s == '.'
37
- end
38
-
39
- def order_group
40
- main? ? 1 : 0
41
- end
42
-
43
- # @return [Pathname]
44
- def relative_path_from_main_source
45
- source.path.relative_path_from(builder.main_source.path)
46
- end
47
-
48
- private
49
-
50
- def tester_uncached
51
- source.tester
52
- end
53
- end
54
- end
55
- end
56
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module Sources
7
- module Tests
8
- require_sub __FILE__
9
- end
10
- end
11
- end
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module Sources
7
- require_sub __FILE__
8
- end
9
- end
@@ -1,94 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- class Sync
7
- attr_reader :excludes, :includes
8
-
9
- common_constructor :source_path, :target_path do
10
- self.source_path = source_path.to_pathname
11
- self.target_path = target_path.to_pathname
12
- @excludes = []
13
- @includes = []
14
- end
15
-
16
- def run
17
- clear_target
18
- copy
19
- end
20
-
21
- def add_exclude(exclude)
22
- excludes << exclude
23
-
24
- self
25
- end
26
-
27
- def add_excludes(*excludes)
28
- excludes.each { |exclude| add_exclude(exclude) }
29
-
30
- self
31
- end
32
-
33
- def add_include(include)
34
- includes << include
35
-
36
- self
37
- end
38
-
39
- def add_includes(*includes)
40
- includes.each { |include| add_include(include) }
41
-
42
- self
43
- end
44
-
45
- def move_mode(value)
46
- @move_mode = value
47
-
48
- self
49
- end
50
-
51
- def move_mode?
52
- @move_mode ? true : false
53
- end
54
-
55
- private
56
-
57
- def clear_target
58
- target_remove(target_path)
59
- target_path.children.each { |tchild| target_remove(tchild) }
60
- end
61
-
62
- def copy
63
- source_path.children.each do |schild|
64
- ::FileUtils.cp_r(schild.to_path, target_path.to_path)
65
- schild.rmtree if move_mode?
66
- end
67
- end
68
-
69
- def source_to_target_path(source_path)
70
- source_path.relative_path_from(self.source_path).expand_path(target_path)
71
- end
72
-
73
- def target_remove(tpath)
74
- return if skip_target_path?(tpath)
75
-
76
- if tpath.directory?
77
- tpath.children.each { |tchild| target_remove(tchild) }
78
- tpath.rmdir if tpath.children.empty?
79
- elsif tpath.file?
80
- tpath.unlink
81
- end
82
- end
83
-
84
- def skip_target_path?(tpath)
85
- skip_path?(tpath.relative_path_from(target_path))
86
- end
87
-
88
- def skip_path?(relpath)
89
- relpath = relpath.expand_path('/')
90
- excludes.any? { |exclude| relpath.fnmatch?(exclude) } &&
91
- includes.none? { |include| relpath.fnmatch?(include) }
92
- end
93
- end
94
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- VERSION = '0.20.0'
5
- end
@@ -1,45 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- # A sequence of segments of integer versions (Ex.: 2, 1.0.1, 3.0.0.0.0).
5
- class VersionNumber
6
- include ::Comparable
7
-
8
- SEGMENT_SEPARATOR = '.'
9
-
10
- class << self
11
- def segments_from_mixed(segments)
12
- (segments.is_a?(::Enumerable) ? segments.to_a : segments.to_s.split(SEGMENT_SEPARATOR))
13
- .map(&:to_i)
14
- end
15
- end
16
-
17
- attr_reader :segments
18
-
19
- def initialize(segments)
20
- @segments = self.class.segments_from_mixed(segments).freeze
21
- end
22
-
23
- delegate :[], to: :segments
24
-
25
- def <=>(other)
26
- segments <=> other.segments
27
- end
28
-
29
- def to_s
30
- segments.join(SEGMENT_SEPARATOR)
31
- end
32
-
33
- # @return [Avm::Version]
34
- def increment_segment(segment_index)
35
- x = [segments.count, segment_index + 1].max.times.map do |index|
36
- value = index < segments.count ? segments[index] : 0
37
- next value if index < segment_index
38
- next value + 1 if index == segment_index
39
-
40
- 0
41
- end
42
- self.class.new x
43
- end
44
- end
45
- end
data/sub/avm/lib/avm.rb DELETED
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- require_sub __FILE__
7
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/scms/base'
4
-
5
- ::RSpec.describe ::Avm::Scms::Base do
6
- include_examples 'not_in_avm_registry'
7
- end