avm-tools 0.119.0 → 0.120.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/projects/stereotypes/ruby_gem/local_project_mixin.rb +3 -3
- data/lib/avm/tools/app_src.rb +1 -5
- data/lib/avm/tools/runner/app_src/ruby.rb +0 -1
- data/lib/avm/tools/version.rb +1 -1
- data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/sources/base.rb +2 -2
- data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/version.rb +1 -1
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/base.rb +3 -3
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
- metadata +6 -232
- data/lib/avm/patches/eac_ruby_gems_utils/gem.rb +0 -29
- data/lib/avm/patches/eac_ruby_gems_utils.rb +0 -4
- data/sub/avm/Gemfile +0 -5
- data/sub/avm/avm.gemspec +0 -26
- data/sub/avm/lib/avm/data/instance/files_unit.rb +0 -40
- data/sub/avm/lib/avm/data/instance/package.rb +0 -18
- data/sub/avm/lib/avm/data/instance/unit.rb +0 -17
- data/sub/avm/lib/avm/data/instance.rb +0 -11
- data/sub/avm/lib/avm/data/package/dump.rb +0 -119
- data/sub/avm/lib/avm/data/package/load.rb +0 -48
- data/sub/avm/lib/avm/data/package.rb +0 -42
- data/sub/avm/lib/avm/data/rotate.rb +0 -107
- data/sub/avm/lib/avm/data/unit.rb +0 -94
- data/sub/avm/lib/avm/docker/container.rb +0 -50
- data/sub/avm/lib/avm/docker/image.rb +0 -71
- data/sub/avm/lib/avm/docker/runner.rb +0 -125
- data/sub/avm/lib/avm/docker.rb +0 -9
- data/sub/avm/lib/avm/executables.rb +0 -24
- data/sub/avm/lib/avm/instances/application.rb +0 -29
- data/sub/avm/lib/avm/instances/base/auto_values/access.rb +0 -40
- data/sub/avm/lib/avm/instances/base/auto_values/admin.rb +0 -19
- data/sub/avm/lib/avm/instances/base/auto_values/data.rb +0 -26
- data/sub/avm/lib/avm/instances/base/auto_values/database.rb +0 -76
- data/sub/avm/lib/avm/instances/base/auto_values/filesystem.rb +0 -43
- data/sub/avm/lib/avm/instances/base/auto_values/mailer.rb +0 -34
- data/sub/avm/lib/avm/instances/base/auto_values/ruby.rb +0 -15
- data/sub/avm/lib/avm/instances/base/auto_values/source.rb +0 -15
- data/sub/avm/lib/avm/instances/base/auto_values/system.rb +0 -23
- data/sub/avm/lib/avm/instances/base/auto_values/web.rb +0 -46
- data/sub/avm/lib/avm/instances/base/auto_values.rb +0 -21
- data/sub/avm/lib/avm/instances/base/dockerizable.rb +0 -45
- data/sub/avm/lib/avm/instances/base/entry_keys.rb +0 -22
- data/sub/avm/lib/avm/instances/base.rb +0 -64
- data/sub/avm/lib/avm/instances/docker_image.rb +0 -15
- data/sub/avm/lib/avm/instances/entries.rb +0 -43
- data/sub/avm/lib/avm/instances/entry.rb +0 -60
- data/sub/avm/lib/avm/instances/entry_keys.rb +0 -60
- data/sub/avm/lib/avm/instances/runner.rb +0 -39
- data/sub/avm/lib/avm/instances.rb +0 -8
- data/sub/avm/lib/avm/jobs/base.rb +0 -63
- data/sub/avm/lib/avm/jobs/variables_source.rb +0 -22
- data/sub/avm/lib/avm/jobs.rb +0 -9
- data/sub/avm/lib/avm/launcher/errors/base.rb +0 -10
- data/sub/avm/lib/avm/launcher/errors/non_project.rb +0 -15
- data/sub/avm/lib/avm/launcher/paths/real.rb +0 -44
- data/sub/avm/lib/avm/launcher/publish/check_result.rb +0 -67
- data/sub/avm/lib/avm/path_string.rb +0 -27
- data/sub/avm/lib/avm/registry/base.rb +0 -67
- data/sub/avm/lib/avm/registry.rb +0 -29
- data/sub/avm/lib/avm/result.rb +0 -86
- data/sub/avm/lib/avm/rspec/setup.rb +0 -22
- data/sub/avm/lib/avm/rspec/shared_examples/in_avm_registry.rb +0 -11
- data/sub/avm/lib/avm/rspec/shared_examples/not_in_avm_registry.rb +0 -14
- data/sub/avm/lib/avm/rspec.rb +0 -9
- data/sub/avm/lib/avm/runners/base.rb +0 -27
- data/sub/avm/lib/avm/scms/base.rb +0 -46
- data/sub/avm/lib/avm/scms/commit.rb +0 -43
- data/sub/avm/lib/avm/scms/inflector.rb +0 -22
- data/sub/avm/lib/avm/self/docker_image.rb +0 -14
- data/sub/avm/lib/avm/self/instance/entry_keys.rb +0 -12
- data/sub/avm/lib/avm/self/instance.rb +0 -31
- data/sub/avm/lib/avm/sources/base/configuration.rb +0 -45
- data/sub/avm/lib/avm/sources/base/instance.rb +0 -28
- data/sub/avm/lib/avm/sources/base/parent.rb +0 -31
- data/sub/avm/lib/avm/sources/base/subs.rb +0 -55
- data/sub/avm/lib/avm/sources/base/subs_paths.rb +0 -32
- data/sub/avm/lib/avm/sources/base/testing.rb +0 -21
- data/sub/avm/lib/avm/sources/base.rb +0 -54
- data/sub/avm/lib/avm/sources/configuration/locale.rb +0 -18
- data/sub/avm/lib/avm/sources/configuration/rubocop.rb +0 -26
- data/sub/avm/lib/avm/sources/configuration/tests.rb +0 -29
- data/sub/avm/lib/avm/sources/configuration.rb +0 -59
- data/sub/avm/lib/avm/sources/tester.rb +0 -24
- data/sub/avm/lib/avm/sources/tests/builder.rb +0 -83
- data/sub/avm/lib/avm/sources/tests/performer.rb +0 -35
- data/sub/avm/lib/avm/sources/tests/result.rb +0 -15
- data/sub/avm/lib/avm/sources/tests/single.rb +0 -56
- data/sub/avm/lib/avm/sources/tests.rb +0 -11
- data/sub/avm/lib/avm/sources.rb +0 -9
- data/sub/avm/lib/avm/sync.rb +0 -94
- data/sub/avm/lib/avm/version.rb +0 -5
- data/sub/avm/lib/avm/version_number.rb +0 -45
- data/sub/avm/lib/avm.rb +0 -7
- data/sub/avm/spec/lib/avm/scms/base_spec.rb +0 -7
- data/sub/avm/spec/lib/avm/sources/base_spec.rb +0 -7
- data/sub/avm/spec/rubocop_spec.rb +0 -3
- data/sub/avm/spec/spec_helper.rb +0 -4
- data/sub/avm-eac_rails_base1/Gemfile +0 -5
- data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +0 -21
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/apache_host.rb +0 -17
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instance.rb +0 -24
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/bundle.rb +0 -26
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/code_runner.rb +0 -26
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb +0 -43
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/logs/clear.rb +0 -26
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/logs.rb +0 -18
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/rails_server.rb +0 -32
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/tasks_scheduler/systemd_unit.rb +0 -46
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/tasks_scheduler.rb +0 -17
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner.rb +0 -12
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/bundle.rb +0 -27
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/rails_environment.rb +0 -47
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/sources/base.rb +0 -27
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit/service.rb +0 -70
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.rb +0 -29
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit.rb +0 -57
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +0 -7
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1.rb +0 -9
- data/sub/avm-eac_rails_base1/spec/rubocop_spec.rb +0 -3
- data/sub/avm-eac_rails_base1/spec/spec_helper.rb +0 -4
- data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/systemd_unit/tasks_scheduler.service +0 -12
- data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.sh +0 -6
- data/sub/avm-eac_ruby_base1/Gemfile +0 -5
- data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +0 -22
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile/add_or_replace_gem_line.rb +0 -56
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile/dependency.rb +0 -19
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile.rb +0 -34
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/depends_on.rb +0 -25
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/gem_conflict.rb +0 -44
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/in_gemfile.rb +0 -17
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/line_buffer.rb +0 -73
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/line_factory.rb +0 -31
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/line_parser_base.rb +0 -19
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser/version_requirement.rb +0 -26
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/incompatible_parser.rb +0 -25
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler.rb +0 -11
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/configured.rb +0 -31
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/envvar.rb +0 -17
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/gemfile.rb +0 -41
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop.rb +0 -55
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/bundle_command.rb +0 -39
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/bundler.rb +0 -39
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/version_bump.rb +0 -23
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb +0 -55
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners/bundler/incompatible.rb +0 -76
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners/bundler.rb +0 -19
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners.rb +0 -13
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/tester.rb +0 -38
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update/sub_update.rb +0 -56
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb +0 -52
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources.rb +0 -11
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +0 -7
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1.rb +0 -9
- data/sub/avm-eac_ruby_base1/locale/en.yml +0 -8
- data/sub/avm-eac_ruby_base1/locale/pt-BR.yml +0 -8
- data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/bundler/incompatible_parser_spec.rb +0 -7
- data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/bundler/incompatible_parser_spec_files/1.source.out +0 -192
- data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/bundler/incompatible_parser_spec_files/1.target.yaml +0 -300
- data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/bundler/incompatible_parser_spec_files/2.source.out +0 -245
- data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/bundler/incompatible_parser_spec_files/2.target.yaml +0 -355
- data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/sources/base_spec.rb +0 -7
- data/sub/avm-eac_ruby_base1/spec/rubocop_spec.rb +0 -3
- data/sub/avm-eac_ruby_base1/spec/spec_helper.rb +0 -4
- data/sub/eac_ruby_base0/Gemfile +0 -5
- data/sub/eac_ruby_base0/eac_ruby_base0.gemspec +0 -21
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/application.rb +0 -87
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/application_xdg.rb +0 -34
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/core_ext.rb +0 -5
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/jobs_runner.rb +0 -31
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/class/jobs_runner.rb +0 -10
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/class.rb +0 -4
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/object/runner_with.rb +0 -5
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/object.rb +0 -5
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches.rb +0 -4
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/rspec/setup.rb +0 -14
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/rspec.rb +0 -9
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +0 -92
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/confirmation.rb +0 -42
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/filesystem_traverser.rb +0 -52
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/input.rb +0 -36
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/output.rb +0 -58
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with.rb +0 -9
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/version.rb +0 -5
- data/sub/eac_ruby_base0/lib/eac_ruby_base0.rb +0 -7
- data/sub/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/confirmation_spec.rb +0 -42
- data/sub/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/output_spec.rb +0 -81
- data/sub/eac_ruby_base0/spec/rubocop_spec.rb +0 -3
- data/sub/eac_ruby_base0/spec/spec_helper.rb +0 -4
- data/sub/eac_ruby_gems_utils/Gemfile +0 -5
- data/sub/eac_ruby_gems_utils/LICENCE +0 -16
- data/sub/eac_ruby_gems_utils/README.rdoc +0 -3
- data/sub/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +0 -31
- data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/command.rb +0 -33
- data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/version_file.rb +0 -41
- data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem.rb +0 -97
- data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/base.rb +0 -57
- data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/minitest.rb +0 -25
- data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/decorated_gem.rb +0 -48
- data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/result.rb +0 -25
- data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple.rb +0 -84
- data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/rspec.rb +0 -21
- data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests.rb +0 -9
- data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +0 -5
- data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils.rb +0 -7
- data/sub/eac_ruby_gems_utils/spec/code/rubocop_check_spec.rb +0 -3
- data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec.rb +0 -14
- data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec_files/a_version_file.rb +0 -7
- data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem_spec.rb +0 -20
- data/sub/eac_ruby_gems_utils/spec/spec_helper.rb +0 -4
- data/sub/eac_ruby_gems_utils/spec/support/mygem/Gemfile +0 -5
- data/sub/eac_ruby_gems_utils/spec/support/mygem/Gemfile.lock +0 -19
- data/sub/eac_ruby_gems_utils/spec/support/mygem/Rakefile +0 -14
- data/sub/eac_ruby_gems_utils/spec/support/mygem/exe/myrunner +0 -5
- data/sub/eac_ruby_gems_utils/spec/support/mygem/lib/mygem/version.rb +0 -5
- data/sub/eac_ruby_gems_utils/spec/support/mygem/lib/mygem.rb +0 -5
- data/sub/eac_ruby_gems_utils/spec/support/mygem/mygem.gemspec +0 -16
@@ -1,56 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/sources/tests/result'
|
4
|
-
require 'eac_ruby_utils/core_ext'
|
5
|
-
require 'eac_fs/logs'
|
6
|
-
|
7
|
-
module Avm
|
8
|
-
module Sources
|
9
|
-
module Tests
|
10
|
-
class Single
|
11
|
-
MAIN_SOURCE_ID = '#main'
|
12
|
-
|
13
|
-
compare_by :order_group, :id
|
14
|
-
enable_simple_cache
|
15
|
-
enable_speaker
|
16
|
-
|
17
|
-
common_constructor :builder, :source
|
18
|
-
|
19
|
-
delegate :logs, :result, to: :tester
|
20
|
-
delegate :to_s, to: :id
|
21
|
-
|
22
|
-
def failed?
|
23
|
-
result == ::Avm::Sources::Tests::Result::FAILED
|
24
|
-
end
|
25
|
-
|
26
|
-
# @return [String]
|
27
|
-
def id
|
28
|
-
if main?
|
29
|
-
MAIN_SOURCE_ID
|
30
|
-
else
|
31
|
-
relative_path_from_main_source.to_s
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def main?
|
36
|
-
relative_path_from_main_source.to_s == '.'
|
37
|
-
end
|
38
|
-
|
39
|
-
def order_group
|
40
|
-
main? ? 1 : 0
|
41
|
-
end
|
42
|
-
|
43
|
-
# @return [Pathname]
|
44
|
-
def relative_path_from_main_source
|
45
|
-
source.path.relative_path_from(builder.main_source.path)
|
46
|
-
end
|
47
|
-
|
48
|
-
private
|
49
|
-
|
50
|
-
def tester_uncached
|
51
|
-
source.tester
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
data/sub/avm/lib/avm/sources.rb
DELETED
data/sub/avm/lib/avm/sync.rb
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
|
5
|
-
module Avm
|
6
|
-
class Sync
|
7
|
-
attr_reader :excludes, :includes
|
8
|
-
|
9
|
-
common_constructor :source_path, :target_path do
|
10
|
-
self.source_path = source_path.to_pathname
|
11
|
-
self.target_path = target_path.to_pathname
|
12
|
-
@excludes = []
|
13
|
-
@includes = []
|
14
|
-
end
|
15
|
-
|
16
|
-
def run
|
17
|
-
clear_target
|
18
|
-
copy
|
19
|
-
end
|
20
|
-
|
21
|
-
def add_exclude(exclude)
|
22
|
-
excludes << exclude
|
23
|
-
|
24
|
-
self
|
25
|
-
end
|
26
|
-
|
27
|
-
def add_excludes(*excludes)
|
28
|
-
excludes.each { |exclude| add_exclude(exclude) }
|
29
|
-
|
30
|
-
self
|
31
|
-
end
|
32
|
-
|
33
|
-
def add_include(include)
|
34
|
-
includes << include
|
35
|
-
|
36
|
-
self
|
37
|
-
end
|
38
|
-
|
39
|
-
def add_includes(*includes)
|
40
|
-
includes.each { |include| add_include(include) }
|
41
|
-
|
42
|
-
self
|
43
|
-
end
|
44
|
-
|
45
|
-
def move_mode(value)
|
46
|
-
@move_mode = value
|
47
|
-
|
48
|
-
self
|
49
|
-
end
|
50
|
-
|
51
|
-
def move_mode?
|
52
|
-
@move_mode ? true : false
|
53
|
-
end
|
54
|
-
|
55
|
-
private
|
56
|
-
|
57
|
-
def clear_target
|
58
|
-
target_remove(target_path)
|
59
|
-
target_path.children.each { |tchild| target_remove(tchild) }
|
60
|
-
end
|
61
|
-
|
62
|
-
def copy
|
63
|
-
source_path.children.each do |schild|
|
64
|
-
::FileUtils.cp_r(schild.to_path, target_path.to_path)
|
65
|
-
schild.rmtree if move_mode?
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
def source_to_target_path(source_path)
|
70
|
-
source_path.relative_path_from(self.source_path).expand_path(target_path)
|
71
|
-
end
|
72
|
-
|
73
|
-
def target_remove(tpath)
|
74
|
-
return if skip_target_path?(tpath)
|
75
|
-
|
76
|
-
if tpath.directory?
|
77
|
-
tpath.children.each { |tchild| target_remove(tchild) }
|
78
|
-
tpath.rmdir if tpath.children.empty?
|
79
|
-
elsif tpath.file?
|
80
|
-
tpath.unlink
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
def skip_target_path?(tpath)
|
85
|
-
skip_path?(tpath.relative_path_from(target_path))
|
86
|
-
end
|
87
|
-
|
88
|
-
def skip_path?(relpath)
|
89
|
-
relpath = relpath.expand_path('/')
|
90
|
-
excludes.any? { |exclude| relpath.fnmatch?(exclude) } &&
|
91
|
-
includes.none? { |include| relpath.fnmatch?(include) }
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|
data/sub/avm/lib/avm/version.rb
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Avm
|
4
|
-
# A sequence of segments of integer versions (Ex.: 2, 1.0.1, 3.0.0.0.0).
|
5
|
-
class VersionNumber
|
6
|
-
include ::Comparable
|
7
|
-
|
8
|
-
SEGMENT_SEPARATOR = '.'
|
9
|
-
|
10
|
-
class << self
|
11
|
-
def segments_from_mixed(segments)
|
12
|
-
(segments.is_a?(::Enumerable) ? segments.to_a : segments.to_s.split(SEGMENT_SEPARATOR))
|
13
|
-
.map(&:to_i)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
attr_reader :segments
|
18
|
-
|
19
|
-
def initialize(segments)
|
20
|
-
@segments = self.class.segments_from_mixed(segments).freeze
|
21
|
-
end
|
22
|
-
|
23
|
-
delegate :[], to: :segments
|
24
|
-
|
25
|
-
def <=>(other)
|
26
|
-
segments <=> other.segments
|
27
|
-
end
|
28
|
-
|
29
|
-
def to_s
|
30
|
-
segments.join(SEGMENT_SEPARATOR)
|
31
|
-
end
|
32
|
-
|
33
|
-
# @return [Avm::Version]
|
34
|
-
def increment_segment(segment_index)
|
35
|
-
x = [segments.count, segment_index + 1].max.times.map do |index|
|
36
|
-
value = index < segments.count ? segments[index] : 0
|
37
|
-
next value if index < segment_index
|
38
|
-
next value + 1 if index == segment_index
|
39
|
-
|
40
|
-
0
|
41
|
-
end
|
42
|
-
self.class.new x
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
data/sub/avm/lib/avm.rb
DELETED
data/sub/avm/spec/spec_helper.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
4
|
-
|
5
|
-
require 'avm/eac_rails_base1/version'
|
6
|
-
|
7
|
-
Gem::Specification.new do |s|
|
8
|
-
s.name = 'avm-eac_rails_base1'
|
9
|
-
s.version = Avm::EacRailsBase1::VERSION
|
10
|
-
s.authors = ['Put here the authors']
|
11
|
-
s.summary = 'Put here de description.'
|
12
|
-
|
13
|
-
s.files = Dir['{lib}/**/*']
|
14
|
-
|
15
|
-
s.add_dependency 'avm-eac_ruby_base1', '~> 0.6'
|
16
|
-
s.add_dependency 'avm-eac_webapp_base0', '~> 0.3'
|
17
|
-
s.add_dependency 'eac_ruby_gems_utils', '~> 0.9', '>= 0.9.9'
|
18
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.68'
|
19
|
-
|
20
|
-
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
21
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/eac_webapp_base0/apache_host'
|
4
|
-
|
5
|
-
module Avm
|
6
|
-
module EacRailsBase1
|
7
|
-
class ApacheHost < ::Avm::EacWebappBase0::ApacheHost
|
8
|
-
def document_root
|
9
|
-
"#{instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH)}/public"
|
10
|
-
end
|
11
|
-
|
12
|
-
def extra_content
|
13
|
-
'PassengerEnabled On'
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/eac_webapp_base0/instance'
|
4
|
-
require 'eac_ruby_gems_utils/gem'
|
5
|
-
|
6
|
-
module Avm
|
7
|
-
module EacRailsBase1
|
8
|
-
class Instance < ::Avm::EacWebappBase0::Instance
|
9
|
-
DEFAULT_RAILS_ENVIRONMENT = 'production'
|
10
|
-
|
11
|
-
def bundle(*args)
|
12
|
-
the_gem.bundle(*args).chdir_root.envvar('RAILS_ENV', DEFAULT_RAILS_ENVIRONMENT)
|
13
|
-
end
|
14
|
-
|
15
|
-
def rake(*args)
|
16
|
-
bundle('exec', 'rake', *args)
|
17
|
-
end
|
18
|
-
|
19
|
-
def the_gem
|
20
|
-
@the_gem ||= ::EacRubyGemsUtils::Gem.new(::File.join(read_entry('fs_path')), host_env)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/eac_rails_base1/runner_with/bundle'
|
4
|
-
require 'eac_cli/core_ext'
|
5
|
-
require 'shellwords'
|
6
|
-
|
7
|
-
module Avm
|
8
|
-
module EacRailsBase1
|
9
|
-
class Runner < ::Avm::EacWebappBase0::Runner
|
10
|
-
class Bundle
|
11
|
-
runner_with ::Avm::EacRailsBase1::RunnerWith::Bundle, :help do
|
12
|
-
desc 'Runs "bundle ...".'
|
13
|
-
pos_arg :'bundle-args', repeat: true, optional: true
|
14
|
-
end
|
15
|
-
|
16
|
-
def run
|
17
|
-
bundle_run
|
18
|
-
end
|
19
|
-
|
20
|
-
def bundle_args
|
21
|
-
parsed.bundle_args.reject { |arg| arg == '--' }
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/eac_rails_base1/runner_with/bundle'
|
4
|
-
require 'eac_cli/core_ext'
|
5
|
-
|
6
|
-
module Avm
|
7
|
-
module EacRailsBase1
|
8
|
-
class Runner < ::Avm::EacWebappBase0::Runner
|
9
|
-
class CodeRunner
|
10
|
-
runner_with :help, ::Avm::EacRailsBase1::RunnerWith::Bundle do
|
11
|
-
desc 'Runs a Ruby code with "rails runner".'
|
12
|
-
pos_arg :code
|
13
|
-
end
|
14
|
-
|
15
|
-
def run
|
16
|
-
infov 'Environment', runner_context.call(:instance).host_env
|
17
|
-
bundle_run
|
18
|
-
end
|
19
|
-
|
20
|
-
def bundle_args
|
21
|
-
%w[exec rails runner] + [parsed.code]
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/eac_rails_base1/runner_with/rails_environment'
|
4
|
-
require 'avm/eac_webapp_base0/runner'
|
5
|
-
|
6
|
-
module Avm
|
7
|
-
module EacRailsBase1
|
8
|
-
class Runner < ::Avm::EacWebappBase0::Runner
|
9
|
-
class Log
|
10
|
-
runner_with :help, ::Avm::EacRailsBase1::RunnerWith::RailsEnvironment do
|
11
|
-
desc 'Read application\'s log.'
|
12
|
-
bool_opt '-f', '--follow', 'Output appended data as the log grows.'
|
13
|
-
end
|
14
|
-
|
15
|
-
def run
|
16
|
-
start_banner
|
17
|
-
tail_command.system
|
18
|
-
end
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
|
-
def log_path
|
23
|
-
::File.join(rails_instance.read_entry('fs_path'), 'log', "#{rails_environment}.log")
|
24
|
-
end
|
25
|
-
|
26
|
-
def start_banner
|
27
|
-
infov 'Environment', rails_environment
|
28
|
-
infov 'Log path', log_path
|
29
|
-
end
|
30
|
-
|
31
|
-
def tail_command
|
32
|
-
rails_instance.host_env.command(*tail_command_args)
|
33
|
-
end
|
34
|
-
|
35
|
-
def tail_command_args
|
36
|
-
r = %w[tail]
|
37
|
-
r << '--follow' if parsed.follow?
|
38
|
-
r + [log_path]
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/eac_rails_base1/runner_with/rails_environment'
|
4
|
-
require 'avm/eac_webapp_base0/runner'
|
5
|
-
|
6
|
-
module Avm
|
7
|
-
module EacRailsBase1
|
8
|
-
class Runner < ::Avm::EacWebappBase0::Runner
|
9
|
-
class Logs
|
10
|
-
class Clear
|
11
|
-
runner_with :help, ::Avm::EacRailsBase1::RunnerWith::Bundle do
|
12
|
-
desc 'Clear logs.'
|
13
|
-
end
|
14
|
-
|
15
|
-
def run
|
16
|
-
bundle_run
|
17
|
-
end
|
18
|
-
|
19
|
-
def bundle_args
|
20
|
-
%w[exec rake log:clear]
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/eac_webapp_base0/runner'
|
4
|
-
require 'eac_cli/core_ext'
|
5
|
-
|
6
|
-
module Avm
|
7
|
-
module EacRailsBase1
|
8
|
-
class Runner < ::Avm::EacWebappBase0::Runner
|
9
|
-
class Logs
|
10
|
-
require_sub __FILE__
|
11
|
-
runner_with :help, :subcommands do
|
12
|
-
desc 'Manipule multiple application\'s logs.'
|
13
|
-
subcommands
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/eac_rails_base1/runner_with/bundle'
|
4
|
-
require 'avm/instances/entry_keys'
|
5
|
-
require 'eac_cli/core_ext'
|
6
|
-
require 'shellwords'
|
7
|
-
|
8
|
-
module Avm
|
9
|
-
module EacRailsBase1
|
10
|
-
class Runner < ::Avm::EacWebappBase0::Runner
|
11
|
-
class RailsServer
|
12
|
-
DEFAULT_RAILS_ENVIRONMENT = 'development'
|
13
|
-
runner_with :help, ::Avm::EacRailsBase1::RunnerWith::Bundle do
|
14
|
-
desc 'Run the embbeded Rails web server.'
|
15
|
-
end
|
16
|
-
|
17
|
-
def run
|
18
|
-
infov 'Environment', rails_environment
|
19
|
-
infov 'Bundle args', ::Shellwords.join(bundle_args)
|
20
|
-
infov 'Result', bundle_command.system
|
21
|
-
end
|
22
|
-
|
23
|
-
protected
|
24
|
-
|
25
|
-
def bundle_args
|
26
|
-
['exec', 'rails', 'server', '--port',
|
27
|
-
runner_context.call(:instance).read_entry(::Avm::Instances::EntryKeys::WEB_PORT)]
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/eac_rails_base1/systemd_unit'
|
4
|
-
require 'eac_ruby_utils/core_ext'
|
5
|
-
|
6
|
-
module Avm
|
7
|
-
module EacRailsBase1
|
8
|
-
class Runner < ::Avm::EacWebappBase0::Runner
|
9
|
-
class TasksScheduler
|
10
|
-
class SystemdUnit
|
11
|
-
DEFAULT_RESTART = 'on-failure'
|
12
|
-
|
13
|
-
runner_with :help do
|
14
|
-
desc 'Configure Systemd unit for instace\'s tasks scheduler daemon (Reference: ' \
|
15
|
-
'https://www.freedesktop.org/software/systemd/man/systemd.service.html).'
|
16
|
-
bool_opt '-e', '--exec-run', 'Run daemon with "run" instead of "start"/"stop".'
|
17
|
-
arg_opt '-r', '--restart', 'Value for systemd.service, Restart=.',
|
18
|
-
default: DEFAULT_RESTART
|
19
|
-
end
|
20
|
-
|
21
|
-
delegate :restart, to: :parsed
|
22
|
-
|
23
|
-
def run
|
24
|
-
if result.error?
|
25
|
-
fatal_error result.to_s
|
26
|
-
else
|
27
|
-
infov 'Result', result.label
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
private
|
32
|
-
|
33
|
-
def systemd_unit_uncached
|
34
|
-
::Avm::EacRailsBase1::SystemdUnit.new(runner_context.call(:instance),
|
35
|
-
restart: parsed.restart,
|
36
|
-
exec_run: parsed.exec_run?)
|
37
|
-
end
|
38
|
-
|
39
|
-
def result_uncached
|
40
|
-
systemd_unit.run
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
|
5
|
-
module Avm
|
6
|
-
module EacRailsBase1
|
7
|
-
class Runner < ::Avm::EacWebappBase0::Runner
|
8
|
-
class TasksScheduler
|
9
|
-
require_sub __FILE__
|
10
|
-
|
11
|
-
runner_with :help, :subcommands do
|
12
|
-
subcommands
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/eac_rails_base1/instance'
|
4
|
-
require 'avm/eac_rails_base1/runner_with/rails_environment'
|
5
|
-
require 'eac_cli/runner'
|
6
|
-
|
7
|
-
module Avm
|
8
|
-
module EacRailsBase1
|
9
|
-
module RunnerWith
|
10
|
-
module Bundle
|
11
|
-
common_concern do
|
12
|
-
include ::Avm::EacRailsBase1::RunnerWith::RailsEnvironment
|
13
|
-
end
|
14
|
-
|
15
|
-
def bundle_command
|
16
|
-
rails_instance.bundle(*bundle_args).envvar('RAILS_ENV', rails_environment)
|
17
|
-
end
|
18
|
-
|
19
|
-
def bundle_run
|
20
|
-
infov 'Bundle arguments', ::Shellwords.join(bundle_args)
|
21
|
-
infov 'Rails environment', rails_environment
|
22
|
-
bundle_command.system!
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/eac_rails_base1/instance'
|
4
|
-
require 'eac_cli/runner'
|
5
|
-
|
6
|
-
module Avm
|
7
|
-
module EacRailsBase1
|
8
|
-
module RunnerWith
|
9
|
-
module RailsEnvironment
|
10
|
-
DEFAULT_RAILS_ENVIRONMENT_CONSTANT = 'DEFAULT_RAILS_ENVIRONMENT'
|
11
|
-
|
12
|
-
common_concern do
|
13
|
-
include ::EacCli::Runner
|
14
|
-
|
15
|
-
runner_definition do
|
16
|
-
arg_opt '-e', '--environment', 'Specifies the environment for the runner to operate' \
|
17
|
-
' (test/development/production). Default: "development".'
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
module ClassMethods
|
22
|
-
def default_rails_environment
|
23
|
-
const_get(DEFAULT_RAILS_ENVIRONMENT_CONSTANT)
|
24
|
-
rescue ::NameError
|
25
|
-
::Avm::EacRailsBase1::Instance::DEFAULT_RAILS_ENVIRONMENT
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def default_rails_environment
|
30
|
-
self.class.default_rails_environment
|
31
|
-
end
|
32
|
-
|
33
|
-
def rails_environment
|
34
|
-
parsed.environment.presence || default_rails_environment
|
35
|
-
end
|
36
|
-
|
37
|
-
def rails_instance
|
38
|
-
if respond_to?(:runner_context)
|
39
|
-
runner_context.call(:instance)
|
40
|
-
else
|
41
|
-
context(:instance)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|