avm-tools 0.116.0 → 0.117.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avm/launcher/instances/settings.rb +7 -3
  3. data/lib/avm/projects/stereotypes.rb +2 -2
  4. data/lib/avm/ruby/bundler/incompatible_parser/depends_on.rb +1 -1
  5. data/lib/avm/ruby/bundler/incompatible_parser/gem_conflict.rb +1 -1
  6. data/lib/avm/ruby/bundler/incompatible_parser/in_gemfile.rb +1 -1
  7. data/lib/avm/ruby/bundler/incompatible_parser/version_requirement.rb +1 -1
  8. data/lib/avm/ruby/bundler/incompatible_parser.rb +1 -1
  9. data/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb +1 -1
  10. data/lib/avm/tools/runner/app_src/test.rb +2 -2
  11. data/lib/avm/tools/runner/app_src/version_bump.rb +4 -9
  12. data/lib/avm/tools/runner/git/deploy.rb +5 -5
  13. data/lib/avm/tools/runner/git/dirty_files.rb +1 -1
  14. data/lib/avm/tools/runner/git/revisions_test.rb +1 -1
  15. data/lib/avm/tools/runner/ruby/rubocop.rb +2 -2
  16. data/lib/avm/tools/version.rb +1 -1
  17. data/sub/avm/avm.gemspec +3 -3
  18. data/sub/avm/lib/avm/instances/base/auto_values/mailer.rb +2 -2
  19. data/sub/avm/lib/avm/instances/entry_keys.rb +2 -0
  20. data/sub/avm/lib/avm/registry/base.rb +2 -2
  21. data/sub/avm/lib/avm/rspec/shared_examples/not_in_avm_registry.rb +1 -1
  22. data/sub/avm/lib/avm/scms/base.rb +13 -0
  23. data/sub/avm/lib/avm/sources/base/configuration.rb +2 -1
  24. data/sub/avm/lib/avm/sources/base/parent.rb +31 -0
  25. data/sub/avm/lib/avm/sources/base.rb +4 -6
  26. data/sub/avm/lib/avm/sources/configuration/{_locale.rb → locale.rb} +5 -3
  27. data/sub/avm/lib/avm/sources/configuration/rubocop.rb +26 -0
  28. data/sub/avm/lib/avm/sources/configuration/tests.rb +29 -0
  29. data/sub/avm/lib/avm/sources/configuration.rb +5 -1
  30. data/sub/avm/lib/avm/sources/tests/builder.rb +1 -1
  31. data/sub/avm/lib/avm/version.rb +1 -1
  32. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb +1 -1
  33. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build.rb +2 -2
  34. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runner/build.rb +1 -1
  35. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runner.rb +2 -2
  36. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
  37. data/sub/avm-eac_generic_base0/avm-eac_generic_base0.gemspec +1 -1
  38. data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources/base/version_bump.rb +35 -0
  39. data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources/base.rb +4 -1
  40. data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/version.rb +1 -1
  41. data/sub/avm-eac_generic_base0/locale/en.yaml +6 -0
  42. data/sub/avm-eac_generic_base0/locale/pt-BR.yaml +6 -0
  43. data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +1 -1
  44. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
  45. data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.sh +1 -1
  46. data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +1 -1
  47. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/core_update.rb +3 -3
  48. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/docker_image.rb +17 -2
  49. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
  50. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/Dockerfile.template +2 -8
  51. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/Dockerfile_apache_setup +8 -0
  52. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/start.sh.template +1 -1
  53. data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +2 -2
  54. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/configured.rb +31 -0
  55. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/envvar.rb +17 -0
  56. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/gemfile.rb +41 -0
  57. data/{lib/avm/ruby → sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1}/rubocop.rb +2 -2
  58. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/version_bump.rb +23 -0
  59. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb +11 -0
  60. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/tester.rb +1 -1
  61. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update/sub_update.rb +1 -1
  62. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb +0 -1
  63. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
  64. data/sub/avm-files/avm-files.gemspec +1 -1
  65. data/sub/avm-files/lib/avm/files/appendable.rb +1 -1
  66. data/sub/avm-files/lib/avm/files/formatter/formats/ruby.rb +2 -2
  67. data/sub/avm-files/lib/avm/files/version.rb +1 -1
  68. data/sub/avm-git/lib/avm/git/scms/git_subrepo.rb +1 -3
  69. data/sub/avm-git/lib/avm/git/version.rb +1 -1
  70. data/sub/eac_cli/eac_cli.gemspec +1 -1
  71. data/sub/eac_cli/lib/eac_cli/old_configs/entry_reader.rb +1 -1
  72. data/sub/eac_cli/lib/eac_cli/old_configs/read_entry_options.rb +1 -1
  73. data/sub/eac_cli/lib/eac_cli/parser.rb +2 -2
  74. data/sub/eac_cli/lib/eac_cli/runner_with/help/builder.rb +1 -1
  75. data/sub/eac_cli/lib/eac_cli/runner_with/subcommands.rb +4 -4
  76. data/sub/eac_cli/lib/eac_cli/runner_with_set.rb +2 -2
  77. data/sub/eac_cli/lib/eac_cli/version.rb +1 -1
  78. data/sub/eac_config/eac_config.gemspec +1 -1
  79. data/sub/eac_config/lib/eac_config/entry.rb +1 -1
  80. data/sub/eac_config/lib/eac_config/envvars_node/entry.rb +1 -1
  81. data/sub/eac_config/lib/eac_config/paths_hash/node.rb +1 -1
  82. data/sub/eac_config/lib/eac_config/version.rb +1 -1
  83. data/sub/eac_fs/eac_fs.gemspec +1 -1
  84. data/sub/eac_fs/lib/eac_fs/version.rb +1 -1
  85. data/sub/eac_git/eac_git.gemspec +1 -1
  86. data/sub/eac_git/lib/eac_git/local/remote.rb +2 -2
  87. data/sub/eac_git/lib/eac_git/local.rb +1 -1
  88. data/sub/eac_git/lib/eac_git/version.rb +1 -1
  89. data/sub/eac_rest/eac_rest.gemspec +1 -1
  90. data/sub/eac_rest/lib/eac_rest/api.rb +14 -3
  91. data/sub/eac_rest/lib/eac_rest/request.rb +22 -1
  92. data/sub/eac_rest/lib/eac_rest/response.rb +41 -1
  93. data/sub/eac_rest/lib/eac_rest/version.rb +1 -1
  94. data/sub/eac_ruby_base0/eac_ruby_base0.gemspec +1 -1
  95. data/sub/eac_ruby_base0/lib/eac_ruby_base0/application.rb +2 -2
  96. data/sub/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
  97. data/sub/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +1 -1
  98. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/version_file.rb +2 -2
  99. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +1 -1
  100. data/sub/eac_ruby_utils/eac_ruby_utils.gemspec +1 -1
  101. data/sub/eac_ruby_utils/lib/eac_ruby_utils/core_ext.rb +1 -0
  102. data/sub/eac_ruby_utils/lib/eac_ruby_utils/custom_format.rb +1 -1
  103. data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem.rb +1 -1
  104. data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry.rb +1 -1
  105. data/sub/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +1 -1
  106. data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb +16 -4
  107. data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/value.rb +12 -2
  108. data/sub/eac_ruby_utils/lib/eac_ruby_utils/local_time_zone.rb +1 -1
  109. data/sub/eac_ruby_utils/lib/eac_ruby_utils/locales/from_all_gems.rb +4 -0
  110. data/sub/eac_ruby_utils/lib/eac_ruby_utils/locales/from_gem.rb +47 -0
  111. data/sub/eac_ruby_utils/lib/eac_ruby_utils/locales/module_i18n_translate.rb +74 -0
  112. data/sub/eac_ruby_utils/lib/eac_ruby_utils/locales.rb +9 -0
  113. data/sub/eac_ruby_utils/lib/eac_ruby_utils/method_class.rb +35 -0
  114. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/i18n_translate.rb +2 -25
  115. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/method_class.rb +9 -0
  116. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/debug.rb +6 -0
  117. data/sub/eac_ruby_utils/lib/eac_ruby_utils/require_sub.rb +86 -33
  118. data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/on_clean_environment.rb +1 -1
  119. data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  120. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp/{temp_spec.rb → directory_spec.rb} +0 -0
  121. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp_spec.rb +4 -4
  122. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/listable_spec.rb +169 -106
  123. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/method_class_spec.rb +46 -0
  124. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/options_consumer_spec.rb +52 -17
  125. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/listable_spec.rb +5 -3
  126. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/method_class_spec.rb +20 -0
  127. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/simple_cache_spec.rb +5 -3
  128. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub_spec.rb +3 -3
  129. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb +21 -18
  130. data/sub/eac_ruby_utils/spec/locales/pt-BR.yml +3 -0
  131. data/sub/eac_templates/eac_templates.gemspec +1 -1
  132. data/sub/eac_templates/lib/eac_templates/directory.rb +1 -1
  133. data/sub/eac_templates/lib/eac_templates/version.rb +1 -1
  134. metadata +42 -20
  135. data/lib/avm/projects/stereotypes/rails_application/update.rb +0 -14
  136. data/lib/avm/projects/stereotypes/ruby_gem/version_bump.rb +0 -60
  137. data/lib/avm/ruby/rubocop/_configured.rb +0 -29
  138. data/lib/avm/ruby/rubocop/_envvar.rb +0 -15
  139. data/lib/avm/ruby/rubocop/_gemfile.rb +0 -39
  140. data/sub/avm/lib/avm/sources/configuration/_rubocop.rb +0 -24
  141. data/sub/avm/lib/avm/sources/configuration/_tests.rb +0 -27
  142. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/patches/i18n.rb +0 -7
  143. 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: 27716dd4266fe2074f32cc46de1d3d4b0a83612a50e4794f9948523d3ed6bad5
4
- data.tar.gz: 97d712f91c0adbeacedd67674ae108d9f48fd2db800df50696625a7d81bd95f3
3
+ metadata.gz: aae509f1d4971fd8a6d39a9f20cc4a3dab9fd28267c333ffe521cba9252f20bb
4
+ data.tar.gz: f27d6bd59c10b9638f1f42b173d38a53a677b1d8de4b1a01c63e170ed1ed362f
5
5
  SHA512:
6
- metadata.gz: ba1854580f3fd1cbda82b94422e8feffde990f8f8ec4ec5e789f7e565536502f581a9e6da694a2eb04c76da27916b6bbd8504dc6663e8a540aae7e8517941256
7
- data.tar.gz: fc5000e7db1db0c41cda3768665ce4bd08846a81ba7c7f8d5b8c8e014d79fc28bf99a6d0fa5ba75d7b2d8b3be360c2dd13d18321cdb0b1789972f84e89616d60
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
- !!publishable_value
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 !hash_to_true && value.is_a?(::Hash)
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
- !!value
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
- .select { |c| c.included_modules.include?(Avm::Projects::Stereotype) }
15
- .freeze
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
- .to_parser { |m| new(m[1], m[2]) }
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
- .to_parser { |m| new(m[1]) }
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 InGemfile < ::Avm::Ruby::Bundler::IncompatibleParser::LineParserBase
11
11
  LINE_PARSER = /In Gemfile:/
12
- .to_parser { |_m| new }
12
+ .to_parser { |_m| new }
13
13
 
14
14
  common_constructor
15
15
  end
@@ -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
- .to_parser { |m| new(m[1], m[2]) }
12
+ .to_parser { |m| new(m[1], m[2]) }
13
13
 
14
14
  enable_simple_cache
15
15
  attr_accessor :stack
@@ -13,7 +13,7 @@ module Avm
13
13
 
14
14
  def initialize(path)
15
15
  @gems_in_conflict = ::Avm::Ruby::Bundler::IncompatibleParser::LineBuffer
16
- .from_file(path).gems_in_conflict.freeze
16
+ .from_file(path).gems_in_conflict.freeze
17
17
  end
18
18
 
19
19
  def data
@@ -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
- .envvar('GIT_EDITOR', 'true')
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
- .include_main(include_main?)
75
- .include_subs(include_subs?)
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(:instance).run_job(:version_bump, target_version)
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(:instance_banner)
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(:instance).if_respond('version')
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
- .deploy_to_url(target_url)
82
- .append_templatized_directories(appended_directories)
83
- .variables_source_set(variables_source)
84
- .run
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('fs.url') }
89
+ instance.if_present { |v| return v.read_entry(::Avm::Instances::EntryKeys::FS_URL) }
90
90
  nil
91
91
  end
92
92
 
@@ -10,7 +10,7 @@ module Avm
10
10
  DEFAULT_FORMAT = '%p'
11
11
  FIELDS = {
12
12
  i: :index, w: :worktree, p: :path, a: :absolute_path
13
- }.map { |k, v| ["%#{k}", v] }.to_h
13
+ }.transform_keys { |k| "%#{k}" }
14
14
 
15
15
  runner_with :help do
16
16
  desc 'Lists dirty files in Git repository.'
@@ -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
- .each_line.map(&:strip).reverse.map do |sha1|
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/ruby/rubocop'
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::Ruby::Rubocop.new(path, parsed.rubocop_args).run
18
+ ::Avm::EacRubyBase1::Rubocop.new(path, parsed.rubocop_args).run
19
19
  end
20
20
 
21
21
  private
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.116.0'
5
+ VERSION = '0.117.0'
6
6
  end
7
7
  end
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.80'
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.7', '>= 0.7.2'
25
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
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
- .reject { |c| c == ::Avm::Instances::EntryKeys::MAILER_ID }
13
- .each do |mailer_key|
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
- .find(&:valid?)
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
- .select { |v| valid_registered_module?(v) }.uniq
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
- .each do |registry|
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
- LOCALE_KEY = :locale
9
+ module Locale
10
+ LOCALE_KEY = :locale
10
11
 
11
- def locale
12
- read_entry(LOCALE_KEY) || ::I18n.default_locale
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
- .map { |a_source| create_unit(a_source) }
36
+ .map { |a_source| create_unit(a_source) }
37
37
  end
38
38
 
39
39
  def available_units_from_main
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avm
4
- VERSION = '0.17.0'
4
+ VERSION = '0.19.0'
5
5
  end
@@ -17,7 +17,7 @@ module Avm
17
17
  end
18
18
 
19
19
  def source_path
20
- build.project.root.join(subpath)
20
+ build.project.path.join(subpath)
21
21
  end
22
22
 
23
23
  def target_path
@@ -25,7 +25,7 @@ module Avm
25
25
  end
26
26
 
27
27
  def default_target_directory
28
- project.root.join('build')
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.root.children.each do |child|
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)
@@ -29,7 +29,7 @@ module Avm
29
29
  end
30
30
 
31
31
  def default_target_directory
32
- runner_context.call(:project).root.join('build')
32
+ runner_context.call(:project).path.join('build')
33
33
  end
34
34
 
35
35
  def open
@@ -15,8 +15,8 @@ module Avm
15
15
  end
16
16
 
17
17
  def project_banner
18
- infov 'Project', project.name
19
- infov 'Path', project.root
18
+ infov 'Project', project.application.name
19
+ infov 'Path', project.path
20
20
  end
21
21
 
22
22
  private
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacAsciidoctorBase0
5
- VERSION = '0.3.3'
5
+ VERSION = '0.3.4'
6
6
  end
7
7
  end
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib}/**/*']
14
14
 
15
- s.add_dependency 'avm', '~> 0.10'
15
+ s.add_dependency 'avm', '~> 0.19'
16
16
  s.add_dependency 'eac_ruby_utils', '~> 0.80'
17
17
 
18
18
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.4'
@@ -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.directory?
20
+ ::Avm::Registry.scms.detect_optional(path).present?
18
21
  end
19
22
  end
20
23
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacGenericBase0
5
- VERSION = '0.1.1'
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end