avm-tools 0.103.1 → 0.107.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (241) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avm/instances/entry.rb +3 -3
  3. data/lib/avm/launcher/context/instance_collector.rb +46 -0
  4. data/lib/avm/launcher/instances/runner_helper.rb +21 -15
  5. data/lib/avm/launcher/paths/logical.rb +5 -0
  6. data/lib/avm/patches/eac_ruby_gems_utils/gem.rb +2 -2
  7. data/lib/avm/ruby/rubocop/_configured.rb +2 -2
  8. data/lib/avm/tools/app_src.rb +68 -0
  9. data/lib/avm/tools/runner/app_src/info.rb +16 -2
  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/ruby/bundler/incompatible.rb +2 -4
  13. data/lib/avm/tools/runner/app_src.rb +2 -2
  14. data/lib/avm/tools/runner/config/load_path.rb +2 -2
  15. data/lib/avm/tools/runner/git/deploy.rb +2 -2
  16. data/lib/avm/tools/runner/launcher/instances.rb +7 -5
  17. data/lib/avm/tools/runner/launcher/projects.rb +2 -4
  18. data/lib/avm/tools/runner/launcher/publish.rb +2 -6
  19. data/lib/avm/tools/runner.rb +1 -1
  20. data/lib/avm/tools/version.rb +1 -1
  21. data/vendor/avm/avm.gemspec +6 -0
  22. data/vendor/avm/lib/avm/app_src/base.rb +45 -0
  23. data/vendor/avm/lib/avm/app_src/configuration/_locale.rb +16 -0
  24. data/vendor/avm/lib/avm/app_src/configuration/_rubocop.rb +24 -0
  25. data/vendor/avm/lib/avm/app_src/configuration/_tests.rb +27 -0
  26. data/vendor/avm/lib/avm/app_src/configuration.rb +55 -0
  27. data/{lib/avm/eac_asciidoctor_base0.rb → vendor/avm/lib/avm/app_src.rb} +1 -1
  28. data/{lib → vendor/avm/lib}/avm/executables.rb +1 -1
  29. data/{lib → vendor/avm/lib}/avm/files/appendable/file_content.rb +0 -0
  30. data/{lib → vendor/avm/lib}/avm/files/appendable/plain_directory.rb +0 -0
  31. data/{lib → vendor/avm/lib}/avm/files/appendable/resource_base.rb +0 -0
  32. data/{lib → vendor/avm/lib}/avm/files/appendable/tar_output_command.rb +0 -0
  33. data/{lib → vendor/avm/lib}/avm/files/appendable/templatized_directory.rb +1 -0
  34. data/{lib → vendor/avm/lib}/avm/files/appendable.rb +0 -0
  35. data/{lib → vendor/avm/lib}/avm/files/appender.rb +0 -0
  36. data/{lib → vendor/avm/lib}/avm/files/deploy.rb +0 -1
  37. data/{lib → vendor/avm/lib}/avm/files/formatter/formats/base.rb +2 -2
  38. data/{lib → vendor/avm/lib}/avm/files/formatter/formats/generic_plain.rb +0 -0
  39. data/{lib → vendor/avm/lib}/avm/files/formatter/formats/html.rb +0 -0
  40. data/vendor/avm/lib/avm/files/formatter/formats/javascript.rb +24 -0
  41. data/{lib → vendor/avm/lib}/avm/files/formatter/formats/json.rb +0 -0
  42. data/{lib → vendor/avm/lib}/avm/files/formatter/formats/php.rb +1 -0
  43. data/{lib → vendor/avm/lib}/avm/files/formatter/formats/python.rb +1 -0
  44. data/{lib → vendor/avm/lib}/avm/files/formatter/formats/ruby.rb +0 -0
  45. data/{lib → vendor/avm/lib}/avm/files/formatter/formats/xml.rb +1 -0
  46. data/{lib → vendor/avm/lib}/avm/files/formatter/formats.rb +0 -0
  47. data/{lib → vendor/avm/lib}/avm/files/formatter/utf8_assert.rb +3 -1
  48. data/{lib → vendor/avm/lib}/avm/files/formatter.rb +1 -1
  49. data/{lib → vendor/avm/lib}/avm/files/rotate.rb +0 -0
  50. data/{lib → vendor/avm/lib}/avm/files.rb +0 -0
  51. data/{lib → vendor/avm/lib}/avm/git/auto_commit/commit_info.rb +0 -0
  52. data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules/base.rb +0 -0
  53. data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules/last.rb +0 -0
  54. data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules/manual.rb +0 -0
  55. data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules/new.rb +0 -0
  56. data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules/nth.rb +0 -0
  57. data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules/unique.rb +0 -0
  58. data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules.rb +0 -0
  59. data/{lib → vendor/avm/lib}/avm/git/auto_commit_path/ruby.rb +0 -0
  60. data/{lib → vendor/avm/lib}/avm/git/auto_commit_path.rb +1 -1
  61. data/{lib → vendor/avm/lib}/avm/git/commit/class_methods.rb +0 -0
  62. data/{lib → vendor/avm/lib}/avm/git/commit/deploy.rb +0 -1
  63. data/{lib → vendor/avm/lib}/avm/git/commit/deploy_methods.rb +0 -0
  64. data/{lib → vendor/avm/lib}/avm/git/commit/diff_tree_line.rb +0 -0
  65. data/{lib → vendor/avm/lib}/avm/git/commit/file.rb +2 -2
  66. data/{lib → vendor/avm/lib}/avm/git/commit.rb +3 -2
  67. data/{lib → vendor/avm/lib}/avm/git/file_auto_fixup.rb +0 -0
  68. data/{lib → vendor/avm/lib}/avm/git/issue/complete/commits.rb +0 -0
  69. data/{lib → vendor/avm/lib}/avm/git/issue/complete/git_subrepos.rb +0 -0
  70. data/{lib → vendor/avm/lib}/avm/git/issue/complete/local_branch.rb +0 -0
  71. data/{lib → vendor/avm/lib}/avm/git/issue/complete/local_tag.rb +0 -0
  72. data/{lib → vendor/avm/lib}/avm/git/issue/complete/push.rb +0 -0
  73. data/{lib → vendor/avm/lib}/avm/git/issue/complete/remote.rb +0 -0
  74. data/{lib → vendor/avm/lib}/avm/git/issue/complete/test.rb +2 -2
  75. data/{lib → vendor/avm/lib}/avm/git/issue/complete/tracker.rb +0 -0
  76. data/{lib → vendor/avm/lib}/avm/git/issue/complete/validation.rb +0 -0
  77. data/{lib → vendor/avm/lib}/avm/git/issue/complete/validations.rb +0 -0
  78. data/{lib → vendor/avm/lib}/avm/git/issue/complete/working_tree.rb +0 -0
  79. data/{lib → vendor/avm/lib}/avm/git/issue/complete.rb +0 -0
  80. data/{lib → vendor/avm/lib}/avm/git/issue/deliver.rb +0 -0
  81. data/{lib → vendor/avm/lib}/avm/git/issue.rb +0 -0
  82. data/{lib → vendor/avm/lib}/avm/git/organize/reference_update.rb +0 -0
  83. data/{lib → vendor/avm/lib}/avm/git/organize/repository.rb +0 -0
  84. data/{lib → vendor/avm/lib}/avm/git/organize.rb +0 -0
  85. data/{lib → vendor/avm/lib}/avm/git/revision_test.rb +2 -3
  86. data/{lib → vendor/avm/lib}/avm/git/subrepo_check/parent.rb +0 -0
  87. data/{lib → vendor/avm/lib}/avm/git/subrepo_check/remote.rb +0 -0
  88. data/{lib → vendor/avm/lib}/avm/git/subrepo_check/show_result.rb +0 -1
  89. data/{lib → vendor/avm/lib}/avm/git/subrepo_check.rb +0 -1
  90. data/{lib → vendor/avm/lib}/avm/git/subrepo_checks.rb +1 -1
  91. data/{lib → vendor/avm/lib}/avm/git.rb +0 -0
  92. data/vendor/avm/lib/avm/jobs/base.rb +62 -0
  93. data/vendor/avm/lib/avm/jobs/variables_source.rb +22 -0
  94. data/vendor/{avm-apps/lib/avm/apps → avm/lib/avm}/jobs.rb +2 -4
  95. data/{lib → vendor/avm/lib}/avm/result.rb +0 -0
  96. data/vendor/avm/lib/avm/version.rb +1 -1
  97. data/vendor/avm/spec/lib/avm/git/auto_commit_path_spec.rb +21 -0
  98. data/vendor/avm/spec/lib/avm/git/commit/deploy_spec.rb +93 -0
  99. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec.rb +13 -0
  100. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/add.source.out +1 -0
  101. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/add.target.yaml +7 -0
  102. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/modify.source.out +1 -0
  103. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/modify.target.yaml +7 -0
  104. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/remove.source.out +1 -0
  105. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/remove.target.yaml +7 -0
  106. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename.source.out +2 -0
  107. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename.target.yaml +13 -0
  108. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename_modify.source.out +2 -0
  109. data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename_modify.target.yaml +13 -0
  110. data/vendor/avm/spec/lib/avm/git/commit_spec.rb +56 -0
  111. data/vendor/avm/spec/rubocop_spec.rb +1 -1
  112. data/vendor/avm/spec/spec_helper.rb +2 -100
  113. data/vendor/avm-apps/avm-apps.gemspec +1 -1
  114. data/vendor/avm-apps/lib/avm/apps/version.rb +1 -1
  115. data/vendor/avm-apps/spec/rubocop_spec.rb +1 -1
  116. data/vendor/avm-apps/spec/spec_helper.rb +2 -101
  117. data/vendor/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec +1 -0
  118. data/{lib → vendor/avm-eac_asciidoctor_base0/lib}/avm/eac_asciidoctor_base0/apache_host.rb +0 -0
  119. data/{lib → vendor/avm-eac_asciidoctor_base0/lib}/avm/eac_asciidoctor_base0/apache_path.rb +0 -0
  120. data/{lib → vendor/avm-eac_asciidoctor_base0/lib}/avm/eac_asciidoctor_base0/deploy.rb +0 -0
  121. data/{lib → vendor/avm-eac_asciidoctor_base0/lib}/avm/eac_asciidoctor_base0/instance.rb +0 -0
  122. data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
  123. data/vendor/avm-eac_asciidoctor_base0/spec/rubocop_spec.rb +1 -1
  124. data/vendor/avm-eac_asciidoctor_base0/spec/spec_helper.rb +2 -100
  125. data/vendor/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
  126. data/vendor/avm-eac_rails_base1/spec/rubocop_spec.rb +1 -1
  127. data/vendor/avm-eac_rails_base1/spec/spec_helper.rb +2 -100
  128. data/vendor/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +3 -1
  129. data/vendor/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/core_update.rb +3 -2
  130. data/vendor/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
  131. data/vendor/avm-eac_redmine_base0/spec/rubocop_spec.rb +1 -1
  132. data/vendor/avm-eac_redmine_base0/spec/spec_helper.rb +2 -100
  133. data/vendor/avm-eac_redmine_base0/template/avm/eac_redmine_base0/deploy/config/install.sh.template +1 -0
  134. data/vendor/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_host.rb +2 -2
  135. data/vendor/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_path.rb +2 -2
  136. data/vendor/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy.rb +2 -2
  137. data/vendor/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
  138. data/vendor/avm-eac_webapp_base0/spec/rubocop_spec.rb +1 -1
  139. data/vendor/avm-eac_webapp_base0/spec/spec_helper.rb +2 -100
  140. data/vendor/eac_cli/eac_cli.gemspec +3 -3
  141. data/vendor/eac_cli/lib/eac_cli/config/entry.rb +0 -2
  142. data/vendor/eac_cli/lib/eac_cli/definition/argument_option.rb +1 -1
  143. data/vendor/eac_cli/lib/eac_cli/definition/base_option.rb +9 -1
  144. data/vendor/eac_cli/lib/eac_cli/definition/boolean_option.rb +6 -0
  145. data/vendor/eac_cli/lib/eac_cli/runner_with/help/builder.rb +3 -3
  146. data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
  147. data/vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb +6 -5
  148. data/vendor/eac_cli/spec/rubocop_spec.rb +1 -1
  149. data/vendor/eac_cli/spec/spec_helper.rb +2 -101
  150. data/vendor/eac_config/eac_config.gemspec +2 -2
  151. data/vendor/eac_config/lib/eac_config/version.rb +1 -1
  152. data/vendor/eac_config/spec/rubocop_spec.rb +1 -1
  153. data/vendor/eac_config/spec/spec_helper.rb +2 -15
  154. data/vendor/eac_docker/eac_docker.gemspec +2 -2
  155. data/vendor/eac_docker/lib/eac_docker/container.rb +7 -3
  156. data/vendor/eac_docker/lib/eac_docker/images/templatized.rb +4 -0
  157. data/vendor/eac_docker/lib/eac_docker/rspec/setup.rb +17 -0
  158. data/vendor/eac_docker/lib/eac_docker/rspec.rb +2 -10
  159. data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
  160. data/vendor/eac_docker/spec/rubocop_spec.rb +1 -1
  161. data/vendor/eac_docker/spec/spec_helper.rb +2 -104
  162. data/vendor/eac_fs/Gemfile +5 -0
  163. data/vendor/eac_fs/eac_fs.gemspec +20 -0
  164. data/vendor/{eac_ruby_utils/lib/eac_ruby_utils/filesystem_cache.rb → eac_fs/lib/eac_fs/cache.rb} +7 -2
  165. data/{lib/avm → vendor/eac_fs/lib/eac_fs}/cached_download.rb +4 -4
  166. data/vendor/eac_fs/lib/eac_fs/file_info.rb +29 -0
  167. data/vendor/eac_fs/lib/eac_fs/patches/module/fs_cache.rb +10 -0
  168. data/vendor/eac_fs/lib/eac_fs/patches/module.rb +4 -0
  169. data/vendor/eac_fs/lib/eac_fs/patches/object/fs_cache.rb +10 -0
  170. data/vendor/eac_fs/lib/eac_fs/patches/object.rb +4 -0
  171. data/vendor/eac_fs/lib/eac_fs/patches/pathname/info.rb +12 -0
  172. data/vendor/eac_fs/lib/eac_fs/patches/pathname.rb +4 -0
  173. data/vendor/eac_fs/lib/eac_fs/patches.rb +4 -0
  174. data/vendor/eac_fs/lib/eac_fs/version.rb +5 -0
  175. data/vendor/eac_fs/lib/eac_fs.rb +7 -0
  176. data/vendor/{eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb → eac_fs/spec/lib/eac_fs/cache_spec.rb} +2 -2
  177. data/vendor/eac_fs/spec/rubocop_spec.rb +3 -0
  178. data/vendor/eac_fs/spec/spec_helper.rb +4 -0
  179. data/vendor/eac_git/eac_git.gemspec +3 -3
  180. data/vendor/eac_git/lib/eac_git/local/commit/archive.rb +1 -1
  181. data/vendor/eac_git/lib/eac_git/local/commit.rb +3 -3
  182. data/vendor/eac_git/lib/eac_git/local.rb +13 -0
  183. data/vendor/eac_git/lib/eac_git/rspec/setup.rb +23 -0
  184. data/vendor/eac_git/lib/eac_git/rspec.rb +1 -14
  185. data/vendor/eac_git/lib/eac_git/version.rb +1 -1
  186. data/vendor/eac_git/spec/rubocop_spec.rb +1 -1
  187. data/vendor/eac_git/spec/spec_helper.rb +2 -104
  188. data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +5 -4
  189. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/application.rb +3 -3
  190. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/core_ext.rb +1 -0
  191. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +16 -7
  192. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
  193. data/vendor/eac_ruby_base0/spec/rubocop_spec.rb +1 -1
  194. data/vendor/eac_ruby_base0/spec/spec_helper.rb +2 -101
  195. data/vendor/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +2 -2
  196. data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/base.rb +0 -5
  197. data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +1 -1
  198. data/vendor/eac_ruby_gems_utils/spec/code/rubocop_check_spec.rb +1 -1
  199. data/vendor/eac_ruby_gems_utils/spec/spec_helper.rb +2 -101
  200. data/vendor/eac_ruby_utils/eac_ruby_utils.gemspec +1 -1
  201. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/compact.rb +22 -0
  202. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/executable.rb +15 -3
  203. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem.rb +75 -0
  204. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/gems_registry.rb +35 -0
  205. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/compact.rb +20 -0
  206. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/delimited.rb +16 -0
  207. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/recursive_builder.rb +51 -0
  208. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/default_setup.rb +20 -0
  209. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup/conditionals.rb +17 -0
  210. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup.rb +12 -0
  211. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup_manager.rb +49 -0
  212. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/string_delimited.rb +70 -0
  213. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  214. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/compact_spec.rb +20 -0
  215. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/compact_spec.rb +20 -0
  216. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/string/delimited_spec.rb +34 -0
  217. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/recursive_builder_spec.rb +65 -0
  218. data/vendor/eac_ruby_utils/spec/rubocop_check_spec.rb +1 -1
  219. data/vendor/eac_ruby_utils/spec/spec_helper.rb +6 -6
  220. data/vendor/eac_templates/lib/eac_templates/patches/module/erb_template.rb +9 -0
  221. data/vendor/eac_templates/lib/eac_templates/patches/module.rb +4 -0
  222. data/vendor/eac_templates/lib/eac_templates/patches/object/erb_template.rb +9 -0
  223. data/vendor/eac_templates/lib/eac_templates/patches/object.rb +4 -0
  224. data/vendor/eac_templates/lib/eac_templates/patches.rb +4 -0
  225. data/vendor/eac_templates/lib/eac_templates/version.rb +1 -1
  226. data/vendor/eac_templates/spec/rubocop_spec.rb +1 -1
  227. data/vendor/eac_templates/spec/spec_helper.rb +2 -100
  228. metadata +146 -250
  229. data/lib/avm/app_src.rb +0 -61
  230. data/lib/avm/files/info.rb +0 -24
  231. data/lib/avm/fs_cache.rb +0 -11
  232. data/vendor/avm-apps/lib/avm/apps/config.rb +0 -19
  233. data/vendor/avm-apps/lib/avm/apps/jobs/base.rb +0 -64
  234. data/vendor/avm-apps/lib/avm/apps/jobs/variables_source.rb +0 -24
  235. data/vendor/avm-apps/lib/avm/apps/sources/configuration/_locale.rb +0 -18
  236. data/vendor/avm-apps/lib/avm/apps/sources/configuration/_rubocop.rb +0 -26
  237. data/vendor/avm-apps/lib/avm/apps/sources/configuration/_tests.rb +0 -29
  238. data/vendor/avm-apps/lib/avm/apps/sources/configuration.rb +0 -57
  239. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs_cache.rb +0 -12
  240. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/conditional.rb +0 -35
  241. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/stubbed_ssh.rb +0 -44
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_git'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module AppSrc
8
+ class Base
9
+ enable_simple_cache
10
+ enable_listable
11
+ lists.add_symbol :option, :parent
12
+ common_constructor :path, :options, default: [{}] do
13
+ self.path = path.to_pathname
14
+ self.options = self.class.lists.option.hash_keys_validate!(options)
15
+ end
16
+
17
+ delegate :to_s, to: :path
18
+
19
+ # @return [Avm::AppSrc::Base]
20
+ def parent
21
+ options[OPTION_PARENT]
22
+ end
23
+
24
+ # @return [Pathname]
25
+ def relative_path
26
+ return path if parent.blank?
27
+
28
+ path.relative_path_from(parent.path)
29
+ end
30
+
31
+ # @return [Enumerable<Avm::AppSrc::Base>]
32
+ def subs
33
+ git_repo.subrepos
34
+ .map { |subrepo| self.class.new(subrepo.subpath.expand_path(path), parent: self) }
35
+ end
36
+
37
+ private
38
+
39
+ # @return [EacGit::Local]
40
+ def git_repo_uncached
41
+ ::EacGit::Local.new(path)
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/patches/eac_ruby_gems_utils/gem'
4
+ require 'i18n'
5
+
6
+ module Avm
7
+ module AppSrc
8
+ class Configuration < ::EacConfig::OldConfigs
9
+ LOCALE_KEY = :locale
10
+
11
+ def locale
12
+ read_entry(LOCALE_KEY) || ::I18n.default_locale
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avm
4
+ module AppSrc
5
+ class Configuration < ::EacConfig::OldConfigs
6
+ RUBOCOP_COMMAND_KEY = 'ruby.rubocop.command'
7
+ RUBOCOP_GEMFILE_KEY = 'ruby.rubocop.gemfile'
8
+
9
+ def rubocop_command
10
+ read_command(RUBOCOP_COMMAND_KEY)
11
+ end
12
+
13
+ def rubocop_gemfile
14
+ gemfile_path = read_entry(RUBOCOP_GEMFILE_KEY)
15
+ return nil if gemfile_path.blank?
16
+
17
+ gemfile_path = gemfile_path.to_pathname.expand_path(storage_path.parent)
18
+ return gemfile_path if gemfile_path.file?
19
+
20
+ raise "Gemfile path \"#{gemfile_path}\" does not exist or is not a file"
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/patches/eac_ruby_gems_utils/gem'
4
+
5
+ module Avm
6
+ module AppSrc
7
+ class Configuration < ::EacConfig::OldConfigs
8
+ BUNDLE_TEST_COMMAND_KEY = 'test.bundle_command'
9
+ TEST_COMMAND_KEY = 'test.command'
10
+
11
+ def any_test_command
12
+ bundle_test_command || test_command
13
+ end
14
+
15
+ def test_command
16
+ read_command(TEST_COMMAND_KEY)
17
+ end
18
+
19
+ def bundle_test_command
20
+ read_entry(BUNDLE_TEST_COMMAND_KEY).if_present do |v|
21
+ args = v.is_a?(::Enumerable) ? v.map(&:to_s) : ::Shellwords.split(v)
22
+ ::EacRubyGemsUtils::Gem.new(::File.dirname(storage_path)).bundle(*args).chdir_root
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,55 @@
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 AppSrc
9
+ class Configuration < ::EacConfig::OldConfigs
10
+ require_sub __FILE__
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
+ private
32
+
33
+ def internal_find_path(absolute_pathname)
34
+ r = find_in_path(absolute_pathname)
35
+ return r if r.present?
36
+
37
+ internal_find_path(absolute_pathname.dirname) unless absolute_pathname.root?
38
+ end
39
+ end
40
+
41
+ def initialize(path)
42
+ super(nil, storage_path: path)
43
+ end
44
+
45
+ # Utility to read a configuration as a [EacRubyUtils::Envs::Command].
46
+ # @return [EacRubyUtils::Envs::Command]
47
+ def read_command(key)
48
+ read_entry(key).if_present do |v|
49
+ args = v.is_a?(::Enumerable) ? v.map(&:to_s) : ::Shellwords.split(v)
50
+ ::EacRubyUtils::Envs.local.command(args).chdir(::File.dirname(storage_path))
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -3,7 +3,7 @@
3
3
  require 'eac_ruby_utils/core_ext'
4
4
 
5
5
  module Avm
6
- module EacAsciidoctorBase0
6
+ module AppSrc
7
7
  require_sub __FILE__
8
8
  end
9
9
  end
@@ -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
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'eac_ruby_utils/core_ext'
4
4
  require 'avm/files/appendable/resource_base'
5
+ require 'eac_templates/directory'
5
6
 
6
7
  module Avm
7
8
  module Files
File without changes
File without changes
@@ -2,7 +2,6 @@
2
2
 
3
3
  require 'addressable'
4
4
  require 'avm/files/appendable'
5
- require 'avm/patches/object/template'
6
5
  require 'eac_ruby_utils/core_ext'
7
6
 
8
7
  module Avm
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/files/info'
3
+ require 'eac_fs/file_info'
4
4
  require 'ostruct'
5
5
 
6
6
  module Avm
@@ -50,7 +50,7 @@ module Avm
50
50
  end
51
51
 
52
52
  def match_by_type?(file)
53
- info = ::Avm::Files::Info.new(file)
53
+ info = ::EacFs::FileInfo.new(file)
54
54
  return unless info.content_type.type == 'text'
55
55
 
56
56
  valid_types.include?(info.content_type.subtype)
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/executables'
4
+ require 'avm/files/formatter/formats/generic_plain'
5
+
6
+ module Avm
7
+ module Files
8
+ class Formatter
9
+ module Formats
10
+ class Javascript < ::Avm::Files::Formatter::Formats::GenericPlain
11
+ VALID_BASENAMES = %w[*.js].freeze
12
+ VALID_TYPES = [].freeze
13
+
14
+ def internal_apply(files)
15
+ ::Avm::Executables.js_beautify.command.append(
16
+ ['--indent-size=2', '--end-with-newline', '--replace', *files]
17
+ ).system!
18
+ super(files)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/executables'
3
4
  require 'avm/files/formatter/formats/generic_plain'
4
5
 
5
6
  module Avm
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/executables'
3
4
  require 'avm/files/formatter/formats/generic_plain'
4
5
 
5
6
  module Avm
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/executables'
3
4
  require 'avm/files/formatter/formats/generic_plain'
4
5
 
5
6
  module Avm
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'eac_fs/file_info'
4
+
3
5
  module Avm
4
6
  module Files
5
7
  class Formatter
@@ -37,7 +39,7 @@ module Avm
37
39
  private
38
40
 
39
41
  def original_info_uncached
40
- ::Avm::Files::Info.new(path)
42
+ ::EacFs::FileInfo.new(path)
41
43
  end
42
44
 
43
45
  def original_charset_uncached
@@ -16,7 +16,7 @@ module Avm
16
16
  options.assert_valid_keys(self.class.lists.option.values)
17
17
  end
18
18
 
19
- FORMATS = %w[ruby php html python xml json generic_plain].freeze
19
+ FORMATS = %w[ruby php html python xml javascript json generic_plain].freeze
20
20
 
21
21
  def run
22
22
  clear
File without changes
File without changes
@@ -21,7 +21,7 @@ module Avm
21
21
  end
22
22
 
23
23
  def relative_path
24
- path.relative_path_from(git.root_path)
24
+ path.expand_path.relative_path_from(git.root_path.expand_path)
25
25
  end
26
26
  end
27
27
  end
@@ -4,7 +4,6 @@ require 'addressable'
4
4
  require 'eac_ruby_utils/core_ext'
5
5
  require 'avm/files/appendable'
6
6
  require 'avm/files/deploy'
7
- require 'avm/patches/object/template'
8
7
 
9
8
  module Avm
10
9
  module Git
@@ -12,7 +12,7 @@ module Avm
12
12
 
13
13
  attr_reader :git, :diff_tree
14
14
 
15
- # git: [Avm::Launcher::Git::Base]
15
+ # git: [EacGit::Local]
16
16
  # diff_tree_tree: a line of command "git diff-tree --no-commit-id -r --full-index"'s output
17
17
  def initialize(git, diff_tree_line)
18
18
  @git = git
@@ -38,7 +38,7 @@ module Avm
38
38
  def size(sha1)
39
39
  return 0 if /\A0+\z/.match(sha1)
40
40
 
41
- git.execute!('cat-file', '-s', sha1).strip.to_i
41
+ git.command('cat-file', '-s', sha1).execute!.strip.to_i
42
42
  end
43
43
  end
44
44
  end
@@ -18,13 +18,14 @@ module Avm
18
18
 
19
19
  attr_reader :git, :sha1
20
20
 
21
+ # @param git [EacGit::Local]
21
22
  def initialize(git, sha1)
22
23
  @git = git
23
24
  @sha1 = sha1
24
25
  end
25
26
 
26
27
  def format(format)
27
- git.execute!('--no-pager', 'log', '-1', "--pretty=format:#{format}", sha1).strip
28
+ git.command('--no-pager', 'log', '-1', "--pretty=format:#{format}", sha1).execute!.strip
28
29
  end
29
30
 
30
31
  FIELDS.each do |field, format|
@@ -51,7 +52,7 @@ module Avm
51
52
  args = []
52
53
  args << '--root' if root_child?
53
54
  args << sha1
54
- git.execute!(*::Avm::Git::Commit::DiffTreeLine::GIT_COMMAND_ARGS, *args)
55
+ git.command(*::Avm::Git::Commit::DiffTreeLine::GIT_COMMAND_ARGS, *args).execute!
55
56
  end
56
57
  end
57
58
  end
File without changes
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/apps/sources/configuration'
3
+ require 'avm/app_src/configuration'
4
4
  require 'avm/result'
5
5
  require 'eac_ruby_utils/fs/temp'
6
6
 
@@ -36,7 +36,7 @@ module Avm
36
36
  end
37
37
 
38
38
  def configuration_uncached
39
- ::Avm::Apps::Sources::Configuration.find_by_path(@git)
39
+ ::Avm::AppSrc::Configuration.find_by_path(@git)
40
40
  end
41
41
  end
42
42
  end
File without changes
File without changes
File without changes
File without changes
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/fs_cache'
4
3
  require 'eac_ruby_utils/core_ext'
5
4
  require 'eac_ruby_utils/ruby'
6
5
 
@@ -53,8 +52,8 @@ module Avm
53
52
  end
54
53
 
55
54
  def root_cache
56
- ::Avm.fs_cache.child('git', 'revision_test', git_absolute_path.parameterize, sha1,
57
- options.fetch(:test_command).to_s.parameterize)
55
+ fs_cache.child(git_absolute_path.parameterize, sha1,
56
+ options.fetch(:test_command).to_s.parameterize)
58
57
  end
59
58
 
60
59
  def run_test
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/launcher/git/base'
4
3
  require 'eac_ruby_utils/core_ext'
5
4
 
6
5
  module Avm
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/launcher/git/base'
4
3
  require 'eac_ruby_utils/core_ext'
5
4
 
6
5
  module Avm
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/launcher/git/base'
3
+ require 'avm/git/subrepo_check'
4
4
  require 'eac_ruby_utils/core_ext'
5
5
 
6
6
  module Avm
File without changes
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/jobs/variables_source'
4
+ require 'eac_cli/core_ext'
5
+
6
+ module Avm
7
+ module Jobs
8
+ module Base
9
+ common_concern do
10
+ include ::ActiveSupport::Callbacks
11
+
12
+ enable_speaker
13
+ enable_simple_cache
14
+ enable_listable
15
+ common_constructor :instance, :options, default: [{}] do
16
+ if option_list.present?
17
+ self.options = option_list.hash_keys_validate!(options.symbolize_keys)
18
+ end
19
+ end
20
+ define_callbacks(*jobs)
21
+ end
22
+
23
+ module ClassMethods
24
+ def jobs
25
+ const_get('JOBS').dup
26
+ end
27
+ end
28
+
29
+ module InstanceMethods
30
+ def option_list
31
+ nil
32
+ end
33
+
34
+ def run
35
+ start_banner if respond_to?(:start_banner)
36
+ run_jobs
37
+ ::Avm::Result.success('Done!')
38
+ rescue ::Avm::Result::Error => e
39
+ e.to_result
40
+ end
41
+
42
+ def variables_source
43
+ ::Avm::Jobs::VariablesSource.new(self, instance)
44
+ end
45
+
46
+ protected
47
+
48
+ def run_jobs
49
+ jobs.each do |job|
50
+ run_callbacks job do
51
+ send(job)
52
+ end
53
+ end
54
+ end
55
+
56
+ def jobs
57
+ self.class.jobs
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Jobs
7
+ class VariablesSource
8
+ common_constructor :job, :instance
9
+
10
+ def read_entry(path, options = {})
11
+ entry_from_job(path) || instance.read_entry(path, options)
12
+ end
13
+
14
+ private
15
+
16
+ def entry_from_job(path)
17
+ method = path.gsub('.', '_').underscore
18
+ return job.send(method) if job.respond_to?(method, true)
19
+ end
20
+ end
21
+ end
22
+ end
@@ -3,9 +3,7 @@
3
3
  require 'eac_ruby_utils/core_ext'
4
4
 
5
5
  module Avm
6
- module Apps
7
- module Jobs
8
- require_sub __FILE__
9
- end
6
+ module Jobs
7
+ require_sub __FILE__
10
8
  end
11
9
  end
File without changes
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avm
4
- VERSION = '0.2.0'
4
+ VERSION = '0.4.0'
5
5
  end