avm-tools 0.103.0 → 0.106.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (225) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avm/data/package/dump.rb +1 -1
  3. data/lib/avm/instances/base/dockerizable.rb +2 -1
  4. data/lib/avm/launcher/context/instance_collector.rb +46 -0
  5. data/lib/avm/launcher/instances/runner_helper.rb +22 -16
  6. data/lib/avm/launcher/paths/logical.rb +5 -0
  7. data/lib/avm/{core_ext.rb → tools/core_ext.rb} +0 -0
  8. data/lib/avm/tools/runner/app_src/eac_asciidoctor_base0/build.rb +1 -1
  9. data/lib/avm/tools/runner/app_src/info.rb +1 -1
  10. data/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb +62 -0
  11. data/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock.rb +11 -41
  12. data/lib/avm/tools/runner/app_src/test.rb +1 -1
  13. data/lib/avm/tools/runner/app_src/update.rb +1 -1
  14. data/lib/avm/tools/runner/config/load_path.rb +1 -1
  15. data/lib/avm/tools/runner/config.rb +1 -1
  16. data/lib/avm/tools/runner/git/dirty_files.rb +1 -1
  17. data/lib/avm/tools/runner/git/issue/complete.rb +1 -1
  18. data/lib/avm/tools/runner/git/issue/deliver.rb +1 -1
  19. data/lib/avm/tools/runner/git/issue.rb +1 -1
  20. data/lib/avm/tools/runner/git/revisions_test.rb +1 -1
  21. data/lib/avm/tools/runner/git/subrepo/check.rb +1 -1
  22. data/lib/avm/tools/runner/git/subrepo/clone.rb +1 -1
  23. data/lib/avm/tools/runner/git/subrepo/fix.rb +1 -1
  24. data/lib/avm/tools/runner/git/subrepo.rb +1 -1
  25. data/lib/avm/tools/runner/git.rb +1 -1
  26. data/lib/avm/tools/runner/launcher/instances.rb +7 -5
  27. data/lib/avm/tools/runner/launcher/projects.rb +2 -4
  28. data/lib/avm/tools/runner/launcher/publish.rb +2 -6
  29. data/lib/avm/tools/runner/launcher.rb +1 -1
  30. data/lib/avm/tools/runner/ruby/rubocop.rb +1 -1
  31. data/lib/avm/tools/runner/self.rb +1 -1
  32. data/lib/avm/tools/version.rb +1 -1
  33. data/vendor/avm/avm.gemspec +4 -1
  34. data/vendor/avm/lib/avm/docker/runner.rb +4 -8
  35. data/{lib → vendor/avm/lib}/avm/executables.rb +1 -1
  36. data/{lib → vendor/avm/lib}/avm/files/appendable/file_content.rb +0 -0
  37. data/{lib → vendor/avm/lib}/avm/files/appendable/plain_directory.rb +0 -0
  38. data/{lib → vendor/avm/lib}/avm/files/appendable/resource_base.rb +0 -0
  39. data/{lib → vendor/avm/lib}/avm/files/appendable/tar_output_command.rb +0 -0
  40. data/{lib → vendor/avm/lib}/avm/files/appendable/templatized_directory.rb +1 -0
  41. data/{lib → vendor/avm/lib}/avm/files/appendable.rb +0 -0
  42. data/{lib → vendor/avm/lib}/avm/files/appender.rb +0 -0
  43. data/{lib → vendor/avm/lib}/avm/files/deploy.rb +0 -1
  44. data/{lib → vendor/avm/lib}/avm/files/formatter/formats/base.rb +0 -0
  45. data/{lib → vendor/avm/lib}/avm/files/formatter/formats/generic_plain.rb +0 -0
  46. data/{lib → vendor/avm/lib}/avm/files/formatter/formats/html.rb +0 -0
  47. data/vendor/avm/lib/avm/files/formatter/formats/javascript.rb +23 -0
  48. data/{lib → vendor/avm/lib}/avm/files/formatter/formats/json.rb +0 -0
  49. data/{lib → vendor/avm/lib}/avm/files/formatter/formats/php.rb +0 -0
  50. data/{lib → vendor/avm/lib}/avm/files/formatter/formats/python.rb +0 -0
  51. data/{lib → vendor/avm/lib}/avm/files/formatter/formats/ruby.rb +0 -0
  52. data/{lib → vendor/avm/lib}/avm/files/formatter/formats/xml.rb +0 -0
  53. data/{lib → vendor/avm/lib}/avm/files/formatter/formats.rb +0 -0
  54. data/{lib → vendor/avm/lib}/avm/files/formatter/utf8_assert.rb +2 -0
  55. data/{lib → vendor/avm/lib}/avm/files/formatter.rb +1 -1
  56. data/{lib → vendor/avm/lib}/avm/files/info.rb +0 -0
  57. data/{lib → vendor/avm/lib}/avm/files/rotate.rb +0 -0
  58. data/{lib → vendor/avm/lib}/avm/files.rb +0 -0
  59. data/{lib → vendor/avm/lib}/avm/git/auto_commit/commit_info.rb +0 -0
  60. data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules/base.rb +0 -0
  61. data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules/last.rb +0 -0
  62. data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules/manual.rb +0 -0
  63. data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules/new.rb +0 -0
  64. data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules/nth.rb +0 -0
  65. data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules/unique.rb +0 -0
  66. data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules.rb +0 -0
  67. data/{lib → vendor/avm/lib}/avm/git/auto_commit_path/ruby.rb +0 -0
  68. data/{lib → vendor/avm/lib}/avm/git/auto_commit_path.rb +1 -1
  69. data/{lib → vendor/avm/lib}/avm/git/commit/class_methods.rb +0 -0
  70. data/{lib → vendor/avm/lib}/avm/git/commit/deploy.rb +0 -1
  71. data/{lib → vendor/avm/lib}/avm/git/commit/deploy_methods.rb +0 -0
  72. data/{lib → vendor/avm/lib}/avm/git/commit/diff_tree_line.rb +0 -0
  73. data/{lib → vendor/avm/lib}/avm/git/commit/file.rb +2 -2
  74. data/{lib → vendor/avm/lib}/avm/git/commit.rb +3 -2
  75. data/{lib → vendor/avm/lib}/avm/git/file_auto_fixup.rb +0 -0
  76. data/{lib → vendor/avm/lib}/avm/git/issue/complete/commits.rb +0 -0
  77. data/{lib → vendor/avm/lib}/avm/git/issue/complete/git_subrepos.rb +0 -0
  78. data/{lib → vendor/avm/lib}/avm/git/issue/complete/local_branch.rb +0 -0
  79. data/{lib → vendor/avm/lib}/avm/git/issue/complete/local_tag.rb +0 -0
  80. data/{lib → vendor/avm/lib}/avm/git/issue/complete/push.rb +0 -0
  81. data/{lib → vendor/avm/lib}/avm/git/issue/complete/remote.rb +0 -0
  82. data/{lib → vendor/avm/lib}/avm/git/issue/complete/test.rb +0 -0
  83. data/{lib → vendor/avm/lib}/avm/git/issue/complete/tracker.rb +0 -0
  84. data/{lib → vendor/avm/lib}/avm/git/issue/complete/validation.rb +0 -0
  85. data/{lib → vendor/avm/lib}/avm/git/issue/complete/validations.rb +0 -0
  86. data/{lib → vendor/avm/lib}/avm/git/issue/complete/working_tree.rb +0 -0
  87. data/{lib → vendor/avm/lib}/avm/git/issue/complete.rb +1 -1
  88. data/{lib → vendor/avm/lib}/avm/git/issue/deliver.rb +1 -1
  89. data/{lib → vendor/avm/lib}/avm/git/issue.rb +0 -0
  90. data/{lib → vendor/avm/lib}/avm/git/organize/reference_update.rb +0 -0
  91. data/{lib → vendor/avm/lib}/avm/git/organize/repository.rb +0 -0
  92. data/{lib → vendor/avm/lib}/avm/git/organize.rb +0 -0
  93. data/{lib → vendor/avm/lib}/avm/git/revision_test.rb +0 -0
  94. data/{lib → vendor/avm/lib}/avm/git/subrepo_check/parent.rb +0 -0
  95. data/{lib → vendor/avm/lib}/avm/git/subrepo_check/remote.rb +0 -0
  96. data/{lib → vendor/avm/lib}/avm/git/subrepo_check/show_result.rb +0 -1
  97. data/{lib → vendor/avm/lib}/avm/git/subrepo_check.rb +0 -1
  98. data/{lib → vendor/avm/lib}/avm/git/subrepo_checks.rb +1 -1
  99. data/{lib → vendor/avm/lib}/avm/git.rb +0 -0
  100. data/{lib → vendor/avm/lib}/avm/instances/docker_image.rb +0 -0
  101. data/{lib → vendor/avm/lib}/avm/result.rb +0 -0
  102. data/vendor/avm/lib/avm/version.rb +1 -1
  103. data/vendor/avm/spec/lib/avm/git/auto_commit_path_spec.rb +21 -0
  104. data/vendor/avm/spec/lib/avm/git/commit/deploy_spec.rb +93 -0
  105. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec.rb +13 -0
  106. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/add.source.out +1 -0
  107. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/add.target.yaml +7 -0
  108. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/modify.source.out +1 -0
  109. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/modify.target.yaml +7 -0
  110. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/remove.source.out +1 -0
  111. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/remove.target.yaml +7 -0
  112. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename.source.out +2 -0
  113. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename.target.yaml +13 -0
  114. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename_modify.source.out +2 -0
  115. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename_modify.target.yaml +13 -0
  116. data/vendor/avm/spec/lib/avm/git/commit_spec.rb +56 -0
  117. data/vendor/avm/spec/rubocop_spec.rb +1 -1
  118. data/vendor/avm/spec/spec_helper.rb +2 -100
  119. data/vendor/avm-apps/lib/avm/apps/version.rb +1 -1
  120. data/vendor/avm-apps/spec/rubocop_spec.rb +1 -1
  121. data/vendor/avm-apps/spec/spec_helper.rb +2 -101
  122. data/vendor/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec +1 -0
  123. data/{lib → vendor/avm-eac_asciidoctor_base0/lib}/avm/eac_asciidoctor_base0/apache_host.rb +0 -0
  124. data/{lib → vendor/avm-eac_asciidoctor_base0/lib}/avm/eac_asciidoctor_base0/apache_path.rb +0 -0
  125. data/{lib → vendor/avm-eac_asciidoctor_base0/lib}/avm/eac_asciidoctor_base0/deploy.rb +0 -0
  126. data/{lib → vendor/avm-eac_asciidoctor_base0/lib}/avm/eac_asciidoctor_base0/instance.rb +0 -0
  127. data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
  128. data/vendor/avm-eac_asciidoctor_base0/spec/rubocop_spec.rb +1 -1
  129. data/vendor/avm-eac_asciidoctor_base0/spec/spec_helper.rb +2 -100
  130. data/vendor/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/logs.rb +1 -1
  131. data/vendor/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
  132. data/vendor/avm-eac_rails_base1/spec/rubocop_spec.rb +1 -1
  133. data/vendor/avm-eac_rails_base1/spec/spec_helper.rb +2 -100
  134. data/vendor/avm-eac_redmine_base0/Gemfile +5 -0
  135. data/vendor/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +19 -0
  136. data/{lib → vendor/avm-eac_redmine_base0/lib}/avm/eac_redmine_base0/apache_host.rb +0 -0
  137. data/{lib → vendor/avm-eac_redmine_base0/lib}/avm/eac_redmine_base0/core_update.rb +0 -0
  138. data/{lib → vendor/avm-eac_redmine_base0/lib}/avm/eac_redmine_base0/data_unit.rb +0 -0
  139. data/{lib → vendor/avm-eac_redmine_base0/lib}/avm/eac_redmine_base0/deploy.rb +0 -0
  140. data/{lib → vendor/avm-eac_redmine_base0/lib}/avm/eac_redmine_base0/instance.rb +2 -2
  141. data/vendor/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/docker_image.rb +55 -0
  142. data/vendor/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/patches/object/template.rb +7 -0
  143. data/vendor/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +7 -0
  144. data/{lib/avm/eac_asciidoctor_base0.rb → vendor/avm-eac_redmine_base0/lib/avm/eac_redmine_base0.rb} +1 -1
  145. data/vendor/avm-eac_redmine_base0/spec/rubocop_spec.rb +3 -0
  146. data/vendor/avm-eac_redmine_base0/spec/spec_helper.rb +4 -0
  147. data/{template → vendor/avm-eac_redmine_base0/template}/avm/eac_redmine_base0/deploy/config/install.sh.template +1 -0
  148. data/{template → vendor/avm-eac_redmine_base0/template}/avm/eac_redmine_base0/deploy/config/secrets.yml +0 -0
  149. data/{template/avm/eac_redmine_base0 → vendor/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances}/docker_image/Dockerfile.template +1 -1
  150. data/{template/avm/eac_redmine_base0 → vendor/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances}/docker_image/apache_http_virtualhost.conf.template +0 -0
  151. data/{template/avm/eac_redmine_base0 → vendor/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances}/docker_image/apache_https_virtualhost.conf.template +0 -0
  152. data/vendor/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/install_settings.sh.template +24 -0
  153. data/{template/avm/eac_redmine_base0 → vendor/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances}/docker_image/start.sh.template +0 -0
  154. data/vendor/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
  155. data/vendor/avm-eac_webapp_base0/spec/rubocop_spec.rb +1 -1
  156. data/vendor/avm-eac_webapp_base0/spec/spec_helper.rb +2 -100
  157. data/vendor/eac_cli/eac_cli.gemspec +3 -3
  158. data/vendor/eac_cli/lib/eac_cli/config/entry.rb +0 -2
  159. data/vendor/eac_cli/lib/eac_cli/definition/argument_option.rb +1 -1
  160. data/vendor/eac_cli/lib/eac_cli/definition/base_option.rb +9 -1
  161. data/vendor/eac_cli/lib/eac_cli/definition/boolean_option.rb +6 -0
  162. data/vendor/eac_cli/lib/eac_cli/runner_with/help/builder.rb +3 -3
  163. data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
  164. data/vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb +6 -5
  165. data/vendor/eac_cli/spec/rubocop_spec.rb +1 -1
  166. data/vendor/eac_cli/spec/spec_helper.rb +2 -101
  167. data/vendor/eac_config/eac_config.gemspec +2 -2
  168. data/vendor/eac_config/lib/eac_config/version.rb +1 -1
  169. data/vendor/eac_config/spec/rubocop_spec.rb +1 -1
  170. data/vendor/eac_config/spec/spec_helper.rb +2 -15
  171. data/vendor/eac_docker/eac_docker.gemspec +2 -2
  172. data/vendor/eac_docker/lib/eac_docker/container.rb +7 -3
  173. data/vendor/eac_docker/lib/eac_docker/debug.rb +15 -0
  174. data/vendor/eac_docker/lib/eac_docker/images/coded.rb +4 -0
  175. data/vendor/eac_docker/lib/eac_docker/images/templatized.rb +16 -2
  176. data/vendor/eac_docker/lib/eac_docker/rspec/setup.rb +17 -0
  177. data/vendor/eac_docker/lib/eac_docker/rspec.rb +2 -10
  178. data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
  179. data/vendor/eac_docker/spec/rubocop_spec.rb +1 -1
  180. data/vendor/eac_docker/spec/spec_helper.rb +2 -104
  181. data/vendor/eac_git/eac_git.gemspec +3 -3
  182. data/vendor/eac_git/lib/eac_git/rspec/setup.rb +23 -0
  183. data/vendor/eac_git/lib/eac_git/rspec.rb +1 -14
  184. data/vendor/eac_git/lib/eac_git/version.rb +1 -1
  185. data/vendor/eac_git/spec/rubocop_spec.rb +1 -1
  186. data/vendor/eac_git/spec/spec_helper.rb +2 -104
  187. data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +4 -4
  188. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
  189. data/vendor/eac_ruby_base0/spec/rubocop_spec.rb +1 -1
  190. data/vendor/eac_ruby_base0/spec/spec_helper.rb +2 -101
  191. data/vendor/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +2 -2
  192. data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +1 -1
  193. data/vendor/eac_ruby_gems_utils/spec/code/rubocop_check_spec.rb +1 -1
  194. data/vendor/eac_ruby_gems_utils/spec/spec_helper.rb +2 -101
  195. data/vendor/eac_ruby_utils/eac_ruby_utils.gemspec +1 -1
  196. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/boolean.rb +1 -1
  197. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/compact.rb +22 -0
  198. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/executable.rb +15 -3
  199. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs_cache.rb +1 -1
  200. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem.rb +75 -0
  201. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/gems_registry.rb +35 -0
  202. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/compact.rb +20 -0
  203. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/delimited.rb +16 -0
  204. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/recursive_builder.rb +51 -0
  205. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/default_setup.rb +20 -0
  206. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup/conditionals.rb +17 -0
  207. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup.rb +12 -0
  208. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup_manager.rb +49 -0
  209. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/string_delimited.rb +70 -0
  210. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  211. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/compact_spec.rb +20 -0
  212. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/compact_spec.rb +20 -0
  213. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/string/delimited_spec.rb +34 -0
  214. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/recursive_builder_spec.rb +65 -0
  215. data/vendor/eac_ruby_utils/spec/rubocop_check_spec.rb +1 -1
  216. data/vendor/eac_ruby_utils/spec/spec_helper.rb +6 -6
  217. data/vendor/eac_templates/lib/eac_templates/version.rb +1 -1
  218. data/vendor/eac_templates/spec/rubocop_spec.rb +1 -1
  219. data/vendor/eac_templates/spec/spec_helper.rb +2 -100
  220. metadata +129 -91
  221. data/lib/avm/eac_redmine_base0/docker_image.rb +0 -52
  222. data/lib/avm/eac_redmine_base0.rb +0 -9
  223. data/template/avm/eac_redmine_base0/docker_image/install_settings.sh.template +0 -29
  224. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/conditional.rb +0 -35
  225. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/stubbed_ssh.rb +0 -44
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6bffe9e6a04311e0c66d08f3b7ba116722ae23aa59707b96bd565988d1e3b3ff
4
- data.tar.gz: bf8b80f6b8328e3327b78af66c3d7961ba81d2157d1133ca39ccd62bb18b8249
3
+ metadata.gz: 4a71fc17b60e581ba891e58d0b47ad9b4dbae79c2085540bb1816e02011e9af9
4
+ data.tar.gz: 15387681892ce7192edd15b0e68ee801ed0fca233454b802df21f7d5e0a211a4
5
5
  SHA512:
6
- metadata.gz: fde4268d2ead8d77d08cb6e6c2c617126372bc4a6fef6adb582702544f1e16c1a82d7a99178e4ab092dd53504bed2abdf3c3ad11c6e8987d42f98469f07cd0ab
7
- data.tar.gz: 75f730ff566ca0c50d3cf0f0a76eb68c2f9526186f66522d54376eb85ffdeaa0410b83cca52f0e96b98dd9eafe8611f0b06bc6c70ff4850a7b9aea679749ebba
6
+ metadata.gz: d61dadda2108d0d2b7a37f9ec55bbcbc73e222c87f463feec8b91d8f486b3869f1652849296a9bcb7c33e58fe65f1a99f5d12fe7e71c2b1fcf58231b2f453124
7
+ data.tar.gz: 13a712ee6f75e13797fcf5107ad9b0c72f730195d4264e36ea5368635205aa68c55deb88c8055f01381342cefe48bf74d0decba9d6fe5052df6c6571622a1daf
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/core_ext'
3
+ require 'avm/tools/core_ext'
4
4
  require 'avm/files/rotate'
5
5
  require 'minitar'
6
6
 
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'eac_docker/executables'
3
4
  require 'eac_ruby_utils/core_ext'
4
5
  require 'avm/docker/container'
5
6
 
@@ -16,7 +17,7 @@ module Avm
16
17
  end
17
18
 
18
19
  def docker_container_exist?
19
- ::Avm::Executables.docker.command.append(
20
+ ::EacDocker::Executables.docker.command.append(
20
21
  ['ps', '-qaf', "name=#{docker_container_name}"]
21
22
  ).execute!.present?
22
23
  end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Launcher
7
+ class Context
8
+ class InstanceCollector
9
+ common_constructor :context
10
+
11
+ def add_all
12
+ instances_set.merge(context.instances)
13
+ self
14
+ end
15
+
16
+ def add_path(path)
17
+ instances_set.merge(instances_on_path(path))
18
+ self
19
+ end
20
+
21
+ def add_pending
22
+ instances_set.merge(context.pending_instances)
23
+ self
24
+ end
25
+
26
+ def instances
27
+ instances_set.sort
28
+ end
29
+
30
+ private
31
+
32
+ def instance_match?(instance, instance_name)
33
+ ::File.fnmatch?(instance_name, instance.name)
34
+ end
35
+
36
+ def instances_on_path(path)
37
+ context.instances.select { |instance| instance_match?(instance, path) }
38
+ end
39
+
40
+ def instances_set
41
+ @instances_set ||= ::Set.new
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -1,31 +1,33 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/core_ext'
3
+ require 'avm/launcher/context'
4
+ require 'avm/tools/core_ext'
5
+ require 'avm/launcher/context/instance_collector'
4
6
 
5
7
  module Avm
6
8
  module Launcher
7
9
  module Instances
8
- class RunnerHelper
9
- def context
10
- @context ||= ::Avm::Launcher::Context.current
11
- end
10
+ module RunnerHelper
11
+ common_concern do
12
+ runner_definition do
13
+ bool_opt '--all', 'Select all instances.'
14
+ bool_opt '--pending', 'Select pending instances.'
15
+ bool_opt '--recache', 'Rewrite instances cache.'
16
+ end
12
17
 
13
- def find_instances(instance_name)
14
- context.instances.select { |instance| instance_match?(instance, instance_name) }
18
+ set_callback :run, :before, :setup_cache
15
19
  end
16
20
 
17
- def instance_match?(instance, instance_name)
18
- ::File.fnmatch?(instance_name, instance.name)
21
+ def context
22
+ @context ||= ::Avm::Launcher::Context.current
19
23
  end
20
24
 
21
25
  def instances
22
- if parsed.all?
23
- context.instances
24
- elsif parsed.pending?
25
- context.pending_instances
26
- else
27
- parsed.instance_path.flat_map { |p| find_instances(p) }
28
- end
26
+ collector = ::Avm::Launcher::Context::InstanceCollector.new(context)
27
+ collector.add_all if parsed.all?
28
+ collector.add_pending if parsed.pending?
29
+ parsed.instance_path.flat_map { |p| collector.add_path(p) }
30
+ collector.instances
29
31
  end
30
32
 
31
33
  def instance_stereotypes(instance)
@@ -35,6 +37,10 @@ module Avm
35
37
  def instance_label(instance)
36
38
  "#{instance.name} [#{instance_stereotypes(instance)}]"
37
39
  end
40
+
41
+ def setup_cache
42
+ ::Avm::Launcher::Context.current.recache = parsed.recache?
43
+ end
38
44
  end
39
45
  end
40
46
  end
@@ -7,6 +7,7 @@ module Avm
7
7
  module Launcher
8
8
  module Paths
9
9
  class Logical
10
+ include ::Comparable
10
11
  include ::EacRubyUtils::SimpleCache
11
12
 
12
13
  class << self
@@ -25,6 +26,10 @@ module Avm
25
26
  @logical = logical
26
27
  end
27
28
 
29
+ def <=>(other)
30
+ [logical, real] <=> [other.logical, other.real]
31
+ end
32
+
28
33
  def to_s
29
34
  logical
30
35
  end
File without changes
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/core_ext'
3
+ require 'avm/tools/core_ext'
4
4
  require 'avm/eac_asciidoctor_base0/sources/build'
5
5
  require 'os'
6
6
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/core_ext'
3
+ require 'avm/tools/core_ext'
4
4
 
5
5
  module Avm
6
6
  module Tools
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_base0/core_ext'
4
+
5
+ module Avm
6
+ module Tools
7
+ class Runner
8
+ class AppSrc
9
+ class Ruby
10
+ class Bundler
11
+ class GemfileLock
12
+ module Git
13
+ private
14
+
15
+ def git_continue
16
+ return unless check_capability(__method__, :git_repo, :continue)
17
+
18
+ infom "Adding \"#{gemfile_lock}\"..."
19
+ instance.git_repo.command('add', gemfile_lock).execute!
20
+ if rebase_conflict?
21
+ git_continue_run('rebase')
22
+ elsif cherry_conflict?
23
+ git_continue_run('cherry-pick')
24
+ else
25
+ raise 'Unknown how to continue'
26
+ end
27
+ end
28
+
29
+ def git_continue_run(command)
30
+ infom "\"#{command}\" --continue..."
31
+ cmd = instance.git_repo.command(command, '--continue')
32
+ .envvar('GIT_EDITOR', 'true')
33
+ return unless !cmd.system && !conflict?
34
+
35
+ fatal_error "\"#{cmd}\" failed and there is no conflict"
36
+ end
37
+
38
+ def git_reset_checkout
39
+ return unless check_capability(__method__, :git_repo, nil)
40
+
41
+ git_reset_gemfile_lock
42
+ git_checkout_gemfile_lock
43
+ end
44
+
45
+ def git_checkout_gemfile_lock
46
+ infom 'Checkouting...'
47
+ instance.git_repo.command('checkout', '--', gemfile_lock).system!
48
+ end
49
+
50
+ def git_reset_gemfile_lock
51
+ infom 'Reseting...'
52
+ instance.git_repo.command('reset', gemfile_lock).system! if
53
+ ::File.exist?(gemfile_lock)
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -9,18 +9,21 @@ module Avm
9
9
  class Ruby
10
10
  class Bundler
11
11
  class GemfileLock
12
+ require_sub __FILE__, include_modules: true
12
13
  runner_with :help do
13
14
  desc 'Manipulage a "Gemfile.lock" file.'
14
15
  bool_opt '-c', '--continue', 'Continue Git rebase/cherry-pick.'
15
16
  bool_opt '-i', '--install', 'Run "bundle install".'
16
17
  bool_opt '-u', '--update', 'Run "bundle update".'
17
18
  bool_opt '-r', '--recursive', 'Run until Git rebase/cherry-pick is finished.'
18
- bool_opt '-a', '--all', 'Same as "-ciru".'
19
+ bool_opt '-a', '--all', 'Same as "-cirud".'
20
+ bool_opt '-d', '--delete', 'Delete Gemfile.lock'
19
21
  end
20
22
 
21
23
  def run
22
24
  loop do
23
25
  git_reset_checkout
26
+ delete_gemfile_lock
24
27
  bundle_update
25
28
  bundle_install
26
29
  git_continue
@@ -34,17 +37,14 @@ module Avm
34
37
  !option_or_all?(:recursive) || !conflict?
35
38
  end
36
39
 
37
- def rebasing?
38
- instance.git_repo.root_path.join('.git', 'rebase-merge').exist?
39
- end
40
+ def delete_gemfile_lock
41
+ return unless check_capability(__method__, nil, :delete)
40
42
 
41
- def git_reset_checkout
42
- return unless check_capability(__method__, :git_repo, nil)
43
+ ::FileUtils.rm_f(gemfile_lock)
44
+ end
43
45
 
44
- infom 'Reseting...'
45
- instance.git_repo.command('reset', gemfile_lock).system!
46
- infom 'Checkouting...'
47
- instance.git_repo.command('checkout', '--', gemfile_lock).system!
46
+ def rebasing?
47
+ instance.git_repo.root_path.join('.git', 'rebase-merge').exist?
48
48
  end
49
49
 
50
50
  def bundle_install
@@ -61,44 +61,14 @@ module Avm
61
61
  bundle_run('update')
62
62
  end
63
63
 
64
- def git_continue
65
- return unless check_capability(__method__, :git_repo, :continue)
66
-
67
- infom "Adding \"#{gemfile_lock}\"..."
68
- instance.git_repo.command('add', gemfile_lock).execute!
69
- if rebase_conflict?
70
- git_continue_run('rebase')
71
- elsif cherry_conflict?
72
- git_continue_run('cherry-pick')
73
- else
74
- raise 'Unknown how to continue'
75
- end
76
- end
77
-
78
- def git_continue_run(command)
79
- infom "\"#{command}\" --continue..."
80
- cmd = instance.git_repo.command(command, '--continue').envvar('GIT_EDITOR', 'true')
81
- return unless !cmd.system && !conflict?
82
-
83
- fatal_error "\"#{cmd}\" failed and there is no conflict"
84
- end
85
-
86
64
  def gemfile_lock
87
65
  'Gemfile.lock'
88
66
  end
89
67
 
90
- def git_uncached
91
- ::EacGit::Local.new(git_path)
92
- end
93
-
94
68
  def bundle_run(*args)
95
69
  instance.ruby_gem.bundle(*args).system!
96
70
  end
97
71
 
98
- def git_path
99
- '.'
100
- end
101
-
102
72
  def conflict?
103
73
  rebase_conflict? || cherry_conflict?
104
74
  end
@@ -121,7 +91,7 @@ module Avm
121
91
 
122
92
  def check_capability(caller, capability, option)
123
93
  return false unless option.blank? || option_or_all?(option)
124
- return true if instance.respond_to?(capability)
94
+ return true if capability.if_present(true) { |v| instance.respond_to?(v) }
125
95
 
126
96
  warn "Cannot run #{caller}: instance has no capability \"#{capability}\""
127
97
  false
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/core_ext'
3
+ require 'avm/tools/core_ext'
4
4
 
5
5
  module Avm
6
6
  module Tools
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/core_ext'
3
+ require 'avm/tools/core_ext'
4
4
 
5
5
  module Avm
6
6
  module Tools
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'avm/apps/config'
4
4
  require 'avm/self'
5
- require 'avm/core_ext'
5
+ require 'avm/tools/core_ext'
6
6
 
7
7
  module Avm
8
8
  module Tools
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/core_ext'
3
+ require 'avm/tools/core_ext'
4
4
 
5
5
  module Avm
6
6
  module Tools
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/core_ext'
3
+ require 'avm/tools/core_ext'
4
4
 
5
5
  module Avm
6
6
  module Tools
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/core_ext'
3
+ require 'avm/tools/core_ext'
4
4
  require 'avm/git/issue/complete'
5
5
 
6
6
  module Avm
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/core_ext'
3
+ require 'avm/tools/core_ext'
4
4
  require 'avm/git/issue/deliver'
5
5
 
6
6
  module Avm
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/core_ext'
3
+ require 'avm/tools/core_ext'
4
4
  require 'avm/git/issue/complete'
5
5
 
6
6
  module Avm
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/core_ext'
3
+ require 'avm/tools/core_ext'
4
4
  require 'avm/git/revision_test'
5
5
 
6
6
  module Avm
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/core_ext'
3
+ require 'avm/tools/core_ext'
4
4
  require 'eac_git/local'
5
5
 
6
6
  module Avm
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/core_ext'
3
+ require 'avm/tools/core_ext'
4
4
  require 'eac_git/local'
5
5
 
6
6
  module Avm
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/core_ext'
3
+ require 'avm/tools/core_ext'
4
4
  require 'eac_git/local'
5
5
 
6
6
  module Avm
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/core_ext'
3
+ require 'avm/tools/core_ext'
4
4
 
5
5
  module Avm
6
6
  module Tools
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/core_ext'
3
+ require 'avm/tools/core_ext'
4
4
  require 'avm/launcher/git/base'
5
5
 
6
6
  module Avm
@@ -6,16 +6,14 @@ module Avm
6
6
  module Tools
7
7
  class Runner
8
8
  class Launcher
9
- class Instances < ::Avm::Launcher::Instances::RunnerHelper
10
- runner_with :help do
9
+ class Instances
10
+ runner_with :help, ::Avm::Launcher::Instances::RunnerHelper do
11
11
  desc 'Mostra informações sobre instâncias.'
12
- bool_opt '--recache', 'Rewrite instances cache.'
13
- bool_opt '--all', 'Get all instances.'
12
+ bool_opt '-e', '--extra', 'Show instances\' extra data.'
14
13
  pos_arg :instance_path, repeat: true, optional: true
15
14
  end
16
15
 
17
16
  def run
18
- ::Avm::Launcher::Context.current.recache = parsed.recache?
19
17
  instances.each { |i| show_instance(i) }
20
18
  end
21
19
 
@@ -23,6 +21,10 @@ module Avm
23
21
 
24
22
  def show_instance(instance)
25
23
  puts instance_label(instance)
24
+ show_instance_extra(instance) if parsed.extra?
25
+ end
26
+
27
+ def show_instance_extra(instance)
26
28
  infov(' * Parent', (instance.parent ? instance_label(instance.parent) : '-'))
27
29
  infov(' * Git current revision', instance.options.git_current_revision)
28
30
  infov(' * Git publish remote', instance.options.git_publish_remote)
@@ -7,15 +7,13 @@ module Avm
7
7
  module Tools
8
8
  class Runner
9
9
  class Launcher
10
- class Projects < ::Avm::Launcher::Instances::RunnerHelper
11
- runner_with :help do
10
+ class Projects
11
+ runner_with :help, ::Avm::Launcher::Instances::RunnerHelper do
12
12
  desc 'Shows available projects.'
13
- bool_opt '--recache', 'Rewrite instances cache.'
14
13
  bool_opt '-i', '--instances', 'Show instances.'
15
14
  end
16
15
 
17
16
  def run
18
- ::Avm::Launcher::Context.current.recache = parsed.recache?
19
17
  ::Avm::Launcher::Context.current.projects.each do |p|
20
18
  show_project(p)
21
19
  end
@@ -6,21 +6,17 @@ module Avm
6
6
  module Tools
7
7
  class Runner
8
8
  class Launcher
9
- class Publish < ::Avm::Launcher::Instances::RunnerHelper
10
- runner_with :help do
9
+ class Publish
10
+ runner_with :help, ::Avm::Launcher::Instances::RunnerHelper do
11
11
  desc 'Publica projetos ou instâncias.'
12
- bool_opt '--all', 'Get all instances.'
13
12
  bool_opt '-d', '--dry-run', '"Dry run" publishing.'
14
13
  bool_opt '--new', 'Publish projects not published before.'
15
- bool_opt '--pending', 'Publish only pending.'
16
- bool_opt '--recache', 'Rewrite instances cache.'
17
14
  bool_opt '--run', 'Confirm publishing.'
18
15
  arg_opt '-s', '--stereotype', 'Publish only for stereotype <stereotype>.'
19
16
  pos_arg :instance_path, repeat: true, optional: true
20
17
  end
21
18
 
22
19
  def run
23
- ::Avm::Launcher::Context.current.recache = parsed.recache?
24
20
  build_publish_options
25
21
  instances.each do |i|
26
22
  next unless i.options.publishable?
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/core_ext'
3
+ require 'avm/tools/core_ext'
4
4
 
5
5
  module Avm
6
6
  module Tools
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/core_ext'
3
+ require 'avm/tools/core_ext'
4
4
  require 'avm/ruby/rubocop'
5
5
 
6
6
  module Avm
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/core_ext'
3
+ require 'avm/tools/core_ext'
4
4
  require 'avm/self'
5
5
 
6
6
  module Avm
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.103.0'
5
+ VERSION = '0.106.0'
6
6
  end
7
7
  end
@@ -12,8 +12,11 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib}/**/*']
14
14
 
15
- s.add_dependency 'eac_docker', '~> 0.2', '>= 0.2.2'
15
+ s.add_dependency 'eac_docker', '~> 0.3'
16
+ s.add_dependency 'eac_git', '~> 0.6'
16
17
  s.add_dependency 'eac_ruby_utils', '~> 0.68'
18
+ s.add_dependency 'eac_templates', '~> 0.1', '>= 0.1.1'
17
19
 
20
+ s.add_development_dependency 'aranha-parsers', '~> 0.7', '>= 0.7.2'
18
21
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
19
22
  end
@@ -6,6 +6,8 @@ require 'eac_ruby_utils/core_ext'
6
6
  module Avm
7
7
  module Docker
8
8
  class Runner
9
+ DOCKER_DEFAULT_REGISTRY_METHOD = :docker_default_registry
10
+
9
11
  enable_speaker
10
12
  enable_simple_cache
11
13
 
@@ -92,17 +94,11 @@ module Avm
92
94
  end
93
95
 
94
96
  def registry_from_instance
95
- if if_respond(:use_default_registry?, true)
96
- instance.docker_registry_optional.if_present { |v| ::EacDocker::Registry.new(v) }
97
- else
98
- ::EacDocker::Registry.new(instance.docker_registry)
99
- end
97
+ instance.docker_registry_optional.if_present { |v| ::EacDocker::Registry.new(v) }
100
98
  end
101
99
 
102
100
  def registry_from_default
103
- return nil unless if_respond(:use_default_registry?, true)
104
-
105
- nyi 'Was "::Avm::Docker::Registry.default"'
101
+ if_respond(DOCKER_DEFAULT_REGISTRY_METHOD, nil)
106
102
  end
107
103
 
108
104
  def snapshot?
@@ -14,7 +14,7 @@ module Avm
14
14
 
15
15
  private
16
16
 
17
- %w[docker file git latex php-cs-fixer tidy yapf xdg-open].each do |program|
17
+ %w[file git js-beautify latex php-cs-fixer tidy yapf xdg-open].each do |program|
18
18
  define_method(program.underscore + '_uncached') do
19
19
  env.executable(program, '--version')
20
20
  end