avm-tools 0.118.0 → 0.120.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) 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/app_src.rb +1 -5
  4. data/lib/avm/tools/runner/app_src/ruby.rb +0 -1
  5. data/lib/avm/tools/runner/app_src.rb +2 -0
  6. data/lib/avm/tools/version.rb +1 -1
  7. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/sources/base.rb +2 -2
  8. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/version.rb +1 -1
  9. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/base.rb +3 -3
  10. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
  11. data/sub/{avm-eac_rails_base1 → avm-eac_redmine_plugin_base0}/Gemfile +0 -0
  12. data/sub/avm-eac_redmine_plugin_base0/avm-eac_redmine_plugin_base0.gemspec +19 -0
  13. data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base.rb +30 -0
  14. data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/version.rb +7 -0
  15. data/sub/{avm-eac_ruby_base1/lib/avm/eac_ruby_base1.rb → avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0.rb} +1 -1
  16. data/sub/{avm-eac_rails_base1 → avm-eac_redmine_plugin_base0}/spec/rubocop_spec.rb +0 -0
  17. data/sub/{avm-eac_rails_base1 → avm-eac_redmine_plugin_base0}/spec/spec_helper.rb +0 -0
  18. metadata +27 -223
  19. data/lib/avm/patches/eac_ruby_gems_utils/gem.rb +0 -29
  20. data/lib/avm/patches/eac_ruby_gems_utils.rb +0 -4
  21. data/lib/avm/ruby/bundler/incompatible_parser/depends_on.rb +0 -25
  22. data/lib/avm/ruby/bundler/incompatible_parser/gem_conflict.rb +0 -39
  23. data/lib/avm/ruby/bundler/incompatible_parser/in_gemfile.rb +0 -17
  24. data/lib/avm/ruby/bundler/incompatible_parser/line_buffer.rb +0 -73
  25. data/lib/avm/ruby/bundler/incompatible_parser/line_factory.rb +0 -31
  26. data/lib/avm/ruby/bundler/incompatible_parser/line_parser_base.rb +0 -19
  27. data/lib/avm/ruby/bundler/incompatible_parser/version_requirement.rb +0 -26
  28. data/lib/avm/ruby/bundler/incompatible_parser.rb +0 -25
  29. data/lib/avm/tools/runner/app_src/ruby/bundler/incompatible.rb +0 -82
  30. data/sub/avm/Gemfile +0 -5
  31. data/sub/avm/avm.gemspec +0 -26
  32. data/sub/avm/lib/avm/data/instance/files_unit.rb +0 -40
  33. data/sub/avm/lib/avm/data/instance/package.rb +0 -18
  34. data/sub/avm/lib/avm/data/instance/unit.rb +0 -17
  35. data/sub/avm/lib/avm/data/instance.rb +0 -11
  36. data/sub/avm/lib/avm/data/package/dump.rb +0 -119
  37. data/sub/avm/lib/avm/data/package/load.rb +0 -48
  38. data/sub/avm/lib/avm/data/package.rb +0 -42
  39. data/sub/avm/lib/avm/data/rotate.rb +0 -107
  40. data/sub/avm/lib/avm/data/unit.rb +0 -94
  41. data/sub/avm/lib/avm/docker/container.rb +0 -50
  42. data/sub/avm/lib/avm/docker/image.rb +0 -71
  43. data/sub/avm/lib/avm/docker/runner.rb +0 -125
  44. data/sub/avm/lib/avm/docker.rb +0 -9
  45. data/sub/avm/lib/avm/executables.rb +0 -24
  46. data/sub/avm/lib/avm/instances/application.rb +0 -29
  47. data/sub/avm/lib/avm/instances/base/auto_values/access.rb +0 -40
  48. data/sub/avm/lib/avm/instances/base/auto_values/admin.rb +0 -19
  49. data/sub/avm/lib/avm/instances/base/auto_values/data.rb +0 -26
  50. data/sub/avm/lib/avm/instances/base/auto_values/database.rb +0 -76
  51. data/sub/avm/lib/avm/instances/base/auto_values/filesystem.rb +0 -43
  52. data/sub/avm/lib/avm/instances/base/auto_values/mailer.rb +0 -34
  53. data/sub/avm/lib/avm/instances/base/auto_values/ruby.rb +0 -15
  54. data/sub/avm/lib/avm/instances/base/auto_values/source.rb +0 -15
  55. data/sub/avm/lib/avm/instances/base/auto_values/system.rb +0 -23
  56. data/sub/avm/lib/avm/instances/base/auto_values/web.rb +0 -46
  57. data/sub/avm/lib/avm/instances/base/auto_values.rb +0 -21
  58. data/sub/avm/lib/avm/instances/base/dockerizable.rb +0 -45
  59. data/sub/avm/lib/avm/instances/base/entry_keys.rb +0 -22
  60. data/sub/avm/lib/avm/instances/base.rb +0 -64
  61. data/sub/avm/lib/avm/instances/docker_image.rb +0 -15
  62. data/sub/avm/lib/avm/instances/entries.rb +0 -43
  63. data/sub/avm/lib/avm/instances/entry.rb +0 -60
  64. data/sub/avm/lib/avm/instances/entry_keys.rb +0 -60
  65. data/sub/avm/lib/avm/instances/runner.rb +0 -39
  66. data/sub/avm/lib/avm/instances.rb +0 -8
  67. data/sub/avm/lib/avm/jobs/base.rb +0 -63
  68. data/sub/avm/lib/avm/jobs/variables_source.rb +0 -22
  69. data/sub/avm/lib/avm/jobs.rb +0 -9
  70. data/sub/avm/lib/avm/launcher/errors/base.rb +0 -10
  71. data/sub/avm/lib/avm/launcher/errors/non_project.rb +0 -15
  72. data/sub/avm/lib/avm/launcher/paths/real.rb +0 -44
  73. data/sub/avm/lib/avm/launcher/publish/check_result.rb +0 -67
  74. data/sub/avm/lib/avm/path_string.rb +0 -27
  75. data/sub/avm/lib/avm/registry/base.rb +0 -67
  76. data/sub/avm/lib/avm/registry.rb +0 -29
  77. data/sub/avm/lib/avm/result.rb +0 -86
  78. data/sub/avm/lib/avm/rspec/setup.rb +0 -22
  79. data/sub/avm/lib/avm/rspec/shared_examples/in_avm_registry.rb +0 -11
  80. data/sub/avm/lib/avm/rspec/shared_examples/not_in_avm_registry.rb +0 -14
  81. data/sub/avm/lib/avm/rspec.rb +0 -9
  82. data/sub/avm/lib/avm/runners/base.rb +0 -27
  83. data/sub/avm/lib/avm/scms/base.rb +0 -46
  84. data/sub/avm/lib/avm/scms/commit.rb +0 -43
  85. data/sub/avm/lib/avm/scms/inflector.rb +0 -22
  86. data/sub/avm/lib/avm/self/docker_image.rb +0 -14
  87. data/sub/avm/lib/avm/self/instance/entry_keys.rb +0 -12
  88. data/sub/avm/lib/avm/self/instance.rb +0 -31
  89. data/sub/avm/lib/avm/sources/base/configuration.rb +0 -45
  90. data/sub/avm/lib/avm/sources/base/instance.rb +0 -28
  91. data/sub/avm/lib/avm/sources/base/parent.rb +0 -31
  92. data/sub/avm/lib/avm/sources/base/subs.rb +0 -55
  93. data/sub/avm/lib/avm/sources/base/subs_paths.rb +0 -32
  94. data/sub/avm/lib/avm/sources/base/testing.rb +0 -21
  95. data/sub/avm/lib/avm/sources/base.rb +0 -44
  96. data/sub/avm/lib/avm/sources/configuration/locale.rb +0 -18
  97. data/sub/avm/lib/avm/sources/configuration/rubocop.rb +0 -26
  98. data/sub/avm/lib/avm/sources/configuration/tests.rb +0 -29
  99. data/sub/avm/lib/avm/sources/configuration.rb +0 -59
  100. data/sub/avm/lib/avm/sources/tester.rb +0 -24
  101. data/sub/avm/lib/avm/sources/tests/builder.rb +0 -83
  102. data/sub/avm/lib/avm/sources/tests/performer.rb +0 -35
  103. data/sub/avm/lib/avm/sources/tests/result.rb +0 -15
  104. data/sub/avm/lib/avm/sources/tests/single.rb +0 -56
  105. data/sub/avm/lib/avm/sources/tests.rb +0 -11
  106. data/sub/avm/lib/avm/sources.rb +0 -9
  107. data/sub/avm/lib/avm/sync.rb +0 -94
  108. data/sub/avm/lib/avm/version.rb +0 -5
  109. data/sub/avm/lib/avm/version_number.rb +0 -45
  110. data/sub/avm/lib/avm.rb +0 -7
  111. data/sub/avm/spec/lib/avm/scms/base_spec.rb +0 -7
  112. data/sub/avm/spec/lib/avm/sources/base_spec.rb +0 -7
  113. data/sub/avm/spec/rubocop_spec.rb +0 -3
  114. data/sub/avm/spec/spec_helper.rb +0 -4
  115. data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +0 -21
  116. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/apache_host.rb +0 -17
  117. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instance.rb +0 -24
  118. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/bundle.rb +0 -26
  119. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/code_runner.rb +0 -26
  120. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb +0 -43
  121. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/logs/clear.rb +0 -26
  122. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/logs.rb +0 -18
  123. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/rails_server.rb +0 -32
  124. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/tasks_scheduler/systemd_unit.rb +0 -46
  125. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/tasks_scheduler.rb +0 -17
  126. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner.rb +0 -12
  127. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/bundle.rb +0 -27
  128. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/rails_environment.rb +0 -47
  129. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/sources/base.rb +0 -27
  130. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit/service.rb +0 -70
  131. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.rb +0 -29
  132. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit.rb +0 -57
  133. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +0 -7
  134. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1.rb +0 -9
  135. data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/systemd_unit/tasks_scheduler.service +0 -12
  136. data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.sh +0 -6
  137. data/sub/avm-eac_ruby_base1/Gemfile +0 -5
  138. data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +0 -21
  139. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile/add_or_replace_gem_line.rb +0 -56
  140. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile/dependency.rb +0 -19
  141. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile.rb +0 -34
  142. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler.rb +0 -11
  143. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/configured.rb +0 -31
  144. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/envvar.rb +0 -17
  145. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/gemfile.rb +0 -41
  146. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop.rb +0 -55
  147. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/version_bump.rb +0 -23
  148. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb +0 -50
  149. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/tester.rb +0 -38
  150. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update/sub_update.rb +0 -56
  151. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb +0 -52
  152. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources.rb +0 -11
  153. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +0 -7
  154. data/sub/avm-eac_ruby_base1/locale/en.yaml +0 -8
  155. data/sub/avm-eac_ruby_base1/locale/pt-BR.yaml +0 -8
  156. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/sources/base_spec.rb +0 -7
  157. data/sub/avm-eac_ruby_base1/spec/rubocop_spec.rb +0 -3
  158. data/sub/avm-eac_ruby_base1/spec/spec_helper.rb +0 -4
  159. data/sub/eac_ruby_base0/Gemfile +0 -5
  160. data/sub/eac_ruby_base0/eac_ruby_base0.gemspec +0 -21
  161. data/sub/eac_ruby_base0/lib/eac_ruby_base0/application.rb +0 -87
  162. data/sub/eac_ruby_base0/lib/eac_ruby_base0/application_xdg.rb +0 -34
  163. data/sub/eac_ruby_base0/lib/eac_ruby_base0/core_ext.rb +0 -5
  164. data/sub/eac_ruby_base0/lib/eac_ruby_base0/jobs_runner.rb +0 -31
  165. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/class/jobs_runner.rb +0 -10
  166. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/class.rb +0 -4
  167. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/object/runner_with.rb +0 -5
  168. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/object.rb +0 -5
  169. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches.rb +0 -4
  170. data/sub/eac_ruby_base0/lib/eac_ruby_base0/rspec/setup.rb +0 -14
  171. data/sub/eac_ruby_base0/lib/eac_ruby_base0/rspec.rb +0 -9
  172. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +0 -92
  173. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/confirmation.rb +0 -42
  174. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/filesystem_traverser.rb +0 -52
  175. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/input.rb +0 -36
  176. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/output.rb +0 -58
  177. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with.rb +0 -9
  178. data/sub/eac_ruby_base0/lib/eac_ruby_base0/version.rb +0 -5
  179. data/sub/eac_ruby_base0/lib/eac_ruby_base0.rb +0 -7
  180. data/sub/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/confirmation_spec.rb +0 -42
  181. data/sub/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/output_spec.rb +0 -81
  182. data/sub/eac_ruby_base0/spec/rubocop_spec.rb +0 -3
  183. data/sub/eac_ruby_base0/spec/spec_helper.rb +0 -4
  184. data/sub/eac_ruby_gems_utils/Gemfile +0 -5
  185. data/sub/eac_ruby_gems_utils/LICENCE +0 -16
  186. data/sub/eac_ruby_gems_utils/README.rdoc +0 -3
  187. data/sub/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +0 -31
  188. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/command.rb +0 -33
  189. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/version_file.rb +0 -41
  190. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem.rb +0 -97
  191. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/base.rb +0 -57
  192. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/minitest.rb +0 -25
  193. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/decorated_gem.rb +0 -48
  194. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/result.rb +0 -25
  195. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple.rb +0 -84
  196. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/rspec.rb +0 -21
  197. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests.rb +0 -9
  198. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +0 -5
  199. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils.rb +0 -7
  200. data/sub/eac_ruby_gems_utils/spec/code/rubocop_check_spec.rb +0 -3
  201. data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec.rb +0 -14
  202. data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec_files/a_version_file.rb +0 -7
  203. data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem_spec.rb +0 -20
  204. data/sub/eac_ruby_gems_utils/spec/spec_helper.rb +0 -4
  205. data/sub/eac_ruby_gems_utils/spec/support/mygem/Gemfile +0 -5
  206. data/sub/eac_ruby_gems_utils/spec/support/mygem/Gemfile.lock +0 -19
  207. data/sub/eac_ruby_gems_utils/spec/support/mygem/Rakefile +0 -14
  208. data/sub/eac_ruby_gems_utils/spec/support/mygem/exe/myrunner +0 -5
  209. data/sub/eac_ruby_gems_utils/spec/support/mygem/lib/mygem/version.rb +0 -5
  210. data/sub/eac_ruby_gems_utils/spec/support/mygem/lib/mygem.rb +0 -5
  211. data/sub/eac_ruby_gems_utils/spec/support/mygem/mygem.gemspec +0 -16
@@ -1,39 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
- require 'avm/ruby/bundler/incompatible_parser/line_parser_base'
5
-
6
- module Avm
7
- module Ruby
8
- module Bundler
9
- class IncompatibleParser
10
- class GemConflict < ::Avm::Ruby::Bundler::IncompatibleParser::LineParserBase
11
- LINE_PARSER = /Bundler could not find compatible versions for gem "(.+)":/
12
- .to_parser { |m| new(m[1]) }
13
-
14
- enable_simple_cache
15
- common_constructor :gem_name
16
-
17
- def add_depends_on(depends_on)
18
- @depends_on_stack ||= []
19
- @depends_on_stack << depends_on
20
- end
21
-
22
- def add_version_requirement(version_requirement)
23
- version_requirement.stack = @depends_on_stack
24
- versions_requirements << version_requirement
25
- @depends_on_stack = nil
26
- end
27
-
28
- def data
29
- { gem_name: gem_name, versions_requirements: versions_requirements.map(&:data) }
30
- end
31
-
32
- def versions_requirements
33
- @versions_requirements ||= []
34
- end
35
- end
36
- end
37
- end
38
- end
39
- end
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
- require 'avm/ruby/bundler/incompatible_parser/line_parser_base'
5
-
6
- module Avm
7
- module Ruby
8
- module Bundler
9
- class IncompatibleParser
10
- class InGemfile < ::Avm::Ruby::Bundler::IncompatibleParser::LineParserBase
11
- LINE_PARSER = /In Gemfile:/
12
- .to_parser { |_m| new }
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,73 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
- require 'avm/ruby/bundler/incompatible_parser/gem_conflict'
5
- require 'avm/ruby/bundler/incompatible_parser/line_factory'
6
-
7
- module Avm
8
- module Ruby
9
- module Bundler
10
- class IncompatibleParser
11
- class LineBuffer
12
- class << self
13
- def from_file(path)
14
- new(::File.read(path.to_s))
15
- end
16
- end
17
-
18
- attr_reader :gems_in_conflict
19
-
20
- def initialize(content)
21
- self.gems_in_conflict = []
22
- self.parsing_required = false
23
- content.each_line { |string_line| add_line(LineFactory.new(string_line)) }
24
- end
25
-
26
- private
27
-
28
- attr_accessor :parsing_required
29
- attr_writer :gems_in_conflict
30
-
31
- def add_line(line)
32
- return if line.blank?
33
-
34
- return if LineFactory::TYPES.any? do |type|
35
- next false unless line.result.is_a?(type)
36
-
37
- send("on_#{type.name.demodulize.underscore.variableize}_line", line.result)
38
- true
39
- end
40
-
41
- return unless parsing_required
42
-
43
- raise(::ArgumentError, "Unparsed line: \"#{line.content}\"")
44
- end
45
-
46
- def on_gem_conflict_line(result)
47
- self.parsing_required = true
48
- gems_in_conflict << result
49
- end
50
-
51
- def on_in_gemfile_line(result)
52
- # Do nothing
53
- end
54
-
55
- def on_depends_on_line(result)
56
- current_gem_conflict.add_depends_on(result)
57
- end
58
-
59
- def on_version_requirement_line(result)
60
- current_gem_conflict.add_version_requirement(result)
61
- end
62
-
63
- def current_gem_conflict
64
- raise 'No gems in conflict' if gems_in_conflict.none?
65
- raise 'Last gem is blank' if gems_in_conflict.last.blank?
66
-
67
- gems_in_conflict.last
68
- end
69
- end
70
- end
71
- end
72
- end
73
- end
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
- require 'avm/ruby/bundler/incompatible_parser/depends_on'
5
- require 'avm/ruby/bundler/incompatible_parser/gem_conflict'
6
- require 'avm/ruby/bundler/incompatible_parser/in_gemfile'
7
-
8
- module Avm
9
- module Ruby
10
- module Bundler
11
- class IncompatibleParser
12
- class LineFactory
13
- TYPES = [GemConflict, InGemfile, DependsOn, VersionRequirement].freeze
14
-
15
- enable_simple_cache
16
- common_constructor :content do
17
- self.content = content.strip
18
- end
19
-
20
- delegate :blank?, to: :content
21
-
22
- private
23
-
24
- def result_uncached
25
- TYPES.lazy.map { |type| type.parse(content) }.find(&:present?)
26
- end
27
- end
28
- end
29
- end
30
- end
31
- end
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module Ruby
7
- module Bundler
8
- class IncompatibleParser
9
- class LineParserBase
10
- class << self
11
- def parse(line_content)
12
- const_get('LINE_PARSER').parse(line_content)
13
- end
14
- end
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
- require 'avm/ruby/bundler/incompatible_parser/line_parser_base'
5
-
6
- module Avm
7
- module Ruby
8
- module Bundler
9
- class IncompatibleParser
10
- class VersionRequirement < ::Avm::Ruby::Bundler::IncompatibleParser::LineParserBase
11
- LINE_PARSER = /\A([a-z][a-z_0-9]*)(?: \((.+)\))?\z/
12
- .to_parser { |m| new(m[1], m[2]) }
13
-
14
- enable_simple_cache
15
- attr_accessor :stack
16
-
17
- common_constructor :gem_name, :requirements_source
18
-
19
- def data
20
- { requirements_source: requirements_source, stack: stack.map(&:data) }
21
- end
22
- end
23
- end
24
- end
25
- end
26
- end
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module Ruby
7
- module Bundler
8
- class IncompatibleParser
9
- require_sub __FILE__
10
-
11
- enable_simple_cache
12
- attr_reader :gems_in_conflict
13
-
14
- def initialize(path)
15
- @gems_in_conflict = ::Avm::Ruby::Bundler::IncompatibleParser::LineBuffer
16
- .from_file(path).gems_in_conflict.freeze
17
- end
18
-
19
- def data
20
- gems_in_conflict.map(&:data)
21
- end
22
- end
23
- end
24
- end
25
- end
@@ -1,82 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/ruby/bundler/incompatible_parser'
4
- require 'eac_ruby_base0/core_ext'
5
-
6
- module Avm
7
- module Tools
8
- class Runner
9
- class AppSrc
10
- class Ruby
11
- class Bundler
12
- class Incompatible
13
- runner_with :help do
14
- desc 'Identify incompatible gems in a "Gemfile.lock" file.'
15
- bool_opt '-l', '--last', 'Process the last \"bundle update\" result.'
16
- end
17
-
18
- def run
19
- infov 'Cache path', fs_cache.content_path
20
- infov 'Cached?', fs_cache.stored?
21
- parser.gems_in_conflict.each do |gem_in_conflict|
22
- print_gem_in_conflict(gem_in_conflict)
23
- end
24
- end
25
-
26
- private
27
-
28
- def bundle_update
29
- infom 'Running "bundle update"...'
30
- instance.ruby_gem.bundle('update').execute[:stdout]
31
- end
32
-
33
- def content_path
34
- fs_cache.write(bundle_update) unless fs_cache.stored? && parsed.last?
35
- fs_cache.content_path
36
- end
37
-
38
- def fs_cache_object_id
39
- instance.path.to_s.variableize
40
- end
41
-
42
- def gem_title(gem_in_conflict)
43
- gem_in_conflict.gem_name
44
- end
45
-
46
- def instance
47
- runner_context.call(:instance)
48
- end
49
-
50
- def parser_uncached
51
- ::Avm::Ruby::Bundler::IncompatibleParser.new(content_path)
52
- end
53
-
54
- def print_gem_in_conflict(gem_in_conflict)
55
- infov 'Gem', gem_title(gem_in_conflict)
56
- gem_in_conflict.versions_requirements.each do |requirement|
57
- print_requirement(requirement)
58
- end
59
- end
60
-
61
- def print_requirement(req)
62
- infov ' ' + requirement_title(req), requirement_value(req)
63
- end
64
-
65
- def requirement_stack(req)
66
- req.stack.map { |d| "#{d.gem_name} (#{d.version})" }.join(' > '.green)
67
- end
68
-
69
- def requirement_title(req)
70
- req.requirements_source.if_present('*')
71
- end
72
-
73
- def requirement_value(req)
74
- requirement_stack(req)
75
- end
76
- end
77
- end
78
- end
79
- end
80
- end
81
- end
82
- end
data/sub/avm/Gemfile DELETED
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec
data/sub/avm/avm.gemspec DELETED
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- $LOAD_PATH.push File.expand_path('lib', __dir__)
4
-
5
- require 'avm/version'
6
-
7
- Gem::Specification.new do |s|
8
- s.name = 'avm'
9
- s.version = Avm::VERSION
10
- s.authors = ['Eduardo H. Bogoni']
11
- s.summary = 'Ruby base library for Agora Vai! Methodology (https://avm.esquiloazul.tech).'
12
-
13
- s.files = Dir['{lib}/**/*']
14
-
15
- s.add_dependency 'eac_cli', '~> 0.23', '>= 0.23.1'
16
- s.add_dependency 'eac_docker', '~> 0.3'
17
- s.add_dependency 'eac_git', '~> 0.6'
18
- s.add_dependency 'eac_ruby_utils', '~> 0.95'
19
- s.add_dependency 'eac_templates', '~> 0.1', '>= 0.1.1'
20
- s.add_dependency 'filesize', '~> 0.2'
21
- s.add_dependency 'htmlbeautifier', '~> 1.3', '>= 1.3.1'
22
- s.add_dependency 'minitar', '~> 0.9'
23
-
24
- s.add_development_dependency 'aranha-parsers', '~> 0.14', '~> 0.14.1'
25
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
26
- end
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/data/instance/unit'
4
-
5
- module Avm
6
- module Data
7
- module Instance
8
- class FilesUnit < ::Avm::Data::Instance::Unit
9
- EXTENSION = '.tar.gz'
10
-
11
- attr_reader :fs_path_subpath
12
-
13
- def initialize(instance, fs_path_subpath)
14
- super(instance)
15
- @fs_path_subpath = fs_path_subpath
16
- end
17
-
18
- before_load :clear_files
19
-
20
- def files_path
21
- ::File.join(instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH), fs_path_subpath)
22
- end
23
-
24
- def dump_command
25
- instance.host_env.command('tar', '-czf', '-', '-C', files_path, '.')
26
- end
27
-
28
- def load_command
29
- instance.host_env.command('tar', '-xzf', '-', '-C', files_path)
30
- end
31
-
32
- def clear_files
33
- infom "Removing all files under #{files_path}..."
34
- instance.host_env.command('mkdir', '-p', files_path).execute!
35
- instance.host_env.command('find', files_path, '-mindepth', 1, '-delete').execute!
36
- end
37
- end
38
- end
39
- end
40
- end
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/data/package'
4
-
5
- module Avm
6
- module Data
7
- module Instance
8
- class Package < ::Avm::Data::Package
9
- attr_reader :instance
10
-
11
- def initialize(instance, options = {})
12
- @instance = instance
13
- super options
14
- end
15
- end
16
- end
17
- end
18
- end
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/data/unit'
4
-
5
- module Avm
6
- module Data
7
- module Instance
8
- class Unit < ::Avm::Data::Unit
9
- attr_reader :instance
10
-
11
- def initialize(instance)
12
- @instance = instance
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/require_sub'
4
- ::EacRubyUtils.require_sub(__FILE__)
5
-
6
- module Avm
7
- module Data
8
- module Instance
9
- end
10
- end
11
- end
@@ -1,119 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/data/rotate'
4
- require 'eac_ruby_utils/core_ext'
5
- require 'minitar'
6
-
7
- module Avm
8
- module Data
9
- class Package
10
- class Dump
11
- enable_speaker
12
- enable_listable
13
-
14
- DEFAULT_EXPIRE_TIME = 1.day
15
- DEFAULT_FILE_EXTENSION = '.tar'
16
-
17
- attr_reader :package, :data_file_path, :existing
18
-
19
- lists.add_string :existing, :denied, :overwrite, :rotate, :rotate_expired
20
-
21
- def initialize(package, data_file_path, options = {})
22
- @package = package
23
- @data_file_path = data_file_path
24
- options = options.to_options_consumer
25
- @existing, @expire_time = options.consume(:existing, :expire_time)
26
- options.validate
27
- self.class.lists.existing.value_validate!(@existing)
28
- end
29
-
30
- def runnable?
31
- cannot_run_reason.blank?
32
- end
33
-
34
- def cannot_run_reason
35
- return nil if !data_file_exist? ||
36
- [EXISTING_OVERWRITE, EXISTING_ROTATE].include?(existing)
37
-
38
- if existing == EXISTING_DENIED
39
- 'Data exist and overwriting is denied'
40
- elsif existing == EXISTING_ROTATE_EXPIRED && !data_file_expired?
41
- 'Data exist and yet is not expired'
42
- end
43
- end
44
-
45
- def run
46
- raise "Cannot run: #{cannot_run_reason}" unless runnable?
47
-
48
- build_dir = dump_units_to_build_directory
49
- package_file = create_package_file(build_dir)
50
- rotate
51
- move_download_to_final_dest(package_file)
52
- end
53
-
54
- def data_file_exist?
55
- ::File.exist?(data_file_path)
56
- end
57
-
58
- def data_file_time
59
- data_file_exist? ? ::Time.now - ::File.mtime(data_file_path) : nil
60
- end
61
-
62
- def data_file_expired?
63
- data_file_time.if_present(false) { |v| v >= expire_time }
64
- end
65
-
66
- def expire_time
67
- @expire_time || DEFAULT_EXPIRE_TIME
68
- end
69
-
70
- private
71
-
72
- def download
73
- infom 'Downloading dump...'
74
- download_path = find_download_path
75
- dump_command.system!(output_file: download_path)
76
- fatal_error "File \"#{download_path}\" not saved" unless ::File.exist?(download_path)
77
- fatal_error "File \"#{download_path}\" is empty" if ::File.zero?(download_path)
78
- download_path
79
- end
80
-
81
- def move_download_to_final_dest(download_path)
82
- ::FileUtils.mkdir_p(::File.dirname(data_file_path))
83
- ::FileUtils.mv(download_path, data_file_path)
84
- end
85
-
86
- def rotate
87
- return unless data_file_exist?
88
- return unless existing == EXISTING_ROTATE
89
-
90
- infom "Rotating \"#{data_file_path}\"..."
91
- ::Avm::Data::Rotate.new(data_file_path).run
92
- end
93
-
94
- def new_build_path
95
- f = ::Tempfile.new(self.class.name.parameterize + '-download')
96
- path = f.path
97
- f.close
98
- f.unlink
99
- path
100
- end
101
-
102
- def dump_units_to_build_directory
103
- dir = ::Dir.mktmpdir
104
- package.dump_units_to_directory(dir)
105
- dir
106
- end
107
-
108
- def create_package_file(build_dir)
109
- package_path = new_build_path
110
- infom "Creating package \"#{package_path}\" from \"#{build_dir}\"..."
111
- Dir.chdir(build_dir) do
112
- ::Minitar.pack('.', File.open(::File.expand_path(package_path), 'wb'))
113
- end
114
- package_path
115
- end
116
- end
117
- end
118
- end
119
- end
@@ -1,48 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
- require 'minitar'
5
-
6
- module Avm
7
- module Data
8
- class Package
9
- class Load
10
- enable_speaker
11
-
12
- attr_reader :package, :data_file_path
13
-
14
- def initialize(package, data_file_path)
15
- @package = package
16
- @data_file_path = data_file_path
17
- end
18
-
19
- def runnable?
20
- cannot_run_reason.blank?
21
- end
22
-
23
- def cannot_run_reason
24
- return nil if data_file_exist?
25
-
26
- "Data file \"#{data_file_path}\" does not exist"
27
- end
28
-
29
- def run
30
- raise "Cannot run: #{cannot_run_reason}" unless runnable?
31
-
32
- build_dir = extract_packages_to_build_directory
33
- package.load_units_from_directory(build_dir)
34
- end
35
-
36
- def data_file_exist?
37
- ::File.exist?(data_file_path)
38
- end
39
-
40
- def extract_packages_to_build_directory
41
- dir = ::Dir.mktmpdir
42
- ::Minitar.unpack(data_file_path, dir)
43
- dir
44
- end
45
- end
46
- end
47
- end
48
- end
@@ -1,42 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/data/package/dump'
4
- require 'avm/data/package/load'
5
-
6
- module Avm
7
- module Data
8
- class Package
9
- attr_reader :units
10
-
11
- def initialize(options)
12
- @units = {}
13
- options = options.to_options_consumer
14
- units = options.consume(:units)
15
- options.validate
16
- units.if_present do |v|
17
- v.each { |identifier, unit| add_unit(identifier, unit) }
18
- end
19
- end
20
-
21
- def add_unit(identifier, unit)
22
- @units[identifier.to_sym] = unit
23
- end
24
-
25
- def dump(data_path, options = {})
26
- ::Avm::Data::Package::Dump.new(self, data_path, options)
27
- end
28
-
29
- def load(data_path)
30
- ::Avm::Data::Package::Load.new(self, data_path)
31
- end
32
-
33
- def dump_units_to_directory(directory)
34
- @units.each { |identifier, unit| unit.dump_to_directory(directory, identifier) }
35
- end
36
-
37
- def load_units_from_directory(directory)
38
- @units.each { |identifier, unit| unit.load_from_directory(directory, identifier) }
39
- end
40
- end
41
- end
42
- end