avm-tools 0.116.0 → 0.117.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/launcher/instances/settings.rb +7 -3
- data/lib/avm/projects/stereotypes.rb +2 -2
- data/lib/avm/ruby/bundler/incompatible_parser/depends_on.rb +1 -1
- data/lib/avm/ruby/bundler/incompatible_parser/gem_conflict.rb +1 -1
- data/lib/avm/ruby/bundler/incompatible_parser/in_gemfile.rb +1 -1
- data/lib/avm/ruby/bundler/incompatible_parser/version_requirement.rb +1 -1
- data/lib/avm/ruby/bundler/incompatible_parser.rb +1 -1
- data/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb +1 -1
- data/lib/avm/tools/runner/app_src/test.rb +2 -2
- data/lib/avm/tools/runner/app_src/version_bump.rb +4 -9
- data/lib/avm/tools/runner/git/deploy.rb +5 -5
- data/lib/avm/tools/runner/git/dirty_files.rb +1 -1
- data/lib/avm/tools/runner/git/revisions_test.rb +1 -1
- data/lib/avm/tools/runner/ruby/rubocop.rb +2 -2
- data/lib/avm/tools/version.rb +1 -1
- data/sub/avm/avm.gemspec +3 -3
- data/sub/avm/lib/avm/instances/base/auto_values/mailer.rb +2 -2
- data/sub/avm/lib/avm/instances/entry_keys.rb +2 -0
- data/sub/avm/lib/avm/registry/base.rb +2 -2
- data/sub/avm/lib/avm/rspec/shared_examples/not_in_avm_registry.rb +1 -1
- data/sub/avm/lib/avm/scms/base.rb +13 -0
- data/sub/avm/lib/avm/sources/base/configuration.rb +2 -1
- data/sub/avm/lib/avm/sources/base/parent.rb +31 -0
- data/sub/avm/lib/avm/sources/base.rb +4 -6
- data/sub/avm/lib/avm/sources/configuration/{_locale.rb → locale.rb} +5 -3
- data/sub/avm/lib/avm/sources/configuration/rubocop.rb +26 -0
- data/sub/avm/lib/avm/sources/configuration/tests.rb +29 -0
- data/sub/avm/lib/avm/sources/configuration.rb +5 -1
- data/sub/avm/lib/avm/sources/tests/builder.rb +1 -1
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb +1 -1
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build.rb +2 -2
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runner/build.rb +1 -1
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runner.rb +2 -2
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
- data/sub/avm-eac_generic_base0/avm-eac_generic_base0.gemspec +1 -1
- data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources/base/version_bump.rb +35 -0
- data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources/base.rb +4 -1
- data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/version.rb +1 -1
- data/sub/avm-eac_generic_base0/locale/en.yaml +6 -0
- data/sub/avm-eac_generic_base0/locale/pt-BR.yaml +6 -0
- data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +1 -1
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
- data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.sh +1 -1
- data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +1 -1
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/core_update.rb +3 -3
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/docker_image.rb +17 -2
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/Dockerfile.template +2 -8
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/Dockerfile_apache_setup +8 -0
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/start.sh.template +1 -1
- data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +2 -2
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/configured.rb +31 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/envvar.rb +17 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/gemfile.rb +41 -0
- data/{lib/avm/ruby → sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1}/rubocop.rb +2 -2
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/version_bump.rb +23 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb +11 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/tester.rb +1 -1
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update/sub_update.rb +1 -1
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb +0 -1
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
- data/sub/avm-files/avm-files.gemspec +1 -1
- data/sub/avm-files/lib/avm/files/appendable.rb +1 -1
- data/sub/avm-files/lib/avm/files/formatter/formats/ruby.rb +2 -2
- data/sub/avm-files/lib/avm/files/version.rb +1 -1
- data/sub/avm-git/lib/avm/git/scms/git_subrepo.rb +1 -3
- data/sub/avm-git/lib/avm/git/version.rb +1 -1
- data/sub/eac_cli/eac_cli.gemspec +1 -1
- data/sub/eac_cli/lib/eac_cli/old_configs/entry_reader.rb +1 -1
- data/sub/eac_cli/lib/eac_cli/old_configs/read_entry_options.rb +1 -1
- data/sub/eac_cli/lib/eac_cli/parser.rb +2 -2
- data/sub/eac_cli/lib/eac_cli/runner_with/help/builder.rb +1 -1
- data/sub/eac_cli/lib/eac_cli/runner_with/subcommands.rb +4 -4
- data/sub/eac_cli/lib/eac_cli/runner_with_set.rb +2 -2
- data/sub/eac_cli/lib/eac_cli/version.rb +1 -1
- data/sub/eac_config/eac_config.gemspec +1 -1
- data/sub/eac_config/lib/eac_config/entry.rb +1 -1
- data/sub/eac_config/lib/eac_config/envvars_node/entry.rb +1 -1
- data/sub/eac_config/lib/eac_config/paths_hash/node.rb +1 -1
- data/sub/eac_config/lib/eac_config/version.rb +1 -1
- data/sub/eac_fs/eac_fs.gemspec +1 -1
- data/sub/eac_fs/lib/eac_fs/version.rb +1 -1
- data/sub/eac_git/eac_git.gemspec +1 -1
- data/sub/eac_git/lib/eac_git/local/remote.rb +2 -2
- data/sub/eac_git/lib/eac_git/local.rb +1 -1
- data/sub/eac_git/lib/eac_git/version.rb +1 -1
- data/sub/eac_rest/eac_rest.gemspec +1 -1
- data/sub/eac_rest/lib/eac_rest/api.rb +14 -3
- data/sub/eac_rest/lib/eac_rest/request.rb +22 -1
- data/sub/eac_rest/lib/eac_rest/response.rb +41 -1
- data/sub/eac_rest/lib/eac_rest/version.rb +1 -1
- data/sub/eac_ruby_base0/eac_ruby_base0.gemspec +1 -1
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/application.rb +2 -2
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
- data/sub/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +1 -1
- data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/version_file.rb +2 -2
- data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +1 -1
- data/sub/eac_ruby_utils/eac_ruby_utils.gemspec +1 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/core_ext.rb +1 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/custom_format.rb +1 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem.rb +1 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry.rb +1 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +1 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb +16 -4
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/value.rb +12 -2
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/local_time_zone.rb +1 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/locales/from_all_gems.rb +4 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/locales/from_gem.rb +47 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/locales/module_i18n_translate.rb +74 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/locales.rb +9 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/method_class.rb +35 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/i18n_translate.rb +2 -25
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/method_class.rb +9 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/debug.rb +6 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/require_sub.rb +86 -33
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/on_clean_environment.rb +1 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp/{temp_spec.rb → directory_spec.rb} +0 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp_spec.rb +4 -4
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/listable_spec.rb +169 -106
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/method_class_spec.rb +46 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/options_consumer_spec.rb +52 -17
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/listable_spec.rb +5 -3
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/method_class_spec.rb +20 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/simple_cache_spec.rb +5 -3
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub_spec.rb +3 -3
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb +21 -18
- data/sub/eac_ruby_utils/spec/locales/pt-BR.yml +3 -0
- data/sub/eac_templates/eac_templates.gemspec +1 -1
- data/sub/eac_templates/lib/eac_templates/directory.rb +1 -1
- data/sub/eac_templates/lib/eac_templates/version.rb +1 -1
- metadata +42 -20
- data/lib/avm/projects/stereotypes/rails_application/update.rb +0 -14
- data/lib/avm/projects/stereotypes/ruby_gem/version_bump.rb +0 -60
- data/lib/avm/ruby/rubocop/_configured.rb +0 -29
- data/lib/avm/ruby/rubocop/_envvar.rb +0 -15
- data/lib/avm/ruby/rubocop/_gemfile.rb +0 -39
- data/sub/avm/lib/avm/sources/configuration/_rubocop.rb +0 -24
- data/sub/avm/lib/avm/sources/configuration/_tests.rb +0 -27
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/patches/i18n.rb +0 -7
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/patches.rb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aae509f1d4971fd8a6d39a9f20cc4a3dab9fd28267c333ffe521cba9252f20bb
|
4
|
+
data.tar.gz: f27d6bd59c10b9638f1f42b173d38a53a677b1d8de4b1a01c63e170ed1ed362f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea73fcc793b05f0265396c36a592969b9f60c6ccb8a0e7526f7f5e12f5c7b58688489c11cda94b7e17ab8a0430029dccca11d3a0b799a49e6c65d11c5f200b8a
|
7
|
+
data.tar.gz: bf13a36e7cdf500a7538c75531b108b7f09ef76dfd1b5a4ceb102cc32f2c2b76026df875c593de2fa6c240b3b5fccc43b9d7a989941dab6b15e61a8b142ee503
|
@@ -23,7 +23,7 @@ module Avm
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def publishable?
|
26
|
-
|
26
|
+
publishable_value ? true : false
|
27
27
|
end
|
28
28
|
|
29
29
|
def stereotype_publishable?(stereotype)
|
@@ -39,11 +39,15 @@ module Avm
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def parse_publishable_value(value, hash_to_true)
|
42
|
-
return value.with_indifferent_access if
|
42
|
+
return value.with_indifferent_access if parse_publishable_value_hash?(value, hash_to_true)
|
43
43
|
return true if value.nil? || value == true
|
44
44
|
return false if value == false
|
45
45
|
|
46
|
-
|
46
|
+
value ? true : false
|
47
|
+
end
|
48
|
+
|
49
|
+
def parse_publishable_value_hash?(value, hash_to_true)
|
50
|
+
!hash_to_true && value.is_a?(::Hash)
|
47
51
|
end
|
48
52
|
end
|
49
53
|
end
|
@@ -11,8 +11,8 @@ module Avm
|
|
11
11
|
class << self
|
12
12
|
def list
|
13
13
|
@list ||= constants.map { |c| const_get(c) }
|
14
|
-
|
15
|
-
|
14
|
+
.select { |c| c.included_modules.include?(Avm::Projects::Stereotype) }
|
15
|
+
.freeze
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -9,7 +9,7 @@ module Avm
|
|
9
9
|
class IncompatibleParser
|
10
10
|
class DependsOn < ::Avm::Ruby::Bundler::IncompatibleParser::LineParserBase
|
11
11
|
LINE_PARSER = /(.+) was resolved to (.+), which depends on/
|
12
|
-
|
12
|
+
.to_parser { |m| new(m[1], m[2]) }
|
13
13
|
|
14
14
|
common_constructor :gem_name, :version do
|
15
15
|
self.version = ::Gem::Version.new(version)
|
@@ -9,7 +9,7 @@ module Avm
|
|
9
9
|
class IncompatibleParser
|
10
10
|
class GemConflict < ::Avm::Ruby::Bundler::IncompatibleParser::LineParserBase
|
11
11
|
LINE_PARSER = /Bundler could not find compatible versions for gem "(.+)":/
|
12
|
-
|
12
|
+
.to_parser { |m| new(m[1]) }
|
13
13
|
|
14
14
|
enable_simple_cache
|
15
15
|
common_constructor :gem_name
|
@@ -9,7 +9,7 @@ module Avm
|
|
9
9
|
class IncompatibleParser
|
10
10
|
class VersionRequirement < ::Avm::Ruby::Bundler::IncompatibleParser::LineParserBase
|
11
11
|
LINE_PARSER = /\A([a-z][a-z_0-9]*)(?: \((.+)\))?\z/
|
12
|
-
|
12
|
+
.to_parser { |m| new(m[1], m[2]) }
|
13
13
|
|
14
14
|
enable_simple_cache
|
15
15
|
attr_accessor :stack
|
@@ -29,7 +29,7 @@ module Avm
|
|
29
29
|
def git_continue_run(command)
|
30
30
|
infom "\"#{command}\" --continue..."
|
31
31
|
cmd = instance.git_repo.command(command, '--continue')
|
32
|
-
|
32
|
+
.envvar('GIT_EDITOR', 'true')
|
33
33
|
return unless !cmd.system && !conflict?
|
34
34
|
|
35
35
|
fatal_error "\"#{cmd}\" failed and there is no conflict"
|
@@ -71,8 +71,8 @@ module Avm
|
|
71
71
|
|
72
72
|
def test_builder
|
73
73
|
r = ::Avm::Sources::Tests::Builder.new(runner_context.call(:subject))
|
74
|
-
|
75
|
-
|
74
|
+
.include_main(include_main?)
|
75
|
+
.include_subs(include_subs?)
|
76
76
|
parsed.source_id.inject(r) { |a, e| a.include_id(e) }
|
77
77
|
end
|
78
78
|
|
@@ -8,14 +8,13 @@ module Avm
|
|
8
8
|
class Runner
|
9
9
|
class AppSrc
|
10
10
|
class VersionBump
|
11
|
-
runner_with :help do
|
11
|
+
runner_with :help, :confirmation do
|
12
12
|
desc 'Bump version of a local project.'
|
13
13
|
arg_opt '-n', '--new', 'Set new version.'
|
14
14
|
arg_opt '-s', '--segment', 'Increment de <segment>-th segment (Left-most is 0)'
|
15
15
|
bool_opt '-M', '--major', 'Same as --segment=0.'
|
16
16
|
bool_opt '-m', '--minor', 'Same as --segment=1.'
|
17
17
|
bool_opt '-p', '--patch', 'Same as --segment=2.'
|
18
|
-
bool_opt '-y', '--yes', 'Bump without confirmation.'
|
19
18
|
end
|
20
19
|
|
21
20
|
def run
|
@@ -26,7 +25,7 @@ module Avm
|
|
26
25
|
def run_version_changed
|
27
26
|
infom 'Version changed'
|
28
27
|
if confirm?
|
29
|
-
runner_context.call(:
|
28
|
+
runner_context.call(:subject).version_bump(target_version)
|
30
29
|
success 'Bumped'
|
31
30
|
else
|
32
31
|
fatal_error 'Bump unconfirmed'
|
@@ -38,17 +37,13 @@ module Avm
|
|
38
37
|
end
|
39
38
|
|
40
39
|
def start_banner
|
41
|
-
runner_context.call(:
|
40
|
+
infov 'Instance', runner_context.call(:subject)
|
42
41
|
infov 'Current version', current_version.if_present('-')
|
43
42
|
infov 'Target version', target_version.if_present('-')
|
44
43
|
end
|
45
44
|
|
46
|
-
def confirm?
|
47
|
-
parsed.yes? || input('Confirm version bump?', bool: true)
|
48
|
-
end
|
49
|
-
|
50
45
|
def current_version_uncached
|
51
|
-
runner_context.call(:
|
46
|
+
runner_context.call(:subject).if_respond('version')
|
52
47
|
end
|
53
48
|
|
54
49
|
def target_version_uncached
|
@@ -78,15 +78,15 @@ module Avm
|
|
78
78
|
|
79
79
|
def deploy
|
80
80
|
::Avm::Git::Commit.new(git, reference_sha1)
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
81
|
+
.deploy_to_url(target_url)
|
82
|
+
.append_templatized_directories(appended_directories)
|
83
|
+
.variables_source_set(variables_source)
|
84
|
+
.run
|
85
85
|
end
|
86
86
|
|
87
87
|
def target_url
|
88
88
|
parsed.target_url.if_present { |v| return v }
|
89
|
-
instance.if_present { |v| return v.read_entry(
|
89
|
+
instance.if_present { |v| return v.read_entry(::Avm::Instances::EntryKeys::FS_URL) }
|
90
90
|
nil
|
91
91
|
end
|
92
92
|
|
@@ -51,7 +51,7 @@ module Avm
|
|
51
51
|
|
52
52
|
def revisions_uncached
|
53
53
|
runner_context.call(:git).execute!('log', '--pretty=format:%H', 'origin/master..HEAD')
|
54
|
-
|
54
|
+
.each_line.map(&:strip).reverse.map do |sha1|
|
55
55
|
::Avm::Git::RevisionTest.new(runner_context.call(:git), sha1, test_revision_options)
|
56
56
|
end
|
57
57
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/tools/core_ext'
|
4
|
-
require 'avm/
|
4
|
+
require 'avm/eac_ruby_base1/rubocop'
|
5
5
|
|
6
6
|
module Avm
|
7
7
|
module Tools
|
@@ -15,7 +15,7 @@ module Avm
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def run
|
18
|
-
::Avm::
|
18
|
+
::Avm::EacRubyBase1::Rubocop.new(path, parsed.rubocop_args).run
|
19
19
|
end
|
20
20
|
|
21
21
|
private
|
data/lib/avm/tools/version.rb
CHANGED
data/sub/avm/avm.gemspec
CHANGED
@@ -15,12 +15,12 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.add_dependency 'eac_cli', '~> 0.23', '>= 0.23.1'
|
16
16
|
s.add_dependency 'eac_docker', '~> 0.3'
|
17
17
|
s.add_dependency 'eac_git', '~> 0.6'
|
18
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
18
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.95'
|
19
19
|
s.add_dependency 'eac_templates', '~> 0.1', '>= 0.1.1'
|
20
20
|
s.add_dependency 'filesize', '~> 0.2'
|
21
21
|
s.add_dependency 'htmlbeautifier', '~> 1.3', '>= 1.3.1'
|
22
22
|
s.add_dependency 'minitar', '~> 0.9'
|
23
23
|
|
24
|
-
s.add_development_dependency 'aranha-parsers', '~> 0.
|
25
|
-
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.
|
24
|
+
s.add_development_dependency 'aranha-parsers', '~> 0.14', '~> 0.14.1'
|
25
|
+
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
26
26
|
end
|
@@ -9,8 +9,8 @@ module Avm
|
|
9
9
|
module AutoValues
|
10
10
|
module Mailer
|
11
11
|
::Avm::Instances::EntryKeys.all.select { |c| c.to_s.start_with?('mailer.') }
|
12
|
-
|
13
|
-
|
12
|
+
.reject { |c| c == ::Avm::Instances::EntryKeys::MAILER_ID }
|
13
|
+
.each do |mailer_key|
|
14
14
|
define_method ::Avm::Instances::Entry.auto_value_method_name(mailer_key) do
|
15
15
|
mailer_auto_common(mailer_key)
|
16
16
|
end
|
@@ -43,8 +43,10 @@ module Avm
|
|
43
43
|
|
44
44
|
{
|
45
45
|
'' => %w[data_fs_path fs_path host_id name source_instance_id],
|
46
|
+
admin: %w[username password api_key],
|
46
47
|
database: %w[id hostname limit name password port system timeout username extra],
|
47
48
|
docker: %w[registry],
|
49
|
+
fs: %w[url],
|
48
50
|
mailer: {
|
49
51
|
'' => %w[id from reply_to],
|
50
52
|
smtp: %w[address port domain username password authentication openssl_verify_mode
|
@@ -17,7 +17,7 @@ module Avm
|
|
17
17
|
|
18
18
|
def detect_optional(*registered_initialize_args)
|
19
19
|
registered_modules.reverse.lazy.map { |klass| klass.new(*registered_initialize_args) }
|
20
|
-
|
20
|
+
.find(&:valid?)
|
21
21
|
end
|
22
22
|
|
23
23
|
def provider_module_suffix
|
@@ -40,7 +40,7 @@ module Avm
|
|
40
40
|
|
41
41
|
def registered_modules_uncached
|
42
42
|
registered_gems.flat_map { |registry| modules_from_registry(registry) }
|
43
|
-
|
43
|
+
.select { |v| valid_registered_module?(v) }.uniq
|
44
44
|
end
|
45
45
|
|
46
46
|
def modules_from_registry(registry)
|
@@ -4,7 +4,7 @@ require 'avm/registry'
|
|
4
4
|
|
5
5
|
::RSpec.shared_examples 'not_in_avm_registry' do |registry_method = nil|
|
6
6
|
registry_method.if_present(::Avm::Registry.registries) { |v| [::Avm::Registry.send(v)] }
|
7
|
-
|
7
|
+
.each do |registry|
|
8
8
|
context "when registry is #{registry}" do
|
9
9
|
it 'is not in the avm registry' do
|
10
10
|
expect(registry.registered_modules).not_to include(described_class)
|
@@ -6,6 +6,7 @@ module Avm
|
|
6
6
|
module Scms
|
7
7
|
class Base
|
8
8
|
enable_abstract_methods
|
9
|
+
enable_simple_cache
|
9
10
|
abstract_methods :update, :valid?
|
10
11
|
common_constructor :path do
|
11
12
|
self.path = path.to_pathname
|
@@ -28,6 +29,18 @@ module Avm
|
|
28
29
|
def to_s
|
29
30
|
name
|
30
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
|
31
44
|
end
|
32
45
|
end
|
33
46
|
end
|
@@ -29,7 +29,8 @@ module Avm
|
|
29
29
|
|
30
30
|
# @return [Avm::Sources::Configuration]
|
31
31
|
def old_configuration_uncached
|
32
|
-
::Avm::Sources::Configuration.find_in_path(path)
|
32
|
+
::Avm::Sources::Configuration.find_in_path(path) ||
|
33
|
+
::Avm::Sources::Configuration.temp_instance
|
33
34
|
end
|
34
35
|
end
|
35
36
|
end
|
@@ -0,0 +1,31 @@
|
|
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
|
@@ -21,12 +21,6 @@ module Avm
|
|
21
21
|
abstract_methods :update, :valid?
|
22
22
|
|
23
23
|
delegate :locale, to: :old_configuration
|
24
|
-
delegate :to_s, to: :path
|
25
|
-
|
26
|
-
# @return [Avm::Sources::Base]
|
27
|
-
def parent
|
28
|
-
options[OPTION_PARENT]
|
29
|
-
end
|
30
24
|
|
31
25
|
# @return [Pathname]
|
32
26
|
def relative_path
|
@@ -35,6 +29,10 @@ module Avm
|
|
35
29
|
path.relative_path_from(parent.path)
|
36
30
|
end
|
37
31
|
|
32
|
+
def to_s
|
33
|
+
"#{self.class}[#{path}]"
|
34
|
+
end
|
35
|
+
|
38
36
|
# @return [Enumerable<Avm::Sources::Base>]
|
39
37
|
def subs
|
40
38
|
scm.subs.map { |subrepo| ::Avm::Registry.sources.detect(subrepo.path, parent: self) }
|
@@ -6,10 +6,12 @@ require 'i18n'
|
|
6
6
|
module Avm
|
7
7
|
module Sources
|
8
8
|
class Configuration < ::EacConfig::OldConfigs
|
9
|
-
|
9
|
+
module Locale
|
10
|
+
LOCALE_KEY = :locale
|
10
11
|
|
11
|
-
|
12
|
-
|
12
|
+
def locale
|
13
|
+
read_entry(LOCALE_KEY) || ::I18n.default_locale
|
14
|
+
end
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Avm
|
4
|
+
module Sources
|
5
|
+
class Configuration < ::EacConfig::OldConfigs
|
6
|
+
module Rubocop
|
7
|
+
RUBOCOP_COMMAND_KEY = 'ruby.rubocop.command'
|
8
|
+
RUBOCOP_GEMFILE_KEY = 'ruby.rubocop.gemfile'
|
9
|
+
|
10
|
+
def rubocop_command
|
11
|
+
read_command(RUBOCOP_COMMAND_KEY)
|
12
|
+
end
|
13
|
+
|
14
|
+
def rubocop_gemfile
|
15
|
+
gemfile_path = read_entry(RUBOCOP_GEMFILE_KEY)
|
16
|
+
return nil if gemfile_path.blank?
|
17
|
+
|
18
|
+
gemfile_path = gemfile_path.to_pathname.expand_path(storage_path.parent)
|
19
|
+
return gemfile_path if gemfile_path.file?
|
20
|
+
|
21
|
+
raise "Gemfile path \"#{gemfile_path}\" does not exist or is not a file"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/patches/eac_ruby_gems_utils/gem'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Sources
|
7
|
+
class Configuration < ::EacConfig::OldConfigs
|
8
|
+
module Tests
|
9
|
+
BUNDLE_TEST_COMMAND_KEY = 'test.bundle_command'
|
10
|
+
TEST_COMMAND_KEY = 'test.command'
|
11
|
+
|
12
|
+
def any_test_command
|
13
|
+
bundle_test_command || test_command
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_command
|
17
|
+
read_command(TEST_COMMAND_KEY)
|
18
|
+
end
|
19
|
+
|
20
|
+
def bundle_test_command
|
21
|
+
read_entry(BUNDLE_TEST_COMMAND_KEY).if_present do |v|
|
22
|
+
args = v.is_a?(::Enumerable) ? v.map(&:to_s) : ::Shellwords.split(v)
|
23
|
+
::EacRubyGemsUtils::Gem.new(::File.dirname(storage_path)).bundle(*args).chdir_root
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -7,7 +7,7 @@ require 'yaml'
|
|
7
7
|
module Avm
|
8
8
|
module Sources
|
9
9
|
class Configuration < ::EacConfig::OldConfigs
|
10
|
-
require_sub __FILE__
|
10
|
+
require_sub __FILE__, include_modules: true
|
11
11
|
|
12
12
|
FILENAMES = %w[.avm.yml .avm.yaml].freeze
|
13
13
|
|
@@ -28,6 +28,10 @@ module Avm
|
|
28
28
|
nil
|
29
29
|
end
|
30
30
|
|
31
|
+
def temp_instance
|
32
|
+
new(::Tempfile.new(['.avm', '.yaml']))
|
33
|
+
end
|
34
|
+
|
31
35
|
private
|
32
36
|
|
33
37
|
def internal_find_path(absolute_pathname)
|
@@ -33,7 +33,7 @@ module Avm
|
|
33
33
|
# @return [Array<Avm::Sources::Tests::Single>]
|
34
34
|
def available_units
|
35
35
|
@available_units ||= ([main_source] + main_source.subs)
|
36
|
-
|
36
|
+
.map { |a_source| create_unit(a_source) }
|
37
37
|
end
|
38
38
|
|
39
39
|
def available_units_from_main
|
data/sub/avm/lib/avm/version.rb
CHANGED
@@ -25,7 +25,7 @@ module Avm
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def default_target_directory
|
28
|
-
project.
|
28
|
+
project.path.join('build')
|
29
29
|
end
|
30
30
|
|
31
31
|
def target_directory
|
@@ -36,7 +36,7 @@ module Avm
|
|
36
36
|
|
37
37
|
def source_files_uncached
|
38
38
|
r = []
|
39
|
-
project.
|
39
|
+
project.path.children.each do |child|
|
40
40
|
next unless SOURCE_EXTNAMES.include?(child.extname)
|
41
41
|
|
42
42
|
r << ::Avm::EacAsciidoctorBase0::Sources::Build::File.new(self, child.basename)
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/sources/base'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacGenericBase0
|
8
|
+
module Sources
|
9
|
+
class Base < ::Avm::Sources::Base
|
10
|
+
module VersionBump
|
11
|
+
def after_sub_version_bump_do_changes
|
12
|
+
# Do nothing
|
13
|
+
end
|
14
|
+
|
15
|
+
# @return [Avm::Scms::Commit, nil]
|
16
|
+
def version_bump(target_version)
|
17
|
+
scm.commit_if_change(version_bump_commit_message(target_version)) do
|
18
|
+
version_bump_do_changes(target_version)
|
19
|
+
parent.if_present(&:after_sub_version_bump_do_changes)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# @return [String]
|
24
|
+
def version_bump_commit_message(target_version)
|
25
|
+
i18n_translate(__method__, version: target_version, __locale: locale)
|
26
|
+
end
|
27
|
+
|
28
|
+
def version_bump_do_changes(_target_version)
|
29
|
+
raise_abstract_method(__METHOD__)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -8,13 +8,16 @@ module Avm
|
|
8
8
|
module EacGenericBase0
|
9
9
|
module Sources
|
10
10
|
class Base < ::Avm::Sources::Base
|
11
|
+
require_sub __FILE__, include_modules: true
|
12
|
+
enable_abstract_methods
|
13
|
+
|
11
14
|
# @return [Avm::EacGenericBase0::Sources::Tester]
|
12
15
|
def tester_class
|
13
16
|
Avm::EacGenericBase0::Sources::Tester
|
14
17
|
end
|
15
18
|
|
16
19
|
def valid?
|
17
|
-
path.
|
20
|
+
::Avm::Registry.scms.detect_optional(path).present?
|
18
21
|
end
|
19
22
|
end
|
20
23
|
end
|