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,60 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
|
5
|
-
module Avm
|
6
|
-
module Instances
|
7
|
-
module EntryKeys
|
8
|
-
class << self
|
9
|
-
def all
|
10
|
-
all_keys.to_a
|
11
|
-
end
|
12
|
-
|
13
|
-
def keys_consts_set(prefix, suffixes)
|
14
|
-
if suffixes.is_a?(::Hash)
|
15
|
-
keys_consts_set_from_hash(prefix, suffixes)
|
16
|
-
elsif suffixes.is_a?(::Enumerable)
|
17
|
-
keys_consts_set_from_enum(prefix, suffixes)
|
18
|
-
else
|
19
|
-
raise "Unmapped suffixes class: #{suffixes.class}"
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def key_const_set(prefix, suffix)
|
24
|
-
key = [prefix, suffix].reject(&:blank?).join('.')
|
25
|
-
const_set(key.gsub('.', '_').upcase, key)
|
26
|
-
all_keys << key
|
27
|
-
end
|
28
|
-
|
29
|
-
private
|
30
|
-
|
31
|
-
def all_keys
|
32
|
-
@all_keys ||= ::Set.new
|
33
|
-
end
|
34
|
-
|
35
|
-
def keys_consts_set_from_enum(prefix, suffixes)
|
36
|
-
suffixes.each { |suffix| key_const_set(prefix, suffix) }
|
37
|
-
end
|
38
|
-
|
39
|
-
def keys_consts_set_from_hash(prefix, suffixes)
|
40
|
-
suffixes.each { |k, v| keys_consts_set(prefix.to_s + (k.blank? ? '' : ".#{k}"), v) }
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
{
|
45
|
-
'' => %w[data_fs_path fs_path host_id name source_instance_id],
|
46
|
-
admin: %w[username password api_key],
|
47
|
-
database: %w[id hostname limit name password port system timeout username extra],
|
48
|
-
docker: %w[registry],
|
49
|
-
fs: %w[url],
|
50
|
-
mailer: {
|
51
|
-
'' => %w[id from reply_to],
|
52
|
-
smtp: %w[address port domain username password authentication openssl_verify_mode
|
53
|
-
starttls_auto tls]
|
54
|
-
},
|
55
|
-
ssh: %w[hostname port url username],
|
56
|
-
web: %w[authority hostname path port scheme url userinfo]
|
57
|
-
}.each { |prefix, suffixes| keys_consts_set(prefix, suffixes) }
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/runners/base'
|
4
|
-
require 'eac_cli/core_ext'
|
5
|
-
|
6
|
-
module Avm
|
7
|
-
module Instances
|
8
|
-
class Runner < ::Avm::Runners::Base
|
9
|
-
class << self
|
10
|
-
def instance_class
|
11
|
-
::Avm.const_get(stereotype_name).const_get('Instance')
|
12
|
-
end
|
13
|
-
|
14
|
-
def stereotype_module
|
15
|
-
::Avm.const_get(stereotype_name)
|
16
|
-
end
|
17
|
-
|
18
|
-
def stereotype_name
|
19
|
-
name.demodulize
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
description = "Utilities for #{stereotype_name} instances."
|
24
|
-
runner_with :help, :subcommands do
|
25
|
-
desc description
|
26
|
-
pos_arg 'instance-id'
|
27
|
-
subcommands
|
28
|
-
end
|
29
|
-
|
30
|
-
delegate :instance_class, :stereotype_module, :stereotype_name, to: :class
|
31
|
-
|
32
|
-
private
|
33
|
-
|
34
|
-
def instance_uncached
|
35
|
-
self.class.instance_class.by_id(parsed.instance_id)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,63 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/jobs/variables_source'
|
4
|
-
require 'avm/result'
|
5
|
-
require 'eac_cli/core_ext'
|
6
|
-
|
7
|
-
module Avm
|
8
|
-
module Jobs
|
9
|
-
module Base
|
10
|
-
common_concern do
|
11
|
-
include ::ActiveSupport::Callbacks
|
12
|
-
|
13
|
-
enable_speaker
|
14
|
-
enable_simple_cache
|
15
|
-
enable_listable
|
16
|
-
common_constructor :instance, :options, default: [{}] do
|
17
|
-
if option_list.present?
|
18
|
-
self.options = option_list.hash_keys_validate!(options.symbolize_keys)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
define_callbacks(*jobs)
|
22
|
-
end
|
23
|
-
|
24
|
-
module ClassMethods
|
25
|
-
def jobs
|
26
|
-
const_get('JOBS').dup
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
module InstanceMethods
|
31
|
-
def option_list
|
32
|
-
nil
|
33
|
-
end
|
34
|
-
|
35
|
-
def run
|
36
|
-
start_banner if respond_to?(:start_banner)
|
37
|
-
run_jobs
|
38
|
-
::Avm::Result.success('Done!')
|
39
|
-
rescue ::Avm::Result::Error => e
|
40
|
-
e.to_result
|
41
|
-
end
|
42
|
-
|
43
|
-
def variables_source
|
44
|
-
::Avm::Jobs::VariablesSource.new(self, instance)
|
45
|
-
end
|
46
|
-
|
47
|
-
protected
|
48
|
-
|
49
|
-
def run_jobs
|
50
|
-
jobs.each do |job|
|
51
|
-
run_callbacks job do
|
52
|
-
send(job)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
def jobs
|
58
|
-
self.class.jobs
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
|
5
|
-
module Avm
|
6
|
-
module Jobs
|
7
|
-
class VariablesSource
|
8
|
-
common_constructor :job, :instance
|
9
|
-
|
10
|
-
def read_entry(path, options = {})
|
11
|
-
entry_from_job(path) || instance.read_entry(path, options)
|
12
|
-
end
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
def entry_from_job(path)
|
17
|
-
method = path.gsub('.', '_').underscore
|
18
|
-
return job.send(method) if job.respond_to?(method, true)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
data/sub/avm/lib/avm/jobs.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/launcher/errors/base'
|
4
|
-
|
5
|
-
module Avm
|
6
|
-
module Launcher
|
7
|
-
module Errors
|
8
|
-
class NonProject < ::Avm::Launcher::Errors::Base
|
9
|
-
def initialize(path)
|
10
|
-
super("#{path} is not a project")
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Avm
|
4
|
-
module Launcher
|
5
|
-
module Paths
|
6
|
-
class Real < String
|
7
|
-
def initialize(path)
|
8
|
-
raise "Argument path is not a string: \"#{path}\"|#{path.class}" unless path.is_a?(String)
|
9
|
-
|
10
|
-
super(path)
|
11
|
-
end
|
12
|
-
|
13
|
-
def subpath(relative_path)
|
14
|
-
::Avm::Launcher::Paths::Real.new(::File.expand_path(relative_path, self))
|
15
|
-
end
|
16
|
-
|
17
|
-
def basename
|
18
|
-
::File.basename(self)
|
19
|
-
end
|
20
|
-
|
21
|
-
def dirname
|
22
|
-
return nil if self == '/'
|
23
|
-
|
24
|
-
self.class.new(::File.dirname(self))
|
25
|
-
end
|
26
|
-
|
27
|
-
def find_file_with_extension(extension)
|
28
|
-
r = find_files_with_extension(extension)
|
29
|
-
return r.first if r.any?
|
30
|
-
|
31
|
-
raise "Extension \"#{extension}\" not found in directory \"#{self}\""
|
32
|
-
end
|
33
|
-
|
34
|
-
def find_files_with_extension(extension)
|
35
|
-
r = []
|
36
|
-
::Dir.entries(self).each do |i|
|
37
|
-
r << ::File.expand_path(i, self) if i =~ /#{::Regexp.quote(extension)}\z/
|
38
|
-
end
|
39
|
-
r
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,67 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'active_support/concern' # Missing on "eac/listable"
|
4
|
-
require 'active_support/hash_with_indifferent_access'
|
5
|
-
require 'eac_ruby_utils/listable'
|
6
|
-
|
7
|
-
module Avm
|
8
|
-
module Launcher
|
9
|
-
module Publish
|
10
|
-
class CheckResult
|
11
|
-
include ::EacRubyUtils::Listable
|
12
|
-
|
13
|
-
lists.add_string :status, :updated, :pending, :blocked, :outdated
|
14
|
-
|
15
|
-
lists.status.values.each do |status| # rubocop:disable Style/HashEachMethods
|
16
|
-
class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
|
17
|
-
def self.#{status}(message)
|
18
|
-
new('#{status}', message)
|
19
|
-
end
|
20
|
-
RUBY_EVAL
|
21
|
-
end
|
22
|
-
|
23
|
-
class << self
|
24
|
-
def pending_status?(status)
|
25
|
-
[STATUS_PENDING].include?(status)
|
26
|
-
end
|
27
|
-
|
28
|
-
def updated_color
|
29
|
-
'green'
|
30
|
-
end
|
31
|
-
|
32
|
-
def pending_color
|
33
|
-
'yellow'
|
34
|
-
end
|
35
|
-
|
36
|
-
def blocked_color
|
37
|
-
'red'
|
38
|
-
end
|
39
|
-
|
40
|
-
def outdated_color
|
41
|
-
'light_blue'
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
attr_reader :status, :message
|
46
|
-
|
47
|
-
def initialize(status, message)
|
48
|
-
raise "Status \"#{status}\" not in #{self.class.lists.status.values}" unless
|
49
|
-
self.class.lists.status.values.include?(status)
|
50
|
-
|
51
|
-
@status = status
|
52
|
-
@message = message
|
53
|
-
end
|
54
|
-
|
55
|
-
def to_s
|
56
|
-
message.light_white.send("on_#{background_color}")
|
57
|
-
end
|
58
|
-
|
59
|
-
private
|
60
|
-
|
61
|
-
def background_color
|
62
|
-
self.class.send("#{status}_color")
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'active_support/core_ext/object/blank'
|
4
|
-
|
5
|
-
module Avm
|
6
|
-
# String with paths like PATH variable.
|
7
|
-
# Note: the separator is not system dependent.
|
8
|
-
class PathString < String
|
9
|
-
SEPARATOR = ':'
|
10
|
-
|
11
|
-
class << self
|
12
|
-
# Shortcut for [Avm::Paths.new(string).paths].
|
13
|
-
def paths(string)
|
14
|
-
new(string).paths
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def initialize(string = nil)
|
19
|
-
super(string.to_s)
|
20
|
-
end
|
21
|
-
|
22
|
-
# @return [Array] List of paths. Blank paths are rejected.
|
23
|
-
def paths
|
24
|
-
split(SEPARATOR).reject(&:blank?)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,67 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
require 'eac_ruby_utils/gems_registry'
|
5
|
-
|
6
|
-
module Avm
|
7
|
-
module Registry
|
8
|
-
class Base
|
9
|
-
enable_simple_cache
|
10
|
-
common_constructor :module_suffix
|
11
|
-
|
12
|
-
def detect(*registered_initialize_args)
|
13
|
-
detect_optional(*registered_initialize_args) ||
|
14
|
-
raise("No registered module valid for #{registered_initialize_args}" \
|
15
|
-
" (Module suffix: #{module_suffix}, Available: #{registered_modules.join(', ')})")
|
16
|
-
end
|
17
|
-
|
18
|
-
def detect_optional(*registered_initialize_args)
|
19
|
-
registered_modules.reverse.lazy.map { |klass| klass.new(*registered_initialize_args) }
|
20
|
-
.find(&:valid?)
|
21
|
-
end
|
22
|
-
|
23
|
-
def provider_module_suffix
|
24
|
-
"#{module_suffix}::Provider"
|
25
|
-
end
|
26
|
-
|
27
|
-
def single_module_suffix
|
28
|
-
"#{module_suffix}::Base"
|
29
|
-
end
|
30
|
-
|
31
|
-
def to_s
|
32
|
-
"#{self.class}[#{module_suffix}]"
|
33
|
-
end
|
34
|
-
|
35
|
-
def valid_registered_module?(a_module)
|
36
|
-
a_module.is_a?(::Class) && !a_module.abstract?
|
37
|
-
end
|
38
|
-
|
39
|
-
private
|
40
|
-
|
41
|
-
def registered_modules_uncached
|
42
|
-
registered_gems.flat_map { |registry| modules_from_registry(registry) }
|
43
|
-
.select { |v| valid_registered_module?(v) }.uniq
|
44
|
-
end
|
45
|
-
|
46
|
-
def modules_from_registry(registry)
|
47
|
-
if registry.registry.module_suffix == provider_module_suffix
|
48
|
-
registry.registered_module.new.all
|
49
|
-
else
|
50
|
-
[registry.registered_module]
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
def registered_gems
|
55
|
-
(single_instance_registry.registered + provider_registry.registered).sort
|
56
|
-
end
|
57
|
-
|
58
|
-
def single_instance_registry_uncached
|
59
|
-
::EacRubyUtils::GemsRegistry.new(single_module_suffix)
|
60
|
-
end
|
61
|
-
|
62
|
-
def provider_registry_uncached
|
63
|
-
::EacRubyUtils::GemsRegistry.new(provider_module_suffix)
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
data/sub/avm/lib/avm/registry.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
require 'eac_ruby_utils/gems_registry'
|
5
|
-
|
6
|
-
module Avm
|
7
|
-
module Registry
|
8
|
-
require_sub __FILE__
|
9
|
-
enable_listable
|
10
|
-
lists.add_symbol :category, :instance_stereotypes, :runners, :scms, :sources
|
11
|
-
|
12
|
-
class << self
|
13
|
-
enable_simple_cache
|
14
|
-
|
15
|
-
# @return [Array<Avm::Registry::Base>]
|
16
|
-
def registries
|
17
|
-
lists.category.values.map { |c| send(c) }
|
18
|
-
end
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
|
-
::Avm::Registry.lists.category.each_value do |category|
|
23
|
-
define_method "#{category}_uncached" do
|
24
|
-
::Avm::Registry::Base.new(category.to_s.camelize)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
data/sub/avm/lib/avm/result.rb
DELETED
@@ -1,86 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'colorized_string'
|
4
|
-
require 'eac_ruby_utils/listable'
|
5
|
-
require 'eac_ruby_utils/core_ext'
|
6
|
-
|
7
|
-
module Avm
|
8
|
-
class Result < ::SimpleDelegator
|
9
|
-
include ::EacRubyUtils::Listable
|
10
|
-
|
11
|
-
lists.add_string :type, :success, :error, :neutral, :pending, :outdated
|
12
|
-
|
13
|
-
lists.type.values.each do |type| # rubocop:disable Style/HashEachMethods
|
14
|
-
class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
|
15
|
-
def self.#{type}(value)
|
16
|
-
new(value, TYPE_#{type.upcase})
|
17
|
-
end
|
18
|
-
RUBY_EVAL
|
19
|
-
end
|
20
|
-
|
21
|
-
TYPE_SUCCESS_COLOR = 'green'
|
22
|
-
TYPE_ERROR_COLOR = 'red'
|
23
|
-
TYPE_NEUTRAL_COLOR = 'light_black'
|
24
|
-
TYPE_PENDING_COLOR = 'yellow'
|
25
|
-
TYPE_OUTDATED_COLOR = 'blue'
|
26
|
-
|
27
|
-
class << self
|
28
|
-
# Return Avm::Result.success(success_value) if +success+ is truthy.
|
29
|
-
# Return Avm::Result.error(error_value || success_value) if +success+ is falsely.
|
30
|
-
# @return [Avm::Result]
|
31
|
-
def success_or_error(success, success_value, error_value = nil)
|
32
|
-
if success
|
33
|
-
self.success(success_value)
|
34
|
-
else
|
35
|
-
error(error_value.presence || success_value)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
attr_reader :type
|
41
|
-
|
42
|
-
def initialize(value, type)
|
43
|
-
super(value)
|
44
|
-
validate_type(type)
|
45
|
-
@type = type
|
46
|
-
end
|
47
|
-
|
48
|
-
def label
|
49
|
-
label_fg
|
50
|
-
end
|
51
|
-
|
52
|
-
def label_fg
|
53
|
-
ColorizedString.new(to_s).send(type_color)
|
54
|
-
end
|
55
|
-
|
56
|
-
def label_bg
|
57
|
-
ColorizedString.new(to_s).light_white.send("on_#{type_color}")
|
58
|
-
end
|
59
|
-
|
60
|
-
def type_color
|
61
|
-
self.class.const_get("type_#{type}_color".upcase)
|
62
|
-
end
|
63
|
-
|
64
|
-
lists.type.values.each do |type| # rubocop:disable Style/HashEachMethods
|
65
|
-
class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
|
66
|
-
def #{type}?
|
67
|
-
@type == '#{type}'
|
68
|
-
end
|
69
|
-
RUBY_EVAL
|
70
|
-
end
|
71
|
-
|
72
|
-
private
|
73
|
-
|
74
|
-
def validate_type(type)
|
75
|
-
return if self.class.lists.type.values.include?(type)
|
76
|
-
|
77
|
-
raise "Tipo desconhecido: \"#{type}\" (Válido: #{self.class.lists.type.values.join(', ')})"
|
78
|
-
end
|
79
|
-
|
80
|
-
class Error < StandardError
|
81
|
-
def to_result
|
82
|
-
::Avm::Result.error(message)
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
|
5
|
-
module Avm
|
6
|
-
module Rspec
|
7
|
-
module Setup
|
8
|
-
def self.extended(obj)
|
9
|
-
obj.setup_in_avm_registry_example
|
10
|
-
obj.setup_not_in_avm_registry_example
|
11
|
-
end
|
12
|
-
|
13
|
-
def setup_in_avm_registry_example
|
14
|
-
require 'avm/rspec/shared_examples/in_avm_registry'
|
15
|
-
end
|
16
|
-
|
17
|
-
def setup_not_in_avm_registry_example
|
18
|
-
require 'avm/rspec/shared_examples/not_in_avm_registry'
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/registry'
|
4
|
-
|
5
|
-
::RSpec.shared_examples 'in_avm_registry' do |registry_method|
|
6
|
-
let(:avm_registry) { ::Avm::Registry.send(registry_method) }
|
7
|
-
|
8
|
-
it 'is in the avm registry' do
|
9
|
-
expect(avm_registry.registered_modules).to include(described_class)
|
10
|
-
end
|
11
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/registry'
|
4
|
-
|
5
|
-
::RSpec.shared_examples 'not_in_avm_registry' do |registry_method = nil|
|
6
|
-
registry_method.if_present(::Avm::Registry.registries) { |v| [::Avm::Registry.send(v)] }
|
7
|
-
.each do |registry|
|
8
|
-
context "when registry is #{registry}" do
|
9
|
-
it 'is not in the avm registry' do
|
10
|
-
expect(registry.registered_modules).not_to include(described_class)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
data/sub/avm/lib/avm/rspec.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_cli/core_ext'
|
4
|
-
|
5
|
-
module Avm
|
6
|
-
module Runners
|
7
|
-
class Base
|
8
|
-
enable_abstract_methods
|
9
|
-
|
10
|
-
class << self
|
11
|
-
def command_argument
|
12
|
-
stereotype_name.underscore.dasherize
|
13
|
-
end
|
14
|
-
|
15
|
-
def stereotype_name
|
16
|
-
name.split('::')[-3]
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
delegate :command_argument, :stereotype_name, to: :class
|
21
|
-
|
22
|
-
def to_s
|
23
|
-
stereotype_name
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
|
5
|
-
module Avm
|
6
|
-
module Scms
|
7
|
-
class Base
|
8
|
-
enable_abstract_methods
|
9
|
-
enable_simple_cache
|
10
|
-
abstract_methods :update, :valid?
|
11
|
-
common_constructor :path do
|
12
|
-
self.path = path.to_pathname
|
13
|
-
end
|
14
|
-
|
15
|
-
# @return [Avm::Scms::Commit,NilClass]
|
16
|
-
def commit_if_change(_message = nil)
|
17
|
-
raise_abstract_method __method__
|
18
|
-
end
|
19
|
-
|
20
|
-
def name
|
21
|
-
self.class.name.demodulize
|
22
|
-
end
|
23
|
-
|
24
|
-
# @return [Enumerable<Avm::Scms::Base>]
|
25
|
-
def subs
|
26
|
-
raise_abstract_method __method__
|
27
|
-
end
|
28
|
-
|
29
|
-
def to_s
|
30
|
-
name
|
31
|
-
end
|
32
|
-
|
33
|
-
private
|
34
|
-
|
35
|
-
# @return [Avm::Scms::Base]
|
36
|
-
def parent_scm
|
37
|
-
parent_path = path.parent
|
38
|
-
until parent_path.root?
|
39
|
-
::Avm::Registry.scms.detect_optional(parent_path).if_present { |v| return v }
|
40
|
-
parent_path = parent_path.parent
|
41
|
-
end
|
42
|
-
nil
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|