avm-tools 0.118.0 → 0.120.1
Sign up to get free protection for your applications and to get access to all the features.
- 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/runner/app_src.rb +2 -0
- 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
- data/sub/{avm-eac_rails_base1 → avm-eac_redmine_plugin_base0}/Gemfile +0 -0
- data/sub/avm-eac_redmine_plugin_base0/avm-eac_redmine_plugin_base0.gemspec +19 -0
- data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base.rb +30 -0
- data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/version.rb +7 -0
- data/sub/{avm-eac_ruby_base1/lib/avm/eac_ruby_base1.rb → avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0.rb} +1 -1
- data/sub/{avm-eac_rails_base1 → avm-eac_redmine_plugin_base0}/spec/rubocop_spec.rb +0 -0
- data/sub/{avm-eac_rails_base1 → avm-eac_redmine_plugin_base0}/spec/spec_helper.rb +0 -0
- metadata +27 -223
- data/lib/avm/patches/eac_ruby_gems_utils/gem.rb +0 -29
- data/lib/avm/patches/eac_ruby_gems_utils.rb +0 -4
- data/lib/avm/ruby/bundler/incompatible_parser/depends_on.rb +0 -25
- data/lib/avm/ruby/bundler/incompatible_parser/gem_conflict.rb +0 -39
- data/lib/avm/ruby/bundler/incompatible_parser/in_gemfile.rb +0 -17
- data/lib/avm/ruby/bundler/incompatible_parser/line_buffer.rb +0 -73
- data/lib/avm/ruby/bundler/incompatible_parser/line_factory.rb +0 -31
- data/lib/avm/ruby/bundler/incompatible_parser/line_parser_base.rb +0 -19
- data/lib/avm/ruby/bundler/incompatible_parser/version_requirement.rb +0 -26
- data/lib/avm/ruby/bundler/incompatible_parser.rb +0 -25
- data/lib/avm/tools/runner/app_src/ruby/bundler/incompatible.rb +0 -82
- 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 -44
- 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/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/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 -21
- 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.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/version_bump.rb +0 -23
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb +0 -50
- 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/locale/en.yaml +0 -8
- data/sub/avm-eac_ruby_base1/locale/pt-BR.yaml +0 -8
- 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,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
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
|
5
|
-
module Avm
|
6
|
-
module Scms
|
7
|
-
class Commit
|
8
|
-
enable_abstract_methods
|
9
|
-
|
10
|
-
# @return [Array<Pathname>]
|
11
|
-
def changed_files
|
12
|
-
raise_abstract_method __method__
|
13
|
-
end
|
14
|
-
|
15
|
-
# @param other [Avm::Scms::Commit]
|
16
|
-
# @return [Avm::Scms::Commit]
|
17
|
-
def merge_with(_other)
|
18
|
-
raise_abstract_method __method__
|
19
|
-
end
|
20
|
-
|
21
|
-
# @return [Array<Pathname>]
|
22
|
-
def no_scm_changed_files
|
23
|
-
changed_files.reject { |path| scm_file?(path) }
|
24
|
-
end
|
25
|
-
|
26
|
-
# @param new_message [String]
|
27
|
-
def reword(_new_message)
|
28
|
-
raise_abstract_method __method__
|
29
|
-
end
|
30
|
-
|
31
|
-
# @return [Array<Pathname>]
|
32
|
-
def scm_changed_files
|
33
|
-
changed_files.select { |path| scm_file?(path) }
|
34
|
-
end
|
35
|
-
|
36
|
-
# @param path [Pathname]
|
37
|
-
# @return [TrueClass,FalseClass]
|
38
|
-
def scm_file?(_path)
|
39
|
-
raise_abstract_method __method__
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Avm
|
4
|
-
module Scms
|
5
|
-
class Inflector
|
6
|
-
class << self
|
7
|
-
def default_instance
|
8
|
-
@default_instance ||= new
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
ISSUE_POINTER_NAME_PREFIX = 'issue_'
|
13
|
-
POINTER_NAME_TO_ISSUE_PATTERN = /\A#{Regexp.quote(ISSUE_POINTER_NAME_PREFIX)}(\d+)\z/.freeze
|
14
|
-
POINTER_NAME_TO_ISSUE_PARSER = POINTER_NAME_TO_ISSUE_PATTERN.to_parser { |m| m[1] }
|
15
|
-
|
16
|
-
# @return [String, nil]
|
17
|
-
def pointer_name_to_issue_id(pointer_name)
|
18
|
-
POINTER_NAME_TO_ISSUE_PARSER.parse(pointer_name)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/instances/base'
|
4
|
-
require 'avm/self/docker_image'
|
5
|
-
require 'avm/self/instance/entry_keys'
|
6
|
-
|
7
|
-
module Avm
|
8
|
-
module Self
|
9
|
-
class Instance < ::Avm::Instances::Base
|
10
|
-
DEFAULT_INSTANCE_ID = 'avm_self'
|
11
|
-
|
12
|
-
class << self
|
13
|
-
def default
|
14
|
-
@default ||= by_id(DEFAULT_INSTANCE_ID)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def docker_image_class
|
19
|
-
::Avm::Self::DockerImage
|
20
|
-
end
|
21
|
-
|
22
|
-
def docker_registry
|
23
|
-
read_entry(::Avm::Self::Instance::EntryKeys::DOCKER_REGISTRY_NAME)
|
24
|
-
end
|
25
|
-
|
26
|
-
def docker_run_arguments
|
27
|
-
['-e', "LOCAL_USER_ID=#{::Process.uid}"]
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_config/yaml_file_node'
|
4
|
-
require 'eac_ruby_utils/core_ext'
|
5
|
-
require 'eac_ruby_utils/yaml'
|
6
|
-
require 'shellwords'
|
7
|
-
|
8
|
-
module Avm
|
9
|
-
module Sources
|
10
|
-
class Base
|
11
|
-
module Configuration
|
12
|
-
# @return [Array<String>, nil]
|
13
|
-
def read_configuration_as_shell_words(key)
|
14
|
-
configuration.entry(key).value.if_present do |v|
|
15
|
-
v.is_a?(::Enumerable) ? v.map(&:to_s) : ::Shellwords.split(v.to_s)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
private
|
20
|
-
|
21
|
-
# @return [EacConfig::YamlFileNode]
|
22
|
-
def configuration_uncached
|
23
|
-
::Avm::Sources::Configuration::FILENAMES.each do |filename|
|
24
|
-
configuration_with_filename(filename, true)
|
25
|
-
end
|
26
|
-
configuration_with_filename(::Avm::Sources::Configuration::FILENAMES.first, false)
|
27
|
-
end
|
28
|
-
|
29
|
-
# @return [EacConfig::YamlFileNode, nil]
|
30
|
-
def configuration_with_filename(filename, needs_exist)
|
31
|
-
file_path = path.join(filename)
|
32
|
-
return ::EacConfig::YamlFileNode.new(file_path) if !needs_exist || file_path.exist?
|
33
|
-
|
34
|
-
nil
|
35
|
-
end
|
36
|
-
|
37
|
-
# @return [Avm::Sources::Configuration]
|
38
|
-
def old_configuration_uncached
|
39
|
-
::Avm::Sources::Configuration.find_in_path(path) ||
|
40
|
-
::Avm::Sources::Configuration.temp_instance
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/instances/application'
|
4
|
-
require 'avm/instances/base'
|
5
|
-
|
6
|
-
module Avm
|
7
|
-
module Sources
|
8
|
-
class Base
|
9
|
-
module Instance
|
10
|
-
DEFAULT_INSTANCE_SUFFIX = 'dev'
|
11
|
-
|
12
|
-
def instance_suffix
|
13
|
-
DEFAULT_INSTANCE_SUFFIX
|
14
|
-
end
|
15
|
-
|
16
|
-
private
|
17
|
-
|
18
|
-
def application_uncached
|
19
|
-
::Avm::Instances::Application.new(path.basename)
|
20
|
-
end
|
21
|
-
|
22
|
-
def instance_uncached
|
23
|
-
::Avm::Instances::Base.new(application, DEFAULT_INSTANCE_SUFFIX)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
|
5
|
-
module Avm
|
6
|
-
module Sources
|
7
|
-
class Base
|
8
|
-
module Parent
|
9
|
-
# @return [Avm::Sources::Base]
|
10
|
-
def parent
|
11
|
-
parent_by_option || parent_by_search
|
12
|
-
end
|
13
|
-
|
14
|
-
# @return [Avm::Sources::Base]
|
15
|
-
def parent_by_option
|
16
|
-
options[OPTION_PARENT]
|
17
|
-
end
|
18
|
-
|
19
|
-
# @return [Avm::Sources::Base]
|
20
|
-
def parent_by_search
|
21
|
-
parent_path = path.parent
|
22
|
-
until parent_path.root?
|
23
|
-
::Avm::Registry.sources.detect_optional(parent_path).if_present { |v| return v }
|
24
|
-
parent_path = parent_path.parent
|
25
|
-
end
|
26
|
-
nil
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|