avm-tools 0.116.1 → 0.116.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) 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/git/deploy.rb +4 -4
  12. data/lib/avm/tools/runner/git/dirty_files.rb +1 -1
  13. data/lib/avm/tools/runner/git/revisions_test.rb +1 -1
  14. data/lib/avm/tools/runner/ruby/rubocop.rb +2 -2
  15. data/lib/avm/tools/version.rb +1 -1
  16. data/sub/avm/avm.gemspec +2 -2
  17. data/sub/avm/lib/avm/instances/base/auto_values/mailer.rb +2 -2
  18. data/sub/avm/lib/avm/registry/base.rb +2 -2
  19. data/sub/avm/lib/avm/rspec/shared_examples/not_in_avm_registry.rb +1 -1
  20. data/sub/avm/lib/avm/sources/tests/builder.rb +1 -1
  21. data/sub/avm/lib/avm/version.rb +1 -1
  22. data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +1 -1
  23. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
  24. data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.sh +1 -1
  25. data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +1 -1
  26. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/core_update.rb +3 -3
  27. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/docker_image.rb +17 -2
  28. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
  29. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/Dockerfile.template +2 -8
  30. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/Dockerfile_apache_setup +8 -0
  31. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/start.sh.template +1 -1
  32. data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +1 -1
  33. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/patches/i18n.rb +1 -1
  34. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/configured.rb +31 -0
  35. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/envvar.rb +17 -0
  36. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/gemfile.rb +41 -0
  37. data/{lib/avm/ruby → sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1}/rubocop.rb +2 -2
  38. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/tester.rb +1 -1
  39. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update/sub_update.rb +1 -1
  40. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
  41. data/sub/avm-files/avm-files.gemspec +1 -1
  42. data/sub/avm-files/lib/avm/files/appendable.rb +1 -1
  43. data/sub/avm-files/lib/avm/files/formatter/formats/ruby.rb +2 -2
  44. data/sub/avm-files/lib/avm/files/version.rb +1 -1
  45. data/sub/eac_cli/eac_cli.gemspec +1 -1
  46. data/sub/eac_cli/lib/eac_cli/old_configs/entry_reader.rb +1 -1
  47. data/sub/eac_cli/lib/eac_cli/old_configs/read_entry_options.rb +1 -1
  48. data/sub/eac_cli/lib/eac_cli/parser.rb +2 -2
  49. data/sub/eac_cli/lib/eac_cli/runner_with/help/builder.rb +1 -1
  50. data/sub/eac_cli/lib/eac_cli/runner_with/subcommands.rb +4 -4
  51. data/sub/eac_cli/lib/eac_cli/runner_with_set.rb +2 -2
  52. data/sub/eac_cli/lib/eac_cli/version.rb +1 -1
  53. data/sub/eac_config/eac_config.gemspec +1 -1
  54. data/sub/eac_config/lib/eac_config/entry.rb +1 -1
  55. data/sub/eac_config/lib/eac_config/envvars_node/entry.rb +1 -1
  56. data/sub/eac_config/lib/eac_config/paths_hash/node.rb +1 -1
  57. data/sub/eac_config/lib/eac_config/version.rb +1 -1
  58. data/sub/eac_fs/eac_fs.gemspec +1 -1
  59. data/sub/eac_fs/lib/eac_fs/version.rb +1 -1
  60. data/sub/eac_git/eac_git.gemspec +1 -1
  61. data/sub/eac_git/lib/eac_git/local/remote.rb +2 -2
  62. data/sub/eac_git/lib/eac_git/local.rb +1 -1
  63. data/sub/eac_git/lib/eac_git/version.rb +1 -1
  64. data/sub/eac_rest/eac_rest.gemspec +1 -1
  65. data/sub/eac_rest/lib/eac_rest/api.rb +14 -3
  66. data/sub/eac_rest/lib/eac_rest/request.rb +22 -1
  67. data/sub/eac_rest/lib/eac_rest/response.rb +41 -1
  68. data/sub/eac_rest/lib/eac_rest/version.rb +1 -1
  69. data/sub/eac_ruby_base0/eac_ruby_base0.gemspec +1 -1
  70. data/sub/eac_ruby_base0/lib/eac_ruby_base0/application.rb +2 -2
  71. data/sub/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
  72. data/sub/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +1 -1
  73. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/version_file.rb +2 -2
  74. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +1 -1
  75. data/sub/eac_ruby_utils/eac_ruby_utils.gemspec +1 -1
  76. data/sub/eac_ruby_utils/lib/eac_ruby_utils/custom_format.rb +1 -1
  77. data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem.rb +1 -1
  78. data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry.rb +1 -1
  79. data/sub/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +1 -1
  80. data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb +16 -4
  81. data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/value.rb +12 -2
  82. data/sub/eac_ruby_utils/lib/eac_ruby_utils/local_time_zone.rb +1 -1
  83. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/debug.rb +6 -0
  84. data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/on_clean_environment.rb +1 -1
  85. data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  86. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp/{temp_spec.rb → directory_spec.rb} +0 -0
  87. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp_spec.rb +4 -4
  88. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/listable_spec.rb +169 -106
  89. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/options_consumer_spec.rb +52 -17
  90. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/listable_spec.rb +5 -3
  91. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/simple_cache_spec.rb +5 -3
  92. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub_spec.rb +3 -3
  93. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb +21 -18
  94. data/sub/eac_ruby_utils/spec/locales/pt-BR.yml +3 -0
  95. data/sub/eac_templates/eac_templates.gemspec +1 -1
  96. data/sub/eac_templates/lib/eac_templates/directory.rb +1 -1
  97. data/sub/eac_templates/lib/eac_templates/version.rb +1 -1
  98. metadata +16 -9
  99. data/lib/avm/ruby/rubocop/_configured.rb +0 -29
  100. data/lib/avm/ruby/rubocop/_envvar.rb +0 -15
  101. data/lib/avm/ruby/rubocop/_gemfile.rb +0 -39
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a2ba57966d3d9df50f672ea915acbf2d245c9a84665c57ea1618693c5e1e6b0
4
- data.tar.gz: d3ab208447bf90b3eacac1bc9b9e824ab1d2b5c94caeec32aa8d6c2505257b8a
3
+ metadata.gz: 9ade74f1c59b191c0af317c03f8acb00fffc0e2bcac3120b56a604ab72a31ac1
4
+ data.tar.gz: 9d9967c47a11500142f7843b53ac7430f40fb191e441ce177ce583a58f46fffc
5
5
  SHA512:
6
- metadata.gz: 56714834b02e5f8d58091f4599dc0334d91c8953f62ca4112a0b2ae116a9be48d92e077702a9263f027157773b8b5fda3989ff82609d2e689053352e70dc9d86
7
- data.tar.gz: 3acfd216f55ac712a087e4e5363f253a2633367d8f7f0f78107a0cb3e521dd9cdfb86eb058f1af2a8e8d78a388ed1897521bd5553c150589363d6347c64c3850
6
+ metadata.gz: dae95c3e50159a7cd7a9c77745a106d462c2d5c8445a43f92f35cadeb42545509d83b53f2085a339b9dac930610a6cc68cb4551a2dd35e0a2566a1d07f932ce1
7
+ data.tar.gz: 7dc23f20f7430e88fd0a75582a899df38a81eb6a102f948611c96d810d766032656c730395ef66f4a3f89a11ad4b84d429252dcbf8e58082777b632f5e2ad188
@@ -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
 
@@ -78,10 +78,10 @@ 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
@@ -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.1'
5
+ VERSION = '0.116.2'
6
6
  end
7
7
  end
data/sub/avm/avm.gemspec CHANGED
@@ -21,6 +21,6 @@ Gem::Specification.new do |s|
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
@@ -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)
@@ -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.18.0'
4
+ VERSION = '0.18.1'
5
5
  end
@@ -16,5 +16,5 @@ Gem::Specification.new do |s|
16
16
  s.add_dependency 'eac_ruby_gems_utils', '~> 0.9', '>= 0.9.9'
17
17
  s.add_dependency 'eac_ruby_utils', '~> 0.68'
18
18
 
19
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
19
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
20
20
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRailsBase1
5
- VERSION = '0.2.0'
5
+ VERSION = '0.2.1'
6
6
  end
7
7
  end
@@ -3,4 +3,4 @@
3
3
  set -e
4
4
 
5
5
  source "$HOME/.rvm/scripts/rvm"
6
- ( cd '%%fs_path%%'; bundle exec tasks_scheduler "$@" )
6
+ ( cd '%%fs_path%%'; RAILS_ENV=production bundle exec tasks_scheduler "$@" )
@@ -19,5 +19,5 @@ Gem::Specification.new do |s|
19
19
  s.add_dependency 'eac_rest', '~> 0.4'
20
20
  s.add_dependency 'eac_ruby_utils', '~> 0.68'
21
21
 
22
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.4'
22
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
23
23
  end
@@ -76,7 +76,7 @@ module Avm
76
76
 
77
77
  def sync_content
78
78
  ::Avm::Sync.new(source_path, target_path)
79
- .add_exclude('/*').add_includes(*target_files_to_remove).move_mode(true).run
79
+ .add_exclude('/*').add_includes(*target_files_to_remove).move_mode(true).run
80
80
  end
81
81
 
82
82
  # @return [EacFs::CachedDownload]
@@ -99,8 +99,8 @@ module Avm
99
99
 
100
100
  def target_files_to_remove
101
101
  git_repo.command('ls-files').execute!
102
- .each_line.map { |v| "/#{v.strip}" }
103
- .without(*TARGET_KEEP)
102
+ .each_line.map { |v| "/#{v.strip}" }
103
+ .without(*TARGET_KEEP)
104
104
  end
105
105
 
106
106
  def target_path_uncached
@@ -12,7 +12,8 @@ module Avm
12
12
  enable_simple_cache
13
13
 
14
14
  BASE_IMAGE = 'ubuntu:20.04'
15
- INSTALLER_TARGET_TASK = 'redmine_as_apache_base'
15
+ INSTALLER_TARGET_TASK_WITH_WEB_PATH_BLANK = 'redmine_as_apache_base'
16
+ INSTALLER_TARGET_TASK_WITH_WEB_PATH_PRESENT = 'redmine_as_apache_path'
16
17
  DATABASE_INTERNAL_HOSTNAME = 'localhost'
17
18
  REDMINE_SOURCE_HOST_SUBPATH = 'redmine_source'
18
19
 
@@ -20,6 +21,12 @@ module Avm
20
21
  instance.id
21
22
  end
22
23
 
24
+ def apache_setup
25
+ return '' if web_path_present?
26
+
27
+ template.child('Dockerfile_apache_setup').apply(self)
28
+ end
29
+
23
30
  def base_image
24
31
  eac_ubuntu_base0_instance.docker_image.provide.id
25
32
  end
@@ -30,7 +37,11 @@ module Avm
30
37
  end
31
38
 
32
39
  def installer_target_task
33
- INSTALLER_TARGET_TASK
40
+ if web_path_present?
41
+ INSTALLER_TARGET_TASK_WITH_WEB_PATH_PRESENT
42
+ else
43
+ INSTALLER_TARGET_TASK_WITH_WEB_PATH_BLANK
44
+ end
34
45
  end
35
46
 
36
47
  def redmine_user
@@ -53,6 +64,10 @@ module Avm
53
64
  '/start.sh'
54
65
  end
55
66
 
67
+ def web_path_present?
68
+ ::Addressable::URI.parse(instance.web_url).path.present?
69
+ end
70
+
56
71
  private
57
72
 
58
73
  def eac_ubuntu_base0_instance
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRedmineBase0
5
- VERSION = '0.5.0'
5
+ VERSION = '0.5.1'
6
6
  end
7
7
  end
@@ -22,19 +22,13 @@ RUN SKIP_DATABASE='%%skip_database%%' \
22
22
  '%%redmine_path%%/plugins/redmine_installer/installer/run.sh' '%%installer_target_task%%'
23
23
 
24
24
  # Apache / Configuração do virtualhost
25
- COPY apache_http_virtualhost.conf /etc/apache2/sites-available/redmine.conf
26
- COPY apache_https_virtualhost.conf /etc/apache2/sites-available/redmine_ssl.conf
27
- USER root
28
- RUN a2ensite redmine
29
- RUN a2ensite redmine_ssl
30
- RUN a2dissite 000-default
31
- RUN a2enmod ssl
32
- RUN service apache2 restart
25
+ %%apache_setup%%
33
26
 
34
27
  # Portas
35
28
  EXPOSE 80/tcp 443/tcp 22/tcp
36
29
 
37
30
  # Execução
31
+ USER root
38
32
  COPY start.sh '%%start_path%%'
39
33
  RUN /bin/chmod +x '%%start_path%%'
40
34
  RUN /bin/chown '%%redmine_user%%:%%redmine_user%%' '%%start_path%%'
@@ -0,0 +1,8 @@
1
+ COPY apache_http_virtualhost.conf /etc/apache2/sites-available/redmine.conf
2
+ COPY apache_https_virtualhost.conf /etc/apache2/sites-available/redmine_ssl.conf
3
+ USER root
4
+ RUN a2ensite redmine
5
+ RUN a2ensite redmine_ssl
6
+ RUN a2dissite 000-default
7
+ RUN a2enmod ssl
8
+ RUN service apache2 restart
@@ -34,7 +34,7 @@ function postgresql_start() {
34
34
 
35
35
  function request_http_interface() {
36
36
  title 'Requesting web interface...'
37
- wget 'http://localhost' &> /dev/null
37
+ wget 'http://localhost%%web.path%%' &> /dev/null
38
38
  }
39
39
 
40
40
  function redmine_log() {
@@ -17,5 +17,5 @@ Gem::Specification.new do |s|
17
17
  s.add_dependency 'eac_ruby_gems_utils', '~> 0.9', '>= 0.9.8'
18
18
  s.add_dependency 'eac_ruby_utils', '~> 0.80'
19
19
 
20
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.4'
20
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
21
21
  end
@@ -4,4 +4,4 @@ require 'eac_ruby_utils/core_ext'
4
4
  require 'i18n'
5
5
 
6
6
  ::I18n.load_path += __dir__.to_pathname.expand_path.parent_n(4).join('locale').glob('*.yaml')
7
- .map(&:to_path)
7
+ .map(&:to_path)
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/sources/configuration'
4
+
5
+ module Avm
6
+ module EacRubyBase1
7
+ class Rubocop
8
+ module Configured
9
+ def configured_rubocop_command_uncached
10
+ configured_rubocop_command_by_command || configured_rubocop_command_by_gemfile
11
+ end
12
+
13
+ def configured_rubocop_command_by_command
14
+ configuration.if_present(&:rubocop_command)
15
+ end
16
+
17
+ def configured_rubocop_command_by_gemfile
18
+ configuration.if_present(&:rubocop_gemfile).if_present do |v|
19
+ rubocop_command_by_gemfile_path(v.parent)
20
+ end
21
+ end
22
+
23
+ private
24
+
25
+ def configuration_uncached
26
+ ::Avm::Sources::Configuration.find_by_path(base_path)
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRubyBase1
7
+ class Rubocop
8
+ module Envvar
9
+ RUBOCOP_COMMAND_ENVVAR_NAME = 'RUBOCOP_COMMAND'
10
+
11
+ def env_rubocop_command
12
+ ENV[RUBOCOP_COMMAND_ENVVAR_NAME].present? ? cmd(ENV[RUBOCOP_COMMAND_ENVVAR_NAME]) : nil
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/patches/eac_ruby_gems_utils/gem'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module EacRubyBase1
8
+ class Rubocop
9
+ module Gemfile
10
+ def gemfile_rubocop_command
11
+ return nil unless rubocop_gemfile?
12
+
13
+ rubocop_command_by_gemfile_path(mygem.root)
14
+ end
15
+
16
+ def rubocop_command_by_gemfile_path(path)
17
+ ::EacRubyGemsUtils::Gem.new(path).bundle('exec', 'rubocop').chdir_root
18
+ end
19
+
20
+ def rubocop_gemfile?
21
+ return false if mygem.blank?
22
+
23
+ mygem.bundle('install').execute!
24
+ mygem.gemfile_lock_gem_version('rubocop').present?
25
+ end
26
+
27
+ private
28
+
29
+ def mygem_uncached
30
+ find_gem(::Pathname.new(base_path).expand_path)
31
+ end
32
+
33
+ def find_gem(path)
34
+ r = ::EacRubyGemsUtils::Gem.new(path)
35
+ return r if r.gemfile_path.exist?
36
+ return find_gem(path.dirname) unless path.root?
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -4,9 +4,9 @@ require 'eac_ruby_utils/core_ext'
4
4
  require 'eac_ruby_utils/ruby/on_clean_environment'
5
5
 
6
6
  module Avm
7
- module Ruby
7
+ module EacRubyBase1
8
8
  class Rubocop
9
- require_sub __FILE__
9
+ require_sub __FILE__, include_modules: true
10
10
  enable_speaker
11
11
  enable_simple_cache
12
12
  common_constructor :base_path, :rubocop_args
@@ -19,7 +19,7 @@ module Avm
19
19
  # @return [EacRubyGemsUtils::Gem::Command, nil]
20
20
  def bundle_test_command
21
21
  source.read_configuration_as_shell_words(BUNDLE_TEST_COMMAND_CONFIGURATION_KEY)
22
- .if_present { |args| the_gem.bundle(*args).chdir_root }
22
+ .if_present { |args| the_gem.bundle(*args).chdir_root }
23
23
  end
24
24
 
25
25
  # @return [EacRubyGemsUtils::Gem::Command, nil]
@@ -18,7 +18,7 @@ module Avm
18
18
  if commit.no_scm_changed_files.any?
19
19
  commit = commit.reword(no_scm_update_commit_message)
20
20
  source.scm.commit_if_change { source_update.bundle_update }
21
- .if_present { |v| v.merge_with(commit) }
21
+ .if_present { |v| v.merge_with(commit) }
22
22
  else
23
23
  commit.reword(scm_update_commit_message)
24
24
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRubyBase1
5
- VERSION = '0.3.1'
5
+ VERSION = '0.4.0'
6
6
  end
7
7
  end
@@ -17,5 +17,5 @@ Gem::Specification.new do |s|
17
17
  s.add_dependency 'eac_ruby_utils', '~> 0.76'
18
18
  s.add_dependency 'eac_templates', '~> 0.2'
19
19
 
20
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.4'
20
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
21
21
  end
@@ -35,7 +35,7 @@ module Avm
35
35
 
36
36
  def append_file_content(target_path, content)
37
37
  appended << ::Avm::Files::Appendable::FileContent
38
- .new(self, target_path, content)
38
+ .new(self, target_path, content)
39
39
  self
40
40
  end
41
41
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'avm/files/formatter/formats/generic_plain'
4
- require 'avm/ruby/rubocop'
4
+ require 'avm/eac_ruby_base1/rubocop'
5
5
 
6
6
  module Avm
7
7
  module Files
@@ -12,7 +12,7 @@ module Avm
12
12
  VALID_TYPES = ['x-ruby'].freeze
13
13
 
14
14
  def internal_apply(files)
15
- ::Avm::Ruby::Rubocop.new('.', ['-a', '--ignore-parent-exclusion'] + files).run
15
+ ::Avm::EacRubyBase1::Rubocop.new('.', ['-a', '--ignore-parent-exclusion'] + files).run
16
16
  super(files)
17
17
  end
18
18
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Files
5
- VERSION = '0.3.0'
5
+ VERSION = '0.3.2'
6
6
  end
7
7
  end
@@ -16,5 +16,5 @@ Gem::Specification.new do |s|
16
16
  s.add_dependency 'eac_config', '~> 0.8'
17
17
  s.add_dependency 'eac_ruby_utils', '~> 0.83'
18
18
 
19
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3'
19
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
20
20
  end
@@ -17,7 +17,7 @@ module EacCli
17
17
  ::EacConfig::PathsHash.parse_entry_key(entry_key)
18
18
  end
19
19
  path.join('_').gsub(/[^a-z0-9_]/i, '').gsub(/\A_+/, '').gsub(/_+\z/, '')
20
- .gsub(/_{2,}/, '_').upcase
20
+ .gsub(/_{2,}/, '_').upcase
21
21
  end
22
22
  end
23
23
 
@@ -8,7 +8,7 @@ module EacCli
8
8
  enable_simple_cache
9
9
  common_constructor :options do
10
10
  self.options = options.to_h.symbolize_keys
11
- .assert_valid_keys(DEFAULT_VALUES.keys).freeze
11
+ .assert_valid_keys(DEFAULT_VALUES.keys).freeze
12
12
  end
13
13
 
14
14
  DEFAULT_VALUES = {