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,16 +0,0 @@
1
- Copyright (c) 2020 Eduardo Henrique Bogoni
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
4
- associated documentation files (the "Software"), to deal in the Software without restriction,
5
- including without limitation the rights to use, copy, modify, merge, publish, distribute,
6
- sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
7
- furnished to do so, subject to the following conditions:
8
-
9
- The above copyright notice and this permission notice (including the next paragraph) shall be
10
- included in all copies or substantial portions of the Software.
11
-
12
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
13
- NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
14
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
15
- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
16
- OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,3 +0,0 @@
1
- = E.A.C.'s Ruby Gems Utils.
2
-
3
- Utilities for Ruby\'s gems development.
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- $LOAD_PATH.push File.expand_path('lib', __dir__)
4
-
5
- # Maintain your gem's version:
6
- require 'eac_ruby_gems_utils/version'
7
-
8
- # Describe your gem and declare its dependencies:
9
- Gem::Specification.new do |s|
10
- s.name = 'eac_ruby_gems_utils'
11
- s.version = ::EacRubyGemsUtils::VERSION
12
- s.authors = ['Esquilo Azul Company']
13
- s.summary = 'Utilities for Ruby gems development.'
14
- s.license = 'MIT'
15
- s.homepage = 'https://github.com/esquilo-azul/eac_ruby_gems_utils'
16
- s.metadata = { 'source_code_uri' => s.homepage }
17
-
18
- s.extra_rdoc_files = ['README.rdoc']
19
- s.rdoc_options = ['--charset=UTF-8']
20
-
21
- s.require_paths = ['lib']
22
- s.files = Dir['{lib}/**/*', 'Gemfile']
23
- s.test_files = Dir['{spec}/**/*', '.rspec']
24
-
25
- s.add_dependency 'bundler'
26
- s.add_dependency 'eac_fs', '~> 0.8'
27
- s.add_dependency 'eac_ruby_utils', '~> 0.81'
28
-
29
- # Tests
30
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
31
- end
@@ -1,33 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
- require 'eac_ruby_utils/ruby/command'
5
- require 'delegate'
6
-
7
- module EacRubyGemsUtils
8
- class Gem
9
- class Command < ::EacRubyUtils::Ruby::Command
10
- attr_reader :gem
11
-
12
- def initialize(gem, command_args, extra_options = {})
13
- @gem = gem
14
- super(command_args, extra_options.merge(host_env: gem.host_env))
15
- end
16
-
17
- # Changes current directory to the gem's directory.
18
- def chdir_root
19
- chdir(gem.root.to_path)
20
- end
21
-
22
- def envvar_gemfile
23
- envvar('BUNDLE_GEMFILE', gem.gemfile_path.to_path)
24
- end
25
-
26
- protected
27
-
28
- def duplicate(command, extra_options)
29
- self.class.new(gem, command, extra_options)
30
- end
31
- end
32
- end
33
- end
@@ -1,41 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module EacRubyGemsUtils
6
- class Gem
7
- class VersionFile
8
- common_constructor :path
9
-
10
- VERSION_LINE_PATTERN = /\A(\s*)VERSION\s*=\s*[\'\"]([^\'\"]+)[\'\"](\s*)\z/.freeze
11
-
12
- def value
13
- path.read.each_line.lazy.map { |line| line_value(line) }.find { |v| v }
14
- end
15
-
16
- def value=(new_value)
17
- path.write(new_value_content(new_value))
18
- end
19
-
20
- private
21
-
22
- # @return Version found in line, nil otherwise.
23
- def line_value(line)
24
- VERSION_LINE_PATTERN.if_match(line.rstrip, false) { |m| ::Gem::Version.new(m[2]) }
25
- end
26
-
27
- def new_value_content(new_value)
28
- path.read.each_line
29
- .map { |line| new_value_line(line, new_value) }
30
- .join
31
- end
32
-
33
- def new_value_line(line, new_value)
34
- m = VERSION_LINE_PATTERN.match(line)
35
- return line unless m
36
-
37
- "#{m[1]}VERSION = '#{new_value}'#{m[3]}"
38
- end
39
- end
40
- end
41
- end
@@ -1,97 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
- require 'eac_ruby_utils/envs'
5
- require 'rubygems'
6
-
7
- module EacRubyGemsUtils
8
- class Gem
9
- require_sub __FILE__
10
- enable_simple_cache
11
-
12
- GEMSPEC_EXTNAME = '.gemspec'
13
-
14
- common_constructor :root, :host_env, default: [nil] do
15
- @root = ::Pathname.new(root).expand_path
16
- self.host_env ||= ::EacRubyUtils::Envs.local
17
- end
18
-
19
- def to_s
20
- name
21
- end
22
-
23
- def bundle(*args)
24
- ::EacRubyGemsUtils::Gem::Command.new(self, %w[bundle] + args).envvar_gemfile
25
- end
26
-
27
- # @return A [Pathname] array with relative paths from root listed in gemspec's .file directive.
28
- def files
29
- gemspec.files.map(&:to_pathname)
30
- end
31
-
32
- def gemfile_lock_gem_version(gem_name)
33
- gemfile_lock_content.specs.find { |gem| gem.name == gem_name }.if_present(&:version)
34
- end
35
-
36
- def gemfile_lock_content
37
- ::Bundler::LockfileParser.new(::Bundler.read_file(gemfile_lock_path))
38
- end
39
-
40
- def name
41
- name_by_gemspec || name_by_path
42
- end
43
-
44
- def name_by_gemspec
45
- gemspec_path.if_present { |v| v.basename(GEMSPEC_EXTNAME).to_path }
46
- end
47
-
48
- def name_by_path
49
- fullname = root.basename.to_s
50
- /\A(.+)(?:-\d+(?:\.\d+)*)\z/.if_match(fullname, false) { |m| m[1] }.if_present(fullname)
51
- end
52
-
53
- def namespace_parts
54
- name.split('-')
55
- end
56
-
57
- def rake(*args)
58
- raise "File \"#{rakefile_path}\" does not exist" unless rakefile_path.exist?
59
-
60
- bundle('exec', 'rake', '--rakefile', rakefile_path, *args)
61
- end
62
-
63
- def version
64
- version_file.value
65
- end
66
-
67
- private
68
-
69
- def gemfile_path_uncached
70
- root.join('Gemfile')
71
- end
72
-
73
- def gemfile_lock_path_uncached
74
- gemfile_path.basename_sub { |b| "#{b}.lock" }
75
- end
76
-
77
- def gemspec_uncached
78
- ::Gem::Specification.load(gemspec_path.to_path)
79
- end
80
-
81
- def gemspec_path_uncached
82
- ::Pathname.glob("#{root.to_path}/*#{GEMSPEC_EXTNAME}").first
83
- end
84
-
85
- def rakefile_path_uncached
86
- root.join('Rakefile')
87
- end
88
-
89
- def version_file_uncached
90
- ::EacRubyGemsUtils::Gem::VersionFile.new(version_file_path)
91
- end
92
-
93
- def version_file_path_uncached
94
- root.join('lib', *namespace_parts, 'version.rb')
95
- end
96
- end
97
- end
@@ -1,57 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
- require 'eac_fs/logs'
5
- require 'eac_ruby_utils/listable'
6
-
7
- module EacRubyGemsUtils
8
- module Tests
9
- class Base
10
- include ::EacRubyUtils::Listable
11
-
12
- enable_simple_cache
13
- lists.add_string :result, :failed, :nonexistent, :successful
14
-
15
- common_constructor :gem
16
-
17
- def elegible?
18
- dependency_present? && gem.root.join(test_directory).exist?
19
- end
20
-
21
- def dependency_present?
22
- gem.gemfile_path.exist? && gem.gemfile_lock_gem_version(dependency_gem).present?
23
- end
24
-
25
- def name
26
- self.class.name.demodulize.gsub(/Test\z/, '')
27
- end
28
-
29
- def to_s
30
- "#{gem}[#{name}]"
31
- end
32
-
33
- private
34
-
35
- def logs_uncached
36
- ::EacFs::Logs.new.add(:stdout).add(:stderr)
37
- end
38
-
39
- def result_uncached
40
- return RESULT_NONEXISTENT unless elegible?
41
-
42
- exec_run_with_log ? RESULT_SUCCESSFUL : RESULT_FAILED
43
- end
44
-
45
- def exec_run
46
- gem.bundle('exec', *bundle_exec_args).chdir_root.execute
47
- end
48
-
49
- def exec_run_with_log
50
- r = exec_run
51
- logs[:stdout].write(r[:stdout])
52
- logs[:stderr].write(r[:stderr])
53
- r[:exit_code].zero?
54
- end
55
- end
56
- end
57
- end
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_gems_utils/tests/base'
4
-
5
- module EacRubyGemsUtils
6
- module Tests
7
- class Minitest < ::EacRubyGemsUtils::Tests::Base
8
- def bundle_exec_args
9
- %w[rake test]
10
- end
11
-
12
- def dependency_gem
13
- 'minitest'
14
- end
15
-
16
- def elegible?
17
- super && gem.rakefile_path.exist?
18
- end
19
-
20
- def test_directory
21
- 'test'
22
- end
23
- end
24
- end
25
- end
@@ -1,48 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module EacRubyGemsUtils
6
- module Tests
7
- class Multiple
8
- class DecoratedGem < ::SimpleDelegator
9
- enable_speaker
10
-
11
- def prepare
12
- return unless gemfile_path.exist?
13
-
14
- log('running "bundle install"...')
15
- return if bundle('install').execute.fetch(:exit_code).zero?
16
-
17
- unless can_remove_gemfile_lock?
18
- raise '"bundle install" failed and the Gemfile.lock is part of gem' \
19
- '(Should be changed by developer)'
20
- end
21
-
22
- prepare_with_removable_gemfile_lock
23
- end
24
-
25
- def tests
26
- [::EacRubyGemsUtils::Tests::Minitest.new(__getobj__),
27
- ::EacRubyGemsUtils::Tests::Rspec.new(__getobj__)]
28
- end
29
-
30
- private
31
-
32
- def log(message)
33
- infov self, message
34
- end
35
-
36
- def prepare_with_removable_gemfile_lock
37
- log('"bundle install" failed, removing Gemfile.lock and trying again...')
38
- gemfile_lock_path.unlink if gemfile_lock_path.exist?
39
- bundle('install').execute!
40
- end
41
-
42
- def can_remove_gemfile_lock?
43
- !files.include?(gemfile_lock_path.relative_path_from(root))
44
- end
45
- end
46
- end
47
- end
48
- end
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module EacRubyGemsUtils
4
- module Tests
5
- class Multiple
6
- class Result
7
- common_constructor :result
8
-
9
- COLORS = {
10
- ::EacRubyGemsUtils::Tests::Base::RESULT_FAILED => :red,
11
- ::EacRubyGemsUtils::Tests::Base::RESULT_NONEXISTENT => :white,
12
- ::EacRubyGemsUtils::Tests::Base::RESULT_SUCCESSFUL => :green
13
- }.freeze
14
-
15
- def tag
16
- result.to_s.send(color)
17
- end
18
-
19
- def color
20
- COLORS.fetch(result)
21
- end
22
- end
23
- end
24
- end
25
- end
@@ -1,84 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_gems_utils/tests/minitest'
4
- require 'eac_ruby_gems_utils/tests/rspec'
5
- require 'eac_ruby_utils/core_ext'
6
-
7
- module EacRubyGemsUtils
8
- module Tests
9
- class Multiple
10
- require_sub __FILE__
11
- enable_speaker
12
- enable_simple_cache
13
- common_constructor :gems, :options, default: [{}]
14
- set_callback :initialize, :after, :run
15
-
16
- def ok?
17
- failed_tests.none?
18
- end
19
-
20
- def only
21
- options[:only]
22
- end
23
-
24
- private
25
-
26
- def all_tests_uncached
27
- decorated_gems.flat_map(&:tests)
28
- end
29
-
30
- def clear_logs
31
- all_tests.each do |test|
32
- test.logs.remove_all
33
- end
34
- end
35
-
36
- def prepare_all_gems
37
- infom 'Preparing all gems...'
38
- decorated_gems.each(&:prepare)
39
- end
40
-
41
- def decorated_gems_uncached
42
- r = gems
43
- r = r.select { |gem| only.include?(gem.name) } if only.present?
44
- r.map { |gem| DecoratedGem.new(gem) }
45
- end
46
-
47
- def failed_tests_uncached
48
- all_tests.select { |r| r.result == ::EacRubyGemsUtils::Tests::Base::RESULT_FAILED }
49
- end
50
-
51
- def final_results_banner
52
- if failed_tests.any?
53
- warn 'Some test did not pass:'
54
- failed_tests.each do |test|
55
- infov ' * Test', test
56
- info test.logs.truncate_all
57
- end
58
- else
59
- success 'All tests passed'
60
- end
61
- end
62
-
63
- def run
64
- start_banner
65
- prepare_all_gems
66
- test_all_gems
67
- final_results_banner
68
- ensure
69
- clear_logs
70
- end
71
-
72
- def start_banner
73
- infov 'Gems to test', decorated_gems.count
74
- end
75
-
76
- def test_all_gems
77
- infom 'Running tests...'
78
- all_tests.each do |test|
79
- infov test, Result.new(test.result).tag
80
- end
81
- end
82
- end
83
- end
84
- end
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_gems_utils/tests/base'
4
-
5
- module EacRubyGemsUtils
6
- module Tests
7
- class Rspec < ::EacRubyGemsUtils::Tests::Base
8
- def bundle_exec_args
9
- %w[rspec]
10
- end
11
-
12
- def dependency_gem
13
- 'rspec-core'
14
- end
15
-
16
- def test_directory
17
- 'spec'
18
- end
19
- end
20
- end
21
- end
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module EacRubyGemsUtils
6
- module Tests
7
- require_sub(__FILE__)
8
- end
9
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module EacRubyGemsUtils
4
- VERSION = '0.9.10'
5
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module EacRubyGemsUtils
6
- require_sub(__FILE__)
7
- end
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- ::EacRubyUtils::Rspec.default_setup.describe_rubocop
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_gems_utils/gem'
4
-
5
- ::RSpec.describe ::EacRubyGemsUtils::Gem::VersionFile do
6
- let(:stubs_dir) { ::Pathname.new(__dir__).join('version_file_spec_files') }
7
- let(:stub_file) { stubs_dir.join('a_version_file.rb') }
8
- let(:instance) { described_class.new(stub_file) }
9
- let(:target_version) { ::Gem::Version.new('0.69.1') }
10
-
11
- describe '#value' do
12
- it { expect(instance.value).to eq(target_version) }
13
- end
14
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module Tools
5
- VERSION = '0.69.1'
6
- end
7
- end
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_gems_utils/gem'
4
-
5
- ::RSpec.describe ::EacRubyGemsUtils::Gem do
6
- let(:mygem_path) { ::Pathname.new(__dir__).expand_path.parent.parent.join('support', 'mygem') }
7
- let(:mygem) { described_class.new(mygem_path) }
8
-
9
- describe '#bundle' do
10
- specify do
11
- expect(mygem.bundle('exec', 'myrunner').execute!).to include('My Runner')
12
- end
13
- end
14
-
15
- describe '#rake' do
16
- specify do
17
- expect(mygem.rake('mygem:stub').execute!).to include('Stub!')
18
- end
19
- end
20
- end
@@ -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,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec
@@ -1,19 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- mygem (1.0.0)
5
- rake
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- rake (13.0.1)
11
-
12
- PLATFORMS
13
- ruby
14
-
15
- DEPENDENCIES
16
- mygem!
17
-
18
- BUNDLED WITH
19
- 2.2.25
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- begin
4
- require 'bundler/setup'
5
- rescue LoadError
6
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
7
- end
8
-
9
- namespace :mygem do
10
- desc 'A stub task.'
11
- task :stub do
12
- puts 'Stub!'
13
- end
14
- end
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- $LOAD_PATH.unshift("#{__dir__}/../lib")
5
- puts 'My Runner'
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Mygem
4
- VERSION = '1.0.0'
5
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Mygem
4
- require 'mygem/version'
5
- end
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- $LOAD_PATH.push File.expand_path('lib', __dir__)
4
-
5
- Gem::Specification.new do |s|
6
- s.name = 'mygem'
7
- s.version = '1.0.0'
8
- s.authors = ['Esquilo Azul Company']
9
- s.summary = 'Stub gem.'
10
-
11
- s.files = Dir['{exe,lib}/**/*', 'Gemfile', 'Rakefile']
12
- s.bindir = 'exe'
13
- s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
14
-
15
- s.add_dependency 'rake'
16
- end