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,41 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/patches/eac_ruby_gems_utils/gem'
4
- require 'eac_ruby_utils/core_ext'
5
-
6
- module Avm
7
- module EacRubyBase1
8
- class Rubocop
9
- module Gemfile
10
- def gemfile_rubocop_command
11
- return nil unless rubocop_gemfile?
12
-
13
- rubocop_command_by_gemfile_path(mygem.root)
14
- end
15
-
16
- def rubocop_command_by_gemfile_path(path)
17
- ::EacRubyGemsUtils::Gem.new(path).bundle('exec', 'rubocop').chdir_root
18
- end
19
-
20
- def rubocop_gemfile?
21
- return false if mygem.blank?
22
-
23
- mygem.bundle('install').execute!
24
- mygem.gemfile_lock_gem_version('rubocop').present?
25
- end
26
-
27
- private
28
-
29
- def mygem_uncached
30
- find_gem(::Pathname.new(base_path).expand_path)
31
- end
32
-
33
- def find_gem(path)
34
- r = ::EacRubyGemsUtils::Gem.new(path)
35
- return r if r.gemfile_path.exist?
36
- return find_gem(path.dirname) unless path.root?
37
- end
38
- end
39
- end
40
- end
41
- end
@@ -1,55 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
- require 'eac_ruby_utils/ruby/on_clean_environment'
5
-
6
- module Avm
7
- module EacRubyBase1
8
- class Rubocop
9
- require_sub __FILE__, include_modules: true
10
- enable_speaker
11
- enable_simple_cache
12
- common_constructor :base_path, :rubocop_args
13
- set_callback :initialize, :after do
14
- @base_path = ::Pathname.new(base_path.to_s) unless base_path.is_a?(::Pathname)
15
- end
16
-
17
- def run
18
- start_banner
19
- run_rubocop
20
- end
21
-
22
- private
23
-
24
- def cmd(*args)
25
- ::EacRubyUtils::Envs.local.command(*args)
26
- end
27
-
28
- def rubocop_command_uncached
29
- %w[env configured gemfile].each do |s|
30
- cmd = send("#{s}_rubocop_command")
31
- return cmd if cmd.present?
32
- end
33
- cmd('rubocop')
34
- end
35
-
36
- def rubocop_command_with_args
37
- rubocop_command.append(rubocop_args)
38
- end
39
-
40
- def rubocop_version_uncached
41
- ::EacRubyUtils::Ruby.on_clean_environment do
42
- rubocop_command.append(['--version']).execute!.strip
43
- end
44
- end
45
-
46
- def run_rubocop
47
- ::EacRubyUtils::Ruby.on_clean_environment { rubocop_command_with_args.system }
48
- end
49
-
50
- def start_banner
51
- infov 'Rubocop version', rubocop_version
52
- end
53
- end
54
- end
55
- end
@@ -1,39 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_generic_base0/sources/base'
4
- require 'eac_ruby_utils/core_ext'
5
- require 'eac_ruby_utils/ruby/command'
6
-
7
- module Avm
8
- module EacRubyBase1
9
- module Sources
10
- class Base < ::Avm::EacGenericBase0::Sources::Base
11
- class BundleCommand < ::EacRubyUtils::Ruby::Command
12
- GEMFILE_PATH_ENVVAR = 'BUNDLE_GEMFILE'
13
-
14
- attr_reader :source
15
-
16
- def initialize(source, command_args, extra_options = {})
17
- @source = source
18
- super(command_args, extra_options.merge(host_env: source.env))
19
- end
20
-
21
- # Changes current directory to the source's directory.
22
- def chdir_root
23
- chdir(source.path)
24
- end
25
-
26
- def envvar_gemfile
27
- envvar(GEMFILE_PATH_ENVVAR, source.gemfile_path.to_path)
28
- end
29
-
30
- protected
31
-
32
- def duplicate(command, extra_options)
33
- self.class.new(source, command, extra_options)
34
- end
35
- end
36
- end
37
- end
38
- end
39
- end
@@ -1,39 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_generic_base0/sources/base'
4
- require 'avm/eac_ruby_base1/sources/base/bundle_command'
5
- require 'eac_ruby_utils/core_ext'
6
-
7
- module Avm
8
- module EacRubyBase1
9
- module Sources
10
- class Base < ::Avm::EacGenericBase0::Sources::Base
11
- module Bundler
12
- CONFIGURED_GEMFILE_PATH_ENTRY_KEY = 'ruby.gemfile_path'
13
- DEFAULT_GEMFILE_PATH = 'Gemfile'
14
-
15
- # @return [Avm::EacRubyBase1::Sources::Base::BundleCommand]
16
- def bundle(*args)
17
- ::Avm::EacRubyBase1::Sources::Base::BundleCommand.new(self, %w[bundle] + args)
18
- .envvar_gemfile
19
- end
20
-
21
- # @return [String]
22
- def configured_gemfile_path
23
- configuration.entry(CONFIGURED_GEMFILE_PATH_ENTRY_KEY).value
24
- end
25
-
26
- # @return [String]
27
- def default_gemfile_path
28
- DEFAULT_GEMFILE_PATH
29
- end
30
-
31
- # @return [Pathname]
32
- def gemfile_path
33
- path.join(configured_gemfile_path || default_gemfile_path)
34
- end
35
- end
36
- end
37
- end
38
- end
39
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_generic_base0/sources/base'
4
- require 'eac_ruby_utils/core_ext'
5
-
6
- module Avm
7
- module EacRubyBase1
8
- module Sources
9
- class Base < ::Avm::EacGenericBase0::Sources::Base
10
- module VersionBump
11
- def after_sub_version_bump_do_changes
12
- the_gem.bundle('install').chdir_root.execute!
13
- end
14
-
15
- def version_bump_do_changes(target_version)
16
- self.version = target_version
17
- the_gem.bundle('install').chdir_root.execute!
18
- end
19
- end
20
- end
21
- end
22
- end
23
- end
@@ -1,55 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_generic_base0/sources/base'
4
- require 'avm/eac_ruby_base1/sources/update'
5
- require 'avm/eac_ruby_base1/sources/tester'
6
- require 'avm/eac_ruby_base1/sources/runners/bundler'
7
- require 'avm/version_number'
8
- require 'eac_ruby_gems_utils/gem'
9
- require 'eac_ruby_utils/core_ext'
10
-
11
- module Avm
12
- module EacRubyBase1
13
- module Sources
14
- class Base < ::Avm::EacGenericBase0::Sources::Base
15
- require_sub __FILE__, include_modules: :prepend, require_dependency: true
16
- delegate :gemspec_path, to: :the_gem
17
-
18
- EXTRA_AVAILABLE_SUBCOMMANDS = {
19
- 'bundler' => ::Avm::EacRubyBase1::Sources::Runners::Bundler
20
- }.freeze
21
-
22
- def extra_available_subcommands
23
- EXTRA_AVAILABLE_SUBCOMMANDS
24
- end
25
-
26
- def valid?
27
- gemfile_path.exist? || gemspec_path.present?
28
- end
29
-
30
- # @return [Avm::EacRubyBase1::Sources::Tester]
31
- def tester_class
32
- Avm::EacRubyBase1::Sources::Tester
33
- end
34
-
35
- # @return [EacRubyGemsUtils::Gem]
36
- def the_gem
37
- @the_gem ||= ::EacRubyGemsUtils::Gem.new(path)
38
- end
39
-
40
- def update
41
- ::Avm::EacRubyBase1::Sources::Update.new(self)
42
- end
43
-
44
- # @return [Avm::VersionNumber]
45
- def version
46
- the_gem.version.if_present { |v| ::Avm::VersionNumber.new(v) }
47
- end
48
-
49
- def version=(value)
50
- the_gem.version_file.value = value
51
- end
52
- end
53
- end
54
- end
55
- end
@@ -1,76 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_ruby_base1/bundler/incompatible_parser'
4
- require 'eac_cli/core_ext'
5
-
6
- module Avm
7
- module EacRubyBase1
8
- module Sources
9
- module Runners
10
- class Bundler
11
- class Incompatible
12
- runner_with :help do
13
- desc 'Identify incompatible gems in a "Gemfile.lock" file.'
14
- bool_opt '-l', '--last', 'Process the last \"bundle update\" result.'
15
- end
16
-
17
- def run
18
- infov 'Cache path', fs_cache.content_path
19
- infov 'Cached?', fs_cache.stored?
20
- parser.gems_in_conflict.each do |gem_in_conflict|
21
- print_gem_in_conflict(gem_in_conflict)
22
- end
23
- end
24
-
25
- private
26
-
27
- def bundle_update
28
- infom 'Running "bundle update"...'
29
- runner_context.call(:subject).bundle('update').execute[:stdout]
30
- end
31
-
32
- def content_path
33
- fs_cache.write(bundle_update) unless fs_cache.stored? && parsed.last?
34
- fs_cache.content_path
35
- end
36
-
37
- def fs_object_id
38
- runner_context.call(:subject).path.to_s.variableize
39
- end
40
-
41
- def gem_title(gem_in_conflict)
42
- gem_in_conflict.gem_name
43
- end
44
-
45
- def parser_uncached
46
- ::Avm::EacRubyBase1::Bundler::IncompatibleParser.new(content_path)
47
- end
48
-
49
- def print_gem_in_conflict(gem_in_conflict)
50
- infov 'Gem', gem_title(gem_in_conflict)
51
- gem_in_conflict.versions_requirements.each do |requirement|
52
- print_requirement(requirement)
53
- end
54
- end
55
-
56
- def print_requirement(req)
57
- infov ' ' + requirement_title(req), requirement_value(req)
58
- end
59
-
60
- def requirement_stack(req)
61
- req.stack.map { |d| "#{d.gem_name} (#{d.version})" }.join(' > '.green)
62
- end
63
-
64
- def requirement_title(req)
65
- req.requirements_source.if_present('*')
66
- end
67
-
68
- def requirement_value(req)
69
- requirement_stack(req)
70
- end
71
- end
72
- end
73
- end
74
- end
75
- end
76
- end
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_cli/core_ext'
4
-
5
- module Avm
6
- module EacRubyBase1
7
- module Sources
8
- module Runners
9
- class Bundler
10
- require_sub __FILE__
11
- runner_with :help, :subcommands do
12
- desc 'Ruby\'s bundler utitilies for local projects.'
13
- subcommands
14
- end
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module EacRubyBase1
7
- module Sources
8
- module Runners
9
- require_sub __FILE__
10
- end
11
- end
12
- end
13
- end
@@ -1,38 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_generic_base0/sources/tester'
4
- require 'eac_ruby_utils/core_ext'
5
-
6
- module Avm
7
- module EacRubyBase1
8
- module Sources
9
- class Tester < ::Avm::EacGenericBase0::Sources::Tester
10
- BUNDLE_TEST_COMMAND_CONFIGURATION_KEY = :bundle_test_command
11
-
12
- delegate :the_gem, to: :source
13
-
14
- # @return [EacRubyUtils::Envs::Command, nil]
15
- def test_command
16
- bundle_test_command || super || default_test_command
17
- end
18
-
19
- # @return [EacRubyGemsUtils::Gem::Command, nil]
20
- def bundle_test_command
21
- source.read_configuration_as_shell_words(BUNDLE_TEST_COMMAND_CONFIGURATION_KEY)
22
- .if_present { |args| the_gem.bundle(*args).chdir_root }
23
- end
24
-
25
- # @return [EacRubyGemsUtils::Gem::Command, nil]
26
- def default_test_command
27
- the_gem.bundle('exec', 'rspec', '--fail-fast').chdir_root
28
- end
29
-
30
- def run_test_command
31
- execute_command_and_log(the_gem.bundle('install').chdir_root) ||
32
- execute_command_and_log(the_gem.bundle('update').chdir_root)
33
- super
34
- end
35
- end
36
- end
37
- end
38
- end
@@ -1,56 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module EacRubyBase1
5
- module Sources
6
- class Update
7
- class SubUpdate
8
- enable_simple_cache
9
- enable_speaker
10
- common_constructor :source_update, :sub do
11
- perform
12
- end
13
- delegate :source, to: :source_update
14
-
15
- protected
16
-
17
- def on_scm_updated(commit)
18
- if commit.no_scm_changed_files.any?
19
- commit = commit.reword(no_scm_update_commit_message)
20
- source.scm.commit_if_change { source_update.bundle_update }
21
- .if_present { |v| v.merge_with(commit) }
22
- else
23
- commit.reword(scm_update_commit_message)
24
- end
25
- end
26
-
27
- def perform
28
- update_scm.if_present { |commit| on_scm_updated(commit) }
29
- end
30
-
31
- def ruby_gem_uncached
32
- ::EacRubyGemsUtils::Gem.new(sub.path)
33
- end
34
-
35
- def no_scm_update_commit_message
36
- source_update.i18n_translate(__method__, __locale: source.locale,
37
- name: ruby_gem.name,
38
- version: ruby_gem.version)
39
- end
40
-
41
- def scm_update_commit_message
42
- source_update.i18n_translate(__method__, __locale: source.locale)
43
- end
44
-
45
- # @return [Avm::Scms::Commit]
46
- def update_scm
47
- infom "Updating \"#{sub}\"..."
48
- source.scm.commit_if_change do
49
- sub.scm.update
50
- end
51
- end
52
- end
53
- end
54
- end
55
- end
56
- end
@@ -1,52 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module EacRubyBase1
7
- module Sources
8
- class Update
9
- require_sub __FILE__
10
- enable_simple_cache
11
- enable_speaker
12
- common_constructor :source do
13
- perform
14
- end
15
-
16
- def bundle_update
17
- infom 'Running "bundle update"...'
18
- ruby_gem.bundle('update').execute!
19
- infom 'Running "bundle install"...'
20
- ruby_gem.bundle('install').execute!
21
- end
22
-
23
- protected
24
-
25
- def perform
26
- update_gemfile_lock
27
- update_subs
28
- end
29
-
30
- def update_gemfile_lock
31
- source.scm.commit_if_change(-> { update_gemfile_lock_commit_message }) do
32
- bundle_update
33
- end
34
- end
35
-
36
- def update_gemfile_lock_commit_message
37
- i18n_translate(__method__, __locale: source.locale)
38
- end
39
-
40
- def update_subs
41
- source.subs.each do |sub|
42
- ::Avm::EacRubyBase1::Sources::Update::SubUpdate.new(self, sub)
43
- end
44
- end
45
-
46
- def ruby_gem_uncached
47
- ::EacRubyGemsUtils::Gem.new(source.path)
48
- end
49
- end
50
- end
51
- end
52
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module EacRubyBase1
7
- module Sources
8
- require_sub __FILE__
9
- end
10
- end
11
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module EacRubyBase1
5
- VERSION = '0.7.0'
6
- end
7
- end
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module EacRubyBase1
7
- require_sub __FILE__
8
- end
9
- end
@@ -1,8 +0,0 @@
1
- en:
2
- avm:
3
- eac_ruby_base1:
4
- sources:
5
- update:
6
- no_scm_update_commit_message: "Gem \"%{name}\" (Local): update to '%{version}'."
7
- scm_update_commit_message: '**/.gitrepo: fix/update.'
8
- update_gemfile_lock_commit_message: 'All gems: update.'
@@ -1,8 +0,0 @@
1
- pt-BR:
2
- avm:
3
- eac_ruby_base1:
4
- sources:
5
- update:
6
- no_scm_update_commit_message: "Gem \"%{name}\" (Local): atualiza para '%{version}'."
7
- scm_update_commit_message: '**/.gitrepo: conserta/atualiza.'
8
- update_gemfile_lock_commit_message: 'Todas as gems: atualiza.'
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_ruby_base1/bundler/incompatible_parser'
4
-
5
- RSpec.describe ::Avm::EacRubyBase1::Bundler::IncompatibleParser do
6
- include_examples 'source_target_fixtures', __FILE__
7
- end