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,70 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module EacRailsBase1
7
- class SystemdUnit
8
- module Service
9
- def service_content
10
- template.child('tasks_scheduler.service').apply(variables_source)
11
- end
12
-
13
- def service_exec_lines
14
- service_exec_operations
15
- .map { |k, v| "#{k}=#{tasks_scheduler_command_path} #{v}" }
16
- .join("\n")
17
- end
18
-
19
- def service_path
20
- ::Pathname.new('/etc/systemd/system').join(unit_name)
21
- end
22
-
23
- def service_link_path
24
- ::Pathname.new('/etc/systemd/system/multi-user.target.wants').join(unit_name)
25
- end
26
-
27
- def verify_service
28
- sudo_system!('systemd-analyze', 'verify', service_path)
29
- end
30
-
31
- private
32
-
33
- def enable_service
34
- systemctl('enable', unit_name)
35
- end
36
-
37
- def link_service
38
- sudo_execute!('rm', '-f', service_link_path)
39
- sudo_execute!('ln', '-s', service_path, service_link_path)
40
- end
41
-
42
- def reload_systemd
43
- systemctl('daemon-reload')
44
- end
45
-
46
- # @return [Hash<String, String>]
47
- def service_exec_operations
48
- if exec_run?
49
- { 'ExecStart' => 'run' }
50
- else
51
- { 'ExecStart' => 'start', 'ExecStop' => 'stop' }
52
- end
53
- end
54
-
55
- def start_service
56
- systemctl('start', unit_name)
57
- end
58
-
59
- def systemctl(*args)
60
- sudo_system!('systemctl', *args)
61
- end
62
-
63
- def write_service
64
- infom 'Writing service\'s unit file...'
65
- platform_instance.file_sudo_write(service_path, service_content)
66
- end
67
- end
68
- end
69
- end
70
- end
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module EacRailsBase1
7
- class SystemdUnit
8
- module TasksSchedulerCommand
9
- def tasks_scheduler_command_content
10
- template.child('tasks_scheduler_command.sh').apply(variables_source)
11
- end
12
-
13
- def tasks_scheduler_command_path
14
- "/opt/aux/#{instance.id}/tasks_scheduler.sh"
15
- end
16
-
17
- private
18
-
19
- def write_tasks_scheduler_command
20
- infom 'Writing tasks scheduler\'s command...'
21
- sudo_execute!('mkdir', '-p', ::File.dirname(tasks_scheduler_command_path))
22
- platform_instance.file_sudo_write(tasks_scheduler_command_path,
23
- tasks_scheduler_command_content)
24
- sudo_execute!('chmod', '+x', tasks_scheduler_command_path)
25
- end
26
- end
27
- end
28
- end
29
- end
@@ -1,57 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/jobs/base'
4
- require 'avm/eac_ubuntu_base0/apache'
5
- require 'eac_ruby_utils/core_ext'
6
-
7
- module Avm
8
- module EacRailsBase1
9
- class SystemdUnit
10
- JOBS = %w[write_tasks_scheduler_command write_service link_service verify_service
11
- reload_systemd enable_service start_service].freeze
12
-
13
- include ::Avm::Jobs::Base
14
- require_sub __FILE__, include_modules: true
15
- delegate :platform_instance, to: :instance
16
-
17
- enable_listable
18
- lists.add_symbol :option, :exec_run, :restart
19
-
20
- def description
21
- "#{instance.id} Tasks Scheduler"
22
- end
23
-
24
- def exec_run?
25
- options[OPTION_EXEC_RUN]
26
- end
27
-
28
- def option_list
29
- self.class.lists.option
30
- end
31
-
32
- def restart
33
- options[OPTION_RESTART]
34
- end
35
-
36
- def unit_name
37
- "#{instance.id}_tasks_scheduler.service"
38
- end
39
-
40
- def user
41
- instance.ssh_username
42
- end
43
-
44
- private
45
-
46
- def sudo_execute!(*args)
47
- platform_instance.host_env.command(['sudo'] + args).execute!
48
- end
49
-
50
- def sudo_system!(*args)
51
- command_args = ['sudo'] + args
52
- infom "Running \"#{::Shellwords.join(command_args)}\"..."
53
- platform_instance.host_env.command(command_args).system!
54
- end
55
- end
56
- end
57
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module EacRailsBase1
5
- VERSION = '0.3.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 EacRailsBase1
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,12 +0,0 @@
1
- [Unit]
2
- Description='%%description%%'
3
- After=postgresql.service
4
-
5
- [Service]
6
- Type=forking
7
- %%service_exec_lines%%
8
- Restart=%%restart%%
9
- User=%%user%%
10
-
11
- [Install]
12
- WantedBy=multi-user.target
@@ -1,6 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e
4
-
5
- source "$HOME/.rvm/scripts/rvm"
6
- ( cd '%%fs_path%%'; RAILS_ENV=production bundle exec tasks_scheduler "$@" )
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- $LOAD_PATH.push File.expand_path('lib', __dir__)
4
-
5
- require 'avm/eac_ruby_base1/version'
6
-
7
- Gem::Specification.new do |s|
8
- s.name = 'avm-eac_ruby_base1'
9
- s.version = Avm::EacRubyBase1::VERSION
10
- s.authors = ['Put here the authors']
11
- s.summary = 'Put here de description.'
12
-
13
- s.files = Dir['{lib,locale}/**/*']
14
-
15
- s.add_dependency 'avm', '~> 0.21'
16
- s.add_dependency 'avm-eac_generic_base0', '~> 0.2'
17
- s.add_dependency 'eac_ruby_gems_utils', '~> 0.9', '>= 0.9.8'
18
- s.add_dependency 'eac_ruby_utils', '~> 0.80'
19
-
20
- s.add_development_dependency 'aranha-parsers', '~> 0.14', '>= 0.14.1'
21
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
22
- end
@@ -1,56 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module EacRubyBase1
7
- module Bundler
8
- class Gemfile
9
- class AddOrReplaceGemLine
10
- enable_method_class
11
- common_constructor :sender, :gem_name, :gem_specs
12
- delegate :lines, to: :sender
13
-
14
- def existing_gem_line_index
15
- lines.index { |line| line.start_with?(gem_line_prefix) }
16
- end
17
-
18
- def result
19
- if existing_gem_line_index.present?
20
- replace_line
21
- else
22
- add_line
23
- end
24
- end
25
-
26
- def add_line
27
- lines.insert(add_line_index, new_gem_line)
28
- end
29
-
30
- def add_line_index
31
- (gems_lines_start_index..(lines.count - 1)).each do |e|
32
- return e if new_gem_line < lines[e]
33
- end
34
- lines.count
35
- end
36
-
37
- def gems_lines_start_index
38
- lines.index { |line| line.start_with?('gem ') } || lines.count
39
- end
40
-
41
- def new_gem_line
42
- ([gem_line_prefix] + gem_specs).join(', ')
43
- end
44
-
45
- def gem_line_prefix
46
- "gem '#{gem_name}'"
47
- end
48
-
49
- def replace_line
50
- lines[existing_gem_line_index] = new_gem_line
51
- end
52
- end
53
- end
54
- end
55
- end
56
- end
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module EacRubyBase1
7
- module Bundler
8
- class Gemfile
9
- class Dependency
10
- common_constructor :gemfile, :gem_name
11
-
12
- def version_specs=(version_specs)
13
- gemfile.add_or_replace_gem_line(gem_name, version_specs)
14
- end
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module EacRubyBase1
7
- module Bundler
8
- class Gemfile
9
- require_sub __FILE__, require_dependency: true
10
-
11
- class << self
12
- def from_file(path)
13
- new(path.read.each_line.map(&:rstrip))
14
- end
15
- end
16
-
17
- common_constructor :lines
18
-
19
- # @return [Avm::EacRubyBase1::Bundler::Gemfile::Dependency]
20
- def dependency(gem_name)
21
- ::Avm::EacRubyBase1::Bundler::Gemfile::Dependency.new(self, gem_name)
22
- end
23
-
24
- def write(path)
25
- path.to_pathname.write(to_text)
26
- end
27
-
28
- def to_text
29
- lines.map { |line| "#{line}\n" }.join
30
- end
31
- end
32
- end
33
- end
34
- end
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
- require 'avm/eac_ruby_base1/bundler/incompatible_parser/line_parser_base'
5
-
6
- module Avm
7
- module EacRubyBase1
8
- module Bundler
9
- class IncompatibleParser
10
- class DependsOn < ::Avm::EacRubyBase1::Bundler::IncompatibleParser::LineParserBase
11
- LINE_PARSER = /(.+) was resolved to (.+), which depends on/
12
- .to_parser { |m| new(m[1], m[2]) }
13
-
14
- common_constructor :gem_name, :version do
15
- self.version = ::Gem::Version.new(version)
16
- end
17
-
18
- def data
19
- { gem_name: gem_name, version: version }
20
- end
21
- end
22
- end
23
- end
24
- end
25
- end
@@ -1,44 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
- require 'avm/eac_ruby_base1/bundler/incompatible_parser/line_parser_base'
5
-
6
- module Avm
7
- module EacRubyBase1
8
- module Bundler
9
- class IncompatibleParser
10
- class GemConflict < ::Avm::EacRubyBase1::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 << depends_on
19
- end
20
-
21
- def add_version_requirement(version_requirement)
22
- version_requirement.stack = depends_on_stack
23
- versions_requirements << version_requirement
24
- @depends_on_stack = nil
25
- end
26
-
27
- def data
28
- { gem_name: gem_name, versions_requirements: versions_requirements.map(&:data) }
29
- end
30
-
31
- def versions_requirements
32
- @versions_requirements ||= []
33
- end
34
-
35
- private
36
-
37
- def depends_on_stack
38
- @depends_on_stack ||= []
39
- end
40
- end
41
- end
42
- end
43
- end
44
- end
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
- require 'avm/eac_ruby_base1/bundler/incompatible_parser/line_parser_base'
5
-
6
- module Avm
7
- module EacRubyBase1
8
- module Bundler
9
- class IncompatibleParser
10
- class InGemfile < ::Avm::EacRubyBase1::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/eac_ruby_base1/bundler/incompatible_parser/gem_conflict'
5
- require 'avm/eac_ruby_base1/bundler/incompatible_parser/line_factory'
6
-
7
- module Avm
8
- module EacRubyBase1
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/eac_ruby_base1/bundler/incompatible_parser/depends_on'
5
- require 'avm/eac_ruby_base1/bundler/incompatible_parser/gem_conflict'
6
- require 'avm/eac_ruby_base1/bundler/incompatible_parser/in_gemfile'
7
-
8
- module Avm
9
- module EacRubyBase1
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 EacRubyBase1
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/eac_ruby_base1/bundler/incompatible_parser/line_parser_base'
5
-
6
- module Avm
7
- module EacRubyBase1
8
- module Bundler
9
- class IncompatibleParser
10
- class VersionRequirement < ::Avm::EacRubyBase1::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 EacRubyBase1
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::EacRubyBase1::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,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module EacRubyBase1
7
- module Bundler
8
- require_sub __FILE__
9
- end
10
- end
11
- end
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/sources/configuration'
4
-
5
- module Avm
6
- module EacRubyBase1
7
- class Rubocop
8
- module Configured
9
- def configured_rubocop_command_uncached
10
- configured_rubocop_command_by_command || configured_rubocop_command_by_gemfile
11
- end
12
-
13
- def configured_rubocop_command_by_command
14
- configuration.if_present(&:rubocop_command)
15
- end
16
-
17
- def configured_rubocop_command_by_gemfile
18
- configuration.if_present(&:rubocop_gemfile).if_present do |v|
19
- rubocop_command_by_gemfile_path(v.parent)
20
- end
21
- end
22
-
23
- private
24
-
25
- def configuration_uncached
26
- ::Avm::Sources::Configuration.find_by_path(base_path)
27
- end
28
- end
29
- end
30
- end
31
- end
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module EacRubyBase1
7
- class Rubocop
8
- module Envvar
9
- RUBOCOP_COMMAND_ENVVAR_NAME = 'RUBOCOP_COMMAND'
10
-
11
- def env_rubocop_command
12
- ENV[RUBOCOP_COMMAND_ENVVAR_NAME].present? ? cmd(ENV[RUBOCOP_COMMAND_ENVVAR_NAME]) : nil
13
- end
14
- end
15
- end
16
- end
17
- end