eac_tools 0.85.0 → 0.86.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +27 -42
  3. data/lib/eac_tools/version.rb +1 -1
  4. data/sub/avm-tools/Gemfile +2 -2
  5. data/sub/avm-tools/lib/avm/tools/rspec/helpers/runner.rb +20 -0
  6. data/sub/{avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/runners.rb → avm-tools/lib/avm/tools/rspec/helpers.rb} +3 -3
  7. data/sub/avm-tools/lib/avm/tools/rspec/setup.rb +24 -0
  8. data/sub/{avm-files/lib/avm/files/runner_with.rb → avm-tools/lib/avm/tools/rspec.rb} +2 -2
  9. data/sub/avm-tools/lib/avm/tools/runner/git/dirty_files.rb +1 -1
  10. data/sub/avm-tools/lib/avm/tools/runner/git/subrepo/fix.rb +1 -1
  11. data/sub/avm-tools/lib/avm/tools/runner/source/auto_commit.rb +2 -2
  12. data/sub/avm-tools/lib/avm/tools/runner/source/issue/complete.rb +1 -1
  13. data/sub/avm-tools/lib/avm/tools/runner/source/subs.rb +1 -1
  14. data/sub/avm-tools/lib/avm/tools/runner.rb +1 -1
  15. data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
  16. data/sub/avm-tools/spec/dummy/avm-tools_stub/avm-tools.gemspec +1 -1
  17. data/sub/avm-tools/spec/dummy/ruby_gem_stub/ruby_gem_stub.gemspec +1 -1
  18. data/sub/avm-tools/spec/lib/avm/{projects/stereotypes → git/launcher_stereotypes}/git_subrepo/publish_spec.rb +19 -19
  19. data/sub/avm-tools/spec/lib/avm/git/launcher_stereotypes/git_subrepo/warp_spec.rb +49 -0
  20. data/sub/avm-tools/spec/lib/avm/launcher/context_spec.rb +22 -22
  21. data/sub/avm-tools/spec/lib/avm/tools/runner/files/rotate_spec.rb +14 -14
  22. data/sub/avm-tools/spec/lib/avm/tools/runner/git/deploy_spec.rb +37 -37
  23. data/sub/avm-tools/spec/lib/avm/tools/runner/launcher_stereotypes/list_spec.rb +1 -1
  24. data/sub/avm-tools/spec/lib/avm/tools/runner/source/issue/complete_spec.rb +4 -4
  25. data/sub/avm-tools/spec/lib/avm/tools/runner_spec.rb +2 -2
  26. data/sub/avm-tools/spec/rubocop_spec.rb +1 -1
  27. data/sub/avm-tools/spec/spec_helper/eac_launcher.rb +14 -14
  28. data/sub/avm-tools/spec/spec_helper.rb +3 -3
  29. metadata +16 -142
  30. data/sub/avm-eac_asciidoctor_base0/Gemfile +0 -8
  31. data/sub/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec +0 -24
  32. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/documents_owner.rb +0 -30
  33. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb +0 -37
  34. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base.rb +0 -17
  35. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/apache_host.rb +0 -19
  36. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/apache_path.rb +0 -12
  37. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/base.rb +0 -33
  38. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/body_target.rb +0 -37
  39. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/header_lines.rb +0 -83
  40. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/media.rb +0 -28
  41. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/pre_process_line.rb +0 -64
  42. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document.rb +0 -101
  43. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build.rb +0 -51
  44. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/deploy.rb +0 -28
  45. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/macros/base.rb +0 -21
  46. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/macros/breadcrumbs.rb +0 -55
  47. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/macros/child_docs/document_builder.rb +0 -63
  48. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/macros/child_docs.rb +0 -35
  49. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/macros/default_body.rb +0 -21
  50. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/macros.rb +0 -13
  51. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances.rb +0 -11
  52. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/source_generators/base.rb +0 -28
  53. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/source_generators.rb +0 -11
  54. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base/instance_to_build.rb +0 -45
  55. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base/theme.rb +0 -40
  56. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base.rb +0 -49
  57. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/document/media.rb +0 -28
  58. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/document/title.rb +0 -31
  59. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/document.rb +0 -56
  60. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners/build.rb +0 -54
  61. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners/document/build.rb +0 -46
  62. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners/document.rb +0 -30
  63. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners/documents.rb +0 -28
  64. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners.rb +0 -13
  65. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources.rb +0 -11
  66. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +0 -7
  67. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0.rb +0 -9
  68. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/file_formats/base_spec.rb +0 -13
  69. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build/document_spec.rb +0 -72
  70. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build/document_spec_files/pre_processed_root_body.adoc +0 -25
  71. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec.rb +0 -22
  72. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/_media/a_media_file +0 -1
  73. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc1/_media/a_media_file +0 -1
  74. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc1/body.adoc +0 -11
  75. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc1/title +0 -1
  76. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc2/body.adoc +0 -11
  77. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc2/doc2_1/_media/a_media_file +0 -1
  78. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc2/doc2_1/body.adoc +0 -11
  79. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc2/doc2_1/title +0 -1
  80. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc2/title +0 -1
  81. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.target/_media/a_media_file +0 -1
  82. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.target/doc1/_media/a_media_file +0 -1
  83. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.target/doc1/index.html +0 -1
  84. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.target/doc2/doc2_1/_media/a_media_file +0 -1
  85. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.target/doc2/doc2_1/index.html +0 -1
  86. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.target/doc2/index.html +0 -1
  87. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.target/index.html +0 -1
  88. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/source_generators/base_spec.rb +0 -8
  89. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/source_generators/base_spec_files/no_options/content/body.adoc +0 -11
  90. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/source_generators/base_spec_files/no_options/content/title +0 -1
  91. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/source_generators/base_spec_files/no_options/theme/main.css +0 -1
  92. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/sources/base_spec.rb +0 -16
  93. data/sub/avm-eac_asciidoctor_base0/spec/rubocop_spec.rb +0 -3
  94. data/sub/avm-eac_asciidoctor_base0/spec/spec_helper/eac_asciidoctor_base0_stubs.rb +0 -55
  95. data/sub/avm-eac_asciidoctor_base0/spec/spec_helper.rb +0 -8
  96. data/sub/avm-eac_asciidoctor_base0/template/avm/eac_asciidoctor_base0/source_generators/base/content/body.adoc +0 -11
  97. data/sub/avm-eac_asciidoctor_base0/template/avm/eac_asciidoctor_base0/source_generators/base/content/title +0 -1
  98. data/sub/avm-eac_asciidoctor_base0/template/avm/eac_asciidoctor_base0/source_generators/base/theme/main.css +0 -1
  99. data/sub/avm-eac_latex_base0/Gemfile +0 -8
  100. data/sub/avm-eac_latex_base0/avm-eac_latex_base0.gemspec +0 -20
  101. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/executables.rb +0 -22
  102. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/instances/apache_host.rb +0 -19
  103. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/instances/base.rb +0 -12
  104. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/instances/deploy.rb +0 -38
  105. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/instances.rb +0 -11
  106. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/base.rb +0 -44
  107. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/chapters_content.rb +0 -49
  108. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/commons.rb +0 -16
  109. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/copy_files.rb +0 -45
  110. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/base_stereotype.rb +0 -23
  111. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/chapter_index.rb +0 -27
  112. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/tex_source.rb +0 -37
  113. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file.rb +0 -49
  114. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build.rb +0 -121
  115. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/runners/build_chapters.rb +0 -43
  116. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/runners/build_single.rb +0 -33
  117. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/runners/info.rb +0 -32
  118. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources.rb +0 -11
  119. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/version.rb +0 -7
  120. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0.rb +0 -9
  121. data/sub/avm-eac_latex_base0/spec/rubocop_spec.rb +0 -3
  122. data/sub/avm-eac_latex_base0/spec/spec_helper.rb +0 -4
  123. data/sub/avm-eac_latex_base0/template/avm/eac_latex_base0/instances/deploy/index.html.template +0 -9
  124. data/sub/avm-eac_latex_base0/template/avm/eac_latex_base0/sources/build/commons/all.tex +0 -5
  125. data/sub/avm-eac_latex_base0/template/avm/eac_latex_base0/sources/build/commons/ebook.tex +0 -11
  126. data/sub/avm-eac_latex_base0/template/avm/eac_latex_base0/sources/build/commons/images.tex +0 -11
  127. data/sub/avm-eac_latex_base0/template/avm/eac_latex_base0/sources/build/commons/links.tex +0 -2
  128. data/sub/avm-eac_latex_base0/template/avm/eac_latex_base0/sources/build/commons/portuguese.tex +0 -8
  129. data/sub/avm-eac_latex_base0/template/avm/eac_latex_base0/sources/build/commons/source_code/java.tex +0 -15
  130. data/sub/avm-eac_latex_base0/template/avm/eac_latex_base0/sources/build/commons/source_code.tex +0 -21
  131. data/sub/avm-eac_latex_base0/template/avm/eac_latex_base0/sources/build/commons/utils.tex +0 -6
  132. data/sub/avm-files/Gemfile +0 -8
  133. data/sub/avm-files/avm-files.gemspec +0 -23
  134. data/sub/avm-files/lib/avm/files/appendable/file_content.rb +0 -24
  135. data/sub/avm-files/lib/avm/files/appendable/plain_directory.rb +0 -25
  136. data/sub/avm-files/lib/avm/files/appendable/resource_base.rb +0 -13
  137. data/sub/avm-files/lib/avm/files/appendable/tar_output_command.rb +0 -26
  138. data/sub/avm-files/lib/avm/files/appendable/templatized_directory.rb +0 -29
  139. data/sub/avm-files/lib/avm/files/appendable.rb +0 -55
  140. data/sub/avm-files/lib/avm/files/appender.rb +0 -11
  141. data/sub/avm-files/lib/avm/files/deploy.rb +0 -71
  142. data/sub/avm-files/lib/avm/files/runner_with/file_replacer.rb +0 -34
  143. data/sub/avm-files/lib/avm/files/runner_with/filesystem_renamer.rb +0 -103
  144. data/sub/avm-files/lib/avm/files/runner_with/filesystem_traverser.rb +0 -54
  145. data/sub/avm-files/lib/avm/files/text_replacer/gsub.rb +0 -24
  146. data/sub/avm-files/lib/avm/files/text_replacer.rb +0 -32
  147. data/sub/avm-files/lib/avm/files/version.rb +0 -7
  148. data/sub/avm-files/lib/avm/files.rb +0 -9
  149. data/sub/avm-files/spec/rubocop_spec.rb +0 -3
  150. data/sub/avm-files/spec/spec_helper.rb +0 -4
  151. data/sub/avm-tools/spec/lib/avm/projects/stereotypes/git_subrepo/warp_spec.rb +0 -49
  152. data/sub/avm-tools/spec/spec_helper/avm_tools_runner.rb +0 -11
  153. /data/sub/avm-tools/spec/lib/avm/{projects/stereotypes → git/launcher_stereotypes}/git_subrepo/publish_spec_settings.yml +0 -0
  154. /data/sub/avm-tools/spec/lib/avm/{projects/stereotypes → git/launcher_stereotypes}/git_subrepo/warp_spec_settings.yml +0 -0
@@ -1,71 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'addressable'
4
- require 'avm/files/appendable'
5
- require 'eac_ruby_utils/core_ext'
6
-
7
- module Avm
8
- module Files
9
- class Deploy
10
- include ::Avm::Files::Appendable
11
- enable_simple_cache
12
-
13
- attr_reader :build_dir, :target_env, :target_path
14
-
15
- common_constructor :target_env, :target_path
16
-
17
- def run
18
- on_build_dir do
19
- copy_content_to_build_dir
20
- mkdir_target
21
- clear_content
22
- send_untar_package
23
- set_target_permission
24
- end
25
- end
26
-
27
- private
28
-
29
- def on_build_dir
30
- @build_dir = ::Dir.mktmpdir
31
- yield
32
- ensure
33
- ::FileUtils.rm_rf(@build_dir)
34
- end
35
-
36
- def copy_content_to_build_dir
37
- write_appended_on(build_dir)
38
- end
39
-
40
- def mkdir_target
41
- target_env.command('mkdir', '-p', target_path).execute!
42
- end
43
-
44
- def clear_content
45
- target_env.command(
46
- 'find', target_path, '-mindepth', '1', '-maxdepth', '1', '-exec', 'rm', '-rf', '{}', ';'
47
- ).execute!
48
- end
49
-
50
- def send_untar_package
51
- tar_build_command.pipe(untar_build_command).execute!
52
- end
53
-
54
- def set_target_permission
55
- target_env.command('chmod', '755', target_path).execute!
56
- end
57
-
58
- def tar_build_command
59
- source_env.command('tar', '-czO', '-C', build_dir, '.')
60
- end
61
-
62
- def untar_build_command
63
- target_env.command('tar', '-xzf', '-', '-C', target_path)
64
- end
65
-
66
- def source_env
67
- ::EacRubyUtils::Envs.local
68
- end
69
- end
70
- end
71
- end
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_cli/core_ext'
4
- require 'avm/files/text_replacer'
5
- require 'avm/files/runner_with/filesystem_traverser'
6
-
7
- module Avm
8
- module Files
9
- module RunnerWith
10
- module FileReplacer
11
- common_concern do
12
- include ::Avm::Files::RunnerWith::FilesystemTraverser
13
- include TopMethods
14
- end
15
-
16
- module TopMethods
17
- def text_replacer
18
- ::Avm::Files::TextReplacer.new
19
- end
20
-
21
- def replace_file?(_file)
22
- true
23
- end
24
-
25
- def traverser_check_file(file)
26
- return unless replace_file?(file)
27
-
28
- infov 'Changed', file if text_replacer.file_apply(file)
29
- end
30
- end
31
- end
32
- end
33
- end
34
- end
@@ -1,103 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_cli/core_ext'
4
-
5
- module Avm
6
- module Files
7
- module RunnerWith
8
- module FilesystemRenamer
9
- common_concern do
10
- runner_with :confirmation, :filesystem_traverser
11
- prepend PrependMethods
12
- end
13
-
14
- class RenameFile
15
- enable_speaker
16
- common_constructor :runner, :file
17
- delegate :path, :target_path, :valid?, to: :file
18
-
19
- CONFIRM_MESSAGE = 'Rename?'
20
-
21
- def show
22
- if rename?
23
- puts [target_path_to_s, '<='.green, path_to_s].join(' ')
24
- else
25
- puts path_to_s
26
- end
27
- end
28
-
29
- def rename
30
- return unless rename?
31
-
32
- show
33
- do_rename if runner.confirm?(CONFIRM_MESSAGE)
34
- end
35
-
36
- # @return [Boolean]
37
- def rename?
38
- path.to_pathname != target_path.to_pathname
39
- end
40
-
41
- private
42
-
43
- def do_rename
44
- ::FileUtils.mv(path, target_path)
45
- end
46
-
47
- # @return [String]
48
- def path_to_s
49
- path.basename.to_path.light_black
50
- end
51
-
52
- # @return [String]
53
- def target_path_to_s
54
- target_path.relative_path_from(path.dirname).to_path
55
- end
56
- end
57
-
58
- module PrependMethods
59
- # @param path [Pathname]
60
- # @return [void]
61
- def traverser_check_file(path)
62
- file = RenameFile.new(self, file_class.new(path))
63
- files << file if file.valid?
64
- end
65
- end
66
-
67
- FILE_WRAPPER_CLASS_BASENAME = 'FileWrapper'
68
-
69
- # @return [Class]
70
- def file_class
71
- self.class.const_get(FILE_WRAPPER_CLASS_BASENAME)
72
- end
73
-
74
- # @return [void]
75
- def run_filesystem_renamer
76
- self.files = []
77
- run_filesystem_traverser
78
- show_files
79
- rename_files
80
- success 'Done'
81
- end
82
-
83
- # @return [void]
84
- def show_files
85
- infov 'Files found', files.count
86
- files.each(&:show)
87
- end
88
-
89
- # @return [void]
90
- def rename_files
91
- return if parsed.no? || files.none?(&:rename?)
92
-
93
- infom 'Renaming files...'
94
- files.each(&:rename)
95
- end
96
-
97
- private
98
-
99
- attr_accessor :files
100
- end
101
- end
102
- end
103
- end
@@ -1,54 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_cli/runner'
4
- require 'eac_fs/traversable'
5
- require 'eac_ruby_utils/core_ext'
6
- require 'eac_ruby_utils/settings_provider'
7
-
8
- module Avm
9
- module Files
10
- module RunnerWith
11
- module FilesystemTraverser
12
- DEFAULT_DEFAULT_TRAVERSER_RECURSIVE = false
13
-
14
- common_concern do
15
- include ::EacCli::Runner
16
- include ::EacFs::Traversable
17
- enable_settings_provider
18
- include TopMethods
19
- runner_definition do
20
- bool_opt '-R', '--recursive', 'Recursive.'
21
- bool_opt '--no-recursive', 'No recursive.'
22
- pos_arg :paths, optional: true, repeat: true
23
- end
24
- end
25
-
26
- module TopMethods
27
- def on_none_path_informed
28
- infom 'Warning: none path informed'
29
- end
30
-
31
- def paths
32
- parsed.paths.map(&:to_pathname)
33
- end
34
-
35
- def run_filesystem_traverser
36
- if parsed.paths.any?
37
- parsed.paths.each { |path| traverser_check_path(path) }
38
- else
39
- on_none_path_informed
40
- end
41
- end
42
-
43
- def traverser_recursive
44
- return false if parsed.no_recursive?
45
- return true if parsed.recursive?
46
-
47
- setting_value(:default_traverser_recursive, required: false)
48
- .if_not_nil(DEFAULT_DEFAULT_TRAVERSER_RECURSIVE)
49
- end
50
- end
51
- end
52
- end
53
- end
54
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module Files
7
- class TextReplacer
8
- class Gsub
9
- common_constructor :from, :to do
10
- self.from = from
11
- self.to = to
12
- end
13
-
14
- def apply(input)
15
- input.gsub(from, to)
16
- end
17
-
18
- def to_s
19
- "\"#{from}\" => \"#{to}\""
20
- end
21
- end
22
- end
23
- end
24
- end
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module Files
7
- class TextReplacer
8
- require_sub __FILE__
9
- enable_immutable
10
-
11
- immutable_accessor :replacement, type: :array
12
-
13
- def apply(input)
14
- replacements.inject(input) { |a, e| e.apply(a) }
15
- end
16
-
17
- def file_apply(file)
18
- file = file.to_pathname
19
- input = file.read
20
- output = apply(file.read)
21
- return false if output == input
22
-
23
- file.write(output)
24
- true
25
- end
26
-
27
- def gsub(from, to)
28
- replacement(::Avm::Files::TextReplacer::Gsub.new(from, to))
29
- end
30
- end
31
- end
32
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module Files
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 Files
7
- require_sub __FILE__
8
- end
9
- end
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- EacRubyUtils::Rspec.default_setup.describe_rubocop
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/rspec/default_setup'
4
- EacRubyUtils::Rspec.default_setup_create(File.expand_path('..', __dir__))
@@ -1,49 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/git/launcher_stereotypes/git_subrepo/warp'
4
-
5
- RSpec.describe Avm::Git::LauncherStereotypes::GitSubrepo::Warp do
6
- describe '#unknown' do
7
- before do
8
- temp_context(::File.join(__dir__, 'warp_spec_settings.yml'))
9
-
10
- @repos = init_remote('mylib_repos')
11
-
12
- wc = init_git('mylib_wc')
13
- touch_commit(wc, 'file1')
14
- wc.execute!('remote', 'add', 'origin', @repos)
15
- wc.execute!('push', 'origin', 'master')
16
-
17
- @app1 = init_git('app1')
18
- touch_commit(@app1, 'file2')
19
- @app1.execute!('subrepo', 'clone', @repos, 'mylib')
20
-
21
- @app2 = init_git('app2')
22
- touch_commit(@app2, 'file3')
23
- @app2.execute!('subrepo', 'clone', @repos, 'mylib')
24
- touch_commit(@app2, 'mylib/file4')
25
- @app2.execute!('subrepo', 'push', 'mylib')
26
- end
27
-
28
- it 'revisions should match' do # rubocop:disable RSpec/ExampleLength
29
- master_ref = @repos.rev_parse('master')
30
- expect(master_ref.present?).to be true
31
-
32
- master_ref_previous = @repos.rev_parse('master^')
33
- expect(master_ref_previous.present?).to be true
34
-
35
- @app2.execute!('subrepo', 'branch', 'mylib', '--fetch', '--force')
36
- expect(@app2.rev_parse('subrepo/mylib')).to eq master_ref
37
-
38
- @app1.execute!('subrepo', 'branch', 'mylib', '--fetch', '--force')
39
- expect(@app1.rev_parse('subrepo/mylib')).to eq master_ref_previous
40
-
41
- instance = ::Avm::Launcher::Context.current.instance('/app1/mylib')
42
- expect(instance).to be_a ::Avm::Launcher::Instances::Base
43
- warp = instance.warped
44
- expect(warp).to be_a ::Avm::Git::LauncherStereotypes::GitSubrepo::Warp
45
- wgit = ::Avm::Git::Launcher::Base.new(warp)
46
- expect(wgit.rev_parse('HEAD')).to eq master_ref_previous
47
- end
48
- end
49
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- ::RSpec.configure do |_config|
4
- def avm_tools_runner_args_prefix
5
- []
6
- end
7
-
8
- def avm_tools_runner_run(*argv)
9
- ::Avm::Tools::Runner.run(argv: avm_tools_runner_args_prefix + argv)
10
- end
11
- end