eac_tools 0.25.0 → 0.27.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +57 -56
  3. data/lib/eac_tools/version.rb +1 -1
  4. data/sub/avm/avm.gemspec +2 -2
  5. data/sub/avm/lib/avm/applications/base.rb +1 -1
  6. data/sub/avm/lib/avm/data/instance/files_unit.rb +2 -1
  7. data/sub/avm/lib/avm/entries/auto_values/uri_entry.rb +1 -1
  8. data/sub/avm/lib/avm/entries/base/uri_component_entry_value/default_value.rb +27 -0
  9. data/sub/avm/lib/avm/entries/base/uri_component_entry_value/inherited_value.rb +38 -0
  10. data/sub/avm/lib/avm/entries/base/uri_component_entry_value/url_entry_value.rb +31 -0
  11. data/sub/avm/lib/avm/entries/base/uri_component_entry_value.rb +3 -30
  12. data/sub/avm/lib/avm/instances/base/auto_values/filesystem.rb +0 -25
  13. data/sub/avm/lib/avm/instances/base/auto_values/install.rb +13 -17
  14. data/sub/avm/lib/avm/instances/entry_keys.rb +1 -2
  15. data/sub/avm/lib/avm/version.rb +1 -1
  16. data/sub/avm/spec/lib/avm/instances/base_spec.rb +2 -2
  17. data/sub/avm/spec/lib/avm/instances/base_spec_configs_storage.yml +1 -1
  18. data/sub/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec +2 -2
  19. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/apache_host.rb +1 -1
  20. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/deploy.rb +1 -1
  21. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
  22. data/sub/avm-eac_latex_base0/avm-eac_latex_base0.gemspec +3 -3
  23. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/instances/apache_host.rb +1 -1
  24. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/instances/deploy.rb +1 -1
  25. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/version.rb +1 -1
  26. data/sub/avm-eac_rails_base0/avm-eac_rails_base0.gemspec +2 -2
  27. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/deploy.rb +1 -1
  28. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/version.rb +1 -1
  29. data/sub/avm-eac_rails_base0/spec/lib/avm/eac_rails_base0/apache_host_spec.rb +1 -1
  30. data/sub/avm-eac_rails_base0/spec/lib/avm/eac_rails_base0/apache_path_spec.rb +1 -1
  31. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/apache_path/extra_content.conf +1 -1
  32. data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +4 -4
  33. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/apache_host.rb +1 -1
  34. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/base.rb +3 -2
  35. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb +1 -1
  36. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
  37. data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.sh +1 -1
  38. data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +3 -3
  39. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb +1 -1
  40. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/deploy.rb +37 -0
  41. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/docker_image.rb +1 -1
  42. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/runners/base.rb +1 -1
  43. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
  44. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/{deploy → instances/deploy}/config/install.sh.template +0 -0
  45. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/{deploy → instances/deploy}/config/secrets.yml +0 -0
  46. data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +2 -2
  47. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners/update_dependencies_requirements.rb +7 -1
  48. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
  49. data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +2 -2
  50. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_path.rb +1 -1
  51. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb +1 -1
  52. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/git_info.rb +1 -1
  53. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/write_on_target.rb +1 -1
  54. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/deploy.rb +2 -0
  55. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
  56. data/sub/avm-eac_wordpress_base0/avm-eac_wordpress_base0.gemspec +3 -3
  57. data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/instances/apache_host.rb +1 -1
  58. data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/version.rb +1 -1
  59. data/sub/avm-eac_wordpress_base0/spec/lib/avm/eac_wordpress_base0/instances/apache_host_spec.rb +1 -1
  60. data/sub/avm-tools/avm-tools.gemspec +3 -3
  61. data/sub/avm-tools/lib/avm/tools/runner/git/deploy.rb +2 -2
  62. data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
  63. data/sub/eac_config/eac_config.gemspec +1 -1
  64. data/sub/eac_config/lib/eac_config/entry.rb +4 -0
  65. data/sub/eac_config/lib/eac_config/envvars_node.rb +4 -0
  66. data/sub/eac_config/lib/eac_config/node_entry.rb +5 -0
  67. data/sub/eac_config/lib/eac_config/version.rb +1 -1
  68. data/sub/eac_config/lib/eac_config/yaml_file_node.rb +4 -0
  69. data/sub/eac_config/spec/lib/eac_config/envvars_node_spec.rb +11 -0
  70. data/sub/eac_ruby_utils/eac_ruby_utils.gemspec +2 -2
  71. data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/on_clean_environment.rb +53 -20
  72. data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/on_replace_objects/replace_instance_method.rb +36 -0
  73. data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/on_replace_objects.rb +52 -0
  74. data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  75. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/{ruby_spec.rb → ruby/on_clean_environment_spec.rb} +11 -0
  76. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_replace_objects_spec.rb +67 -0
  77. metadata +34 -52
  78. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/deploy.rb +0 -36
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib,template}/**/*']
14
14
 
15
- s.add_dependency 'avm-eac_rails_base1', '~> 0.5'
16
- s.add_dependency 'eac_ruby_utils', '~> 0.98'
15
+ s.add_dependency 'avm-eac_rails_base1', '~> 0.6'
16
+ s.add_dependency 'eac_ruby_utils', '~> 0.102'
17
17
 
18
18
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
19
19
  end
@@ -44,7 +44,7 @@ module Avm
44
44
  def touch_restart_file
45
45
  infom 'Touching restart file...'
46
46
  instance.host_env.command(
47
- 'touch', ::File.join(instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH),
47
+ 'touch', ::File.join(instance.read_entry(::Avm::Instances::EntryKeys::INSTALL_PATH),
48
48
  'tmp', 'restart.txt')
49
49
  ).system!
50
50
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRailsBase0
5
- VERSION = '0.7.0'
5
+ VERSION = '0.8.0'
6
6
  end
7
7
  end
@@ -11,7 +11,7 @@ RSpec.describe ::Avm::EacRailsBase0::ApacheHost do
11
11
  let(:expected_content) { fixtures_dir.join('apache_host_spec_no_ssl_content.conf').read }
12
12
 
13
13
  before do
14
- instance.entry('fs_path').write('/path/to/stub-app_0')
14
+ instance.entry('install.path').write('/path/to/stub-app_0')
15
15
  instance.entry('web.url').write('http://stubapp.net')
16
16
  end
17
17
 
@@ -12,7 +12,7 @@ RSpec.describe ::Avm::EacRailsBase0::ApachePath do
12
12
  let(:expected_content) { expect_file.read }
13
13
 
14
14
  before do
15
- instance.entry(::Avm::Instances::EntryKeys::FS_PATH).write('/path/to/stub-app_0')
15
+ instance.entry(::Avm::Instances::EntryKeys::INSTALL_PATH).write('/path/to/stub-app_0')
16
16
  instance.entry('web.url').write('http://stubapp.net/stub-app_0')
17
17
  end
18
18
 
@@ -1,5 +1,5 @@
1
1
  <Location "%%WEB.PATH%%">
2
2
  PassengerBaseURI "%%WEB.PATH%%"
3
- PassengerAppRoot "%%FS_PATH%%"
3
+ PassengerAppRoot "%%INSTALL.PATH%%"
4
4
  PassengerAppEnv production
5
5
  </Location>
@@ -12,10 +12,10 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib,template}/**/*']
14
14
 
15
- s.add_dependency 'avm', '~> 0.35', '>= 0.35.1'
16
- s.add_dependency 'avm-eac_ruby_base1', '~> 0.19'
17
- s.add_dependency 'avm-eac_webapp_base0', '~> 0.4'
18
- s.add_dependency 'eac_ruby_utils', '~> 0.98'
15
+ s.add_dependency 'avm', '~> 0.41'
16
+ s.add_dependency 'avm-eac_ruby_base1', '~> 0.20'
17
+ s.add_dependency 'avm-eac_webapp_base0', '~> 0.6'
18
+ s.add_dependency 'eac_ruby_utils', '~> 0.102'
19
19
 
20
20
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
21
21
  end
@@ -6,7 +6,7 @@ module Avm
6
6
  module EacRailsBase1
7
7
  class ApacheHost < ::Avm::EacWebappBase0::ApacheHost
8
8
  def document_root
9
- "#{instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH)}/public"
9
+ "#{instance.read_entry(::Avm::Instances::EntryKeys::INSTALL_PATH)}/public"
10
10
  end
11
11
 
12
12
  def extra_content
@@ -18,8 +18,9 @@ module Avm
18
18
  end
19
19
 
20
20
  def the_gem
21
- @the_gem ||= ::Avm::EacRubyBase1::Sources::Base.new(::File.join(read_entry('fs_path')))
22
- .env_set(host_env)
21
+ @the_gem ||= ::Avm::EacRubyBase1::Sources::Base.new(
22
+ ::File.join(read_entry('install.path'))
23
+ ).env_set(host_env)
23
24
  end
24
25
  end
25
26
  end
@@ -20,7 +20,7 @@ module Avm
20
20
  private
21
21
 
22
22
  def log_path
23
- ::File.join(rails_instance.read_entry('fs_path'), 'log', "#{rails_environment}.log")
23
+ ::File.join(rails_instance.read_entry('install.path'), 'log', "#{rails_environment}.log")
24
24
  end
25
25
 
26
26
  def start_banner
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRailsBase1
5
- VERSION = '0.5.0'
5
+ VERSION = '0.6.0'
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%%'; RAILS_ENV=production bundle exec tasks_scheduler "$@" )
6
+ ( cd '%%install.path%%'; RAILS_ENV=production bundle exec tasks_scheduler "$@" )
@@ -12,14 +12,14 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib,locale,template}/**/*']
14
14
 
15
- s.add_dependency 'avm', '~> 0.35', '>= 0.35.1'
15
+ s.add_dependency 'avm', '~> 0.41'
16
16
  s.add_dependency 'avm-eac_generic_base0', '~> 0.5'
17
- s.add_dependency 'avm-eac_rails_base1', '~> 0.5'
17
+ s.add_dependency 'avm-eac_rails_base1', '~> 0.6'
18
18
  s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.3'
19
19
  s.add_dependency 'curb', '~> 0.9', '>= 0.9.11'
20
20
  s.add_dependency 'eac_fs', '~> 0.12', '>= 0.12.3'
21
21
  s.add_dependency 'eac_rest', '~> 0.6', '>= 0.6.1'
22
- s.add_dependency 'eac_ruby_utils', '~> 0.98'
22
+ s.add_dependency 'eac_ruby_utils', '~> 0.102'
23
23
 
24
24
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
25
25
  end
@@ -21,7 +21,7 @@ module Avm
21
21
  def docker_run_arguments
22
22
  [
23
23
  '--volume',
24
- "#{read_entry(::Avm::Instances::EntryKeys::FS_PATH)}:/home/myuser/eac_redmine_base0",
24
+ "#{install_path}:/home/myuser/eac_redmine_base0",
25
25
  '--publish', "#{read_entry(:ssh_port)}:22",
26
26
  '--publish', "#{read_entry(:http_port)}:80",
27
27
  '--publish', "#{read_entry(:https_port)}:443"
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_webapp_base0/deploy'
4
+ require 'eac_ruby_utils/ruby'
5
+
6
+ module Avm
7
+ module EacRedmineBase0
8
+ module Instances
9
+ class Deploy < ::Avm::EacWebappBase0::Deploy
10
+ set_callback :assert_instance_branch, :after, :run_installer
11
+
12
+ def run_installer
13
+ infom 'Running installer'
14
+ ::EacRubyUtils::Ruby.on_clean_environment do
15
+ installer_command.system!
16
+ end
17
+ end
18
+
19
+ def installer_command
20
+ instance.host_env.command(installer_path, install_task)
21
+ end
22
+
23
+ def installer_path
24
+ ::File.join(instance.install_path, 'plugins', 'redmine_installer', 'installer', 'run.sh')
25
+ end
26
+
27
+ def install_task
28
+ if instance.web_path_optional.present?
29
+ 'redmine_as_apache_path'
30
+ else
31
+ 'redmine_as_apache_base'
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -77,7 +77,7 @@ module Avm
77
77
  end
78
78
 
79
79
  def git_repo_uncached
80
- ::EacGit::Local.new(instance.source_instance.fs_path)
80
+ ::EacGit::Local.new(instance.source_instance.install_path)
81
81
  end
82
82
 
83
83
  def redmine_source_git_id
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'avm/eac_redmine_base0/instances/base'
4
- require 'avm/eac_redmine_base0/deploy'
4
+ require 'avm/eac_redmine_base0/instances/deploy'
5
5
  require 'avm/eac_redmine_base0/apache_host'
6
6
  require 'avm/eac_rails_base1/runner'
7
7
  require 'eac_ruby_utils/core_ext'
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRedmineBase0
5
- VERSION = '0.12.0'
5
+ VERSION = '0.14.0'
6
6
  end
7
7
  end
@@ -12,9 +12,9 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib,locale,template}/**/*']
14
14
 
15
- s.add_dependency 'avm', '~> 0.35', '>= 0.35.1'
15
+ s.add_dependency 'avm', '~> 0.39', '>= 0.39.1'
16
16
  s.add_dependency 'avm-eac_generic_base0', '~> 0.5'
17
- s.add_dependency 'eac_ruby_utils', '~> 0.98'
17
+ s.add_dependency 'eac_ruby_utils', '~> 0.102'
18
18
 
19
19
  s.add_development_dependency 'aranha-parsers', '~> 0.14', '>= 0.14.1'
20
20
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
@@ -11,6 +11,7 @@ module Avm
11
11
  class UpdateDependenciesRequirements
12
12
  runner_with :help do
13
13
  bool_opt '-a', '--all'
14
+ arg_opt '-e', '--exclude', repeat: true
14
15
  pos_arg :gem_name, repeat: true, optional: true
15
16
  end
16
17
 
@@ -32,8 +33,13 @@ module Avm
32
33
 
33
34
  private
34
35
 
36
+ def exclude?(gem_name)
37
+ parsed.exclude.include?(gem_name)
38
+ end
39
+
35
40
  def gem_names_uncached
36
- ::Set.new(parsed.gem_name + gem_names_from_all).sort
41
+ ::Set.new(parsed.gem_name + gem_names_from_all).reject { |gem_name| exclude?(gem_name) }
42
+ .sort
37
43
  end
38
44
 
39
45
  def gem_names_from_all
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRubyBase1
5
- VERSION = '0.19.1'
5
+ VERSION = '0.20.0'
6
6
  end
7
7
  end
@@ -12,11 +12,11 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib,template}/**/*']
14
14
 
15
- s.add_dependency 'avm', '~> 0.39'
15
+ s.add_dependency 'avm', '~> 0.41'
16
16
  s.add_dependency 'avm-eac_generic_base0', '~> 0.5'
17
17
  s.add_dependency 'avm-eac_postgresql_base0', '~> 0.2'
18
18
  s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.3'
19
- s.add_dependency 'eac_ruby_utils', '~> 0.101'
19
+ s.add_dependency 'eac_ruby_utils', '~> 0.102'
20
20
 
21
21
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
22
22
  end
@@ -15,7 +15,7 @@ module Avm
15
15
  end
16
16
 
17
17
  def document_root
18
- instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH)
18
+ instance.read_entry(::Avm::Instances::EntryKeys::INSTALL_PATH)
19
19
  end
20
20
 
21
21
  def extra_content
@@ -27,7 +27,7 @@ module Avm
27
27
  end
28
28
 
29
29
  def target_path
30
- ::File.join(instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH),
30
+ ::File.join(instance.read_entry(::Avm::Instances::EntryKeys::INSTALL_PATH),
31
31
  fs_path_subpath.to_s)
32
32
  end
33
33
 
@@ -38,7 +38,7 @@ module Avm
38
38
  end
39
39
 
40
40
  def git_repository_path
41
- instance.source_instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH)
41
+ instance.source_instance.read_entry(::Avm::Instances::EntryKeys::INSTALL_PATH)
42
42
  end
43
43
 
44
44
  def git_uncached
@@ -9,7 +9,7 @@ module Avm
9
9
  def write_on_target
10
10
  ::Avm::Files::Deploy.new(
11
11
  instance.host_env,
12
- instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH)
12
+ instance.read_entry(::Avm::Instances::EntryKeys::INSTALL_PATH)
13
13
  ).append_plain_directory(build_dir).run
14
14
  end
15
15
  end
@@ -16,6 +16,8 @@ module Avm
16
16
  end
17
17
 
18
18
  def deploy_class
19
+ runner_context.call(:stereotype_module).const_get('Instances').const_get('Deploy')
20
+ rescue ::NameError
19
21
  runner_context.call(:stereotype_module).const_get('Deploy')
20
22
  end
21
23
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacWebappBase0
5
- VERSION = '0.4.1'
5
+ VERSION = '0.6.0'
6
6
  end
7
7
  end
@@ -12,9 +12,9 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib,template}/**/*']
14
14
 
15
- s.add_dependency 'avm', '~> 0.35', '>= 0.35.1'
16
- s.add_dependency 'avm-eac_webapp_base0', '~> 0.4'
17
- s.add_dependency 'eac_ruby_utils', '~> 0.98'
15
+ s.add_dependency 'avm', '~> 0.41'
16
+ s.add_dependency 'avm-eac_webapp_base0', '~> 0.6'
17
+ s.add_dependency 'eac_ruby_utils', '~> 0.102'
18
18
 
19
19
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5', '>= 0.5.1'
20
20
  end
@@ -7,7 +7,7 @@ module Avm
7
7
  module Instances
8
8
  class ApacheHost < ::Avm::EacWebappBase0::ApacheHost
9
9
  def document_root
10
- instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH)
10
+ instance.read_entry(::Avm::Instances::EntryKeys::INSTALL_PATH)
11
11
  end
12
12
 
13
13
  def extra_content
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacWordpressBase0
5
- VERSION = '0.1.2'
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
@@ -13,7 +13,7 @@ RSpec.describe ::Avm::EacWordpressBase0::Instances::ApacheHost do
13
13
  end
14
14
 
15
15
  before do
16
- instance.entry(::Avm::Instances::EntryKeys::FS_PATH).write('/path/to/stub-app_0')
16
+ instance.entry(::Avm::Instances::EntryKeys::INSTALL_PATH).write('/path/to/stub-app_0')
17
17
  instance.entry(::Avm::Instances::EntryKeys::WEB_URL).write('http://stubapp.net')
18
18
  instance.entry(::Avm::Instances::EntryKeys::INSTALL_USERNAME).write('myuser')
19
19
  end
@@ -15,8 +15,8 @@ Gem::Specification.new do |s|
15
15
  s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
16
16
 
17
17
  s.add_dependency 'aranha-parsers', '~> 0.14', '>= 0.14.1'
18
- s.add_dependency 'avm', '~> 0.37'
19
- s.add_dependency 'avm-eac_ruby_base1', '~> 0.19', '>= 0.19.1'
18
+ s.add_dependency 'avm', '~> 0.41'
19
+ s.add_dependency 'avm-eac_ruby_base1', '~> 0.20'
20
20
  s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.3'
21
21
  s.add_dependency 'avm-files', '~> 0.3', '>= 0.3.2'
22
22
  s.add_dependency 'avm-git', '~> 0.4'
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
25
25
  s.add_dependency 'eac_git', '~> 0.12', '>= 0.12.2'
26
26
  s.add_dependency 'eac_ruby_base0', '~> 0.16', '>= 0.16.6'
27
27
  s.add_dependency 'eac_templates', '~> 0.3', '>= 0.3.1'
28
- s.add_dependency 'git', '~> 1.11'
28
+ s.add_dependency 'git', '~> 1.12'
29
29
  s.add_dependency 'ruby-progressbar', '~> 1.11'
30
30
 
31
31
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
@@ -71,7 +71,7 @@ module Avm
71
71
  def dev_instance_fs_path
72
72
  instance.if_present do |v|
73
73
  v.application.instance('dev').read_entry_optional(
74
- ::Avm::Instances::EntryKeys::FS_PATH
74
+ ::Avm::Instances::EntryKeys::INSTALL_PATH
75
75
  )
76
76
  end
77
77
  end
@@ -86,7 +86,7 @@ module Avm
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(::Avm::Instances::EntryKeys::FS_URL) }
89
+ instance.if_present { |v| return v.install_url }
90
90
  nil
91
91
  end
92
92
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.133.0'
5
+ VERSION = '0.135.0'
6
6
  end
7
7
  end
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.files = Dir['{lib}/**/*']
14
14
 
15
15
  s.add_dependency 'addressable', '~> 2.8'
16
- s.add_dependency 'eac_ruby_utils', '~> 0.100'
16
+ s.add_dependency 'eac_ruby_utils', '~> 0.102'
17
17
 
18
18
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
19
19
  end
@@ -22,6 +22,10 @@ module EacConfig
22
22
  node_entry.if_present(&:secret_value)
23
23
  end
24
24
 
25
+ def to_s
26
+ "#{self.class}[RootNode: #{root_node}, Path: #{path}]"
27
+ end
28
+
25
29
  def value
26
30
  node_entry.if_present(&:value)
27
31
  end
@@ -21,5 +21,9 @@ module EacConfig
21
21
  def url
22
22
  URI
23
23
  end
24
+
25
+ def to_s
26
+ "#{self.class}[ObjectId: #{object_id}]}"
27
+ end
24
28
  end
25
29
  end
@@ -18,5 +18,10 @@ module EacConfig
18
18
  def secret_value
19
19
  value
20
20
  end
21
+
22
+ # @return [String]
23
+ def to_s
24
+ "#{self.class}[Node: #{node}, Path: #{path}]"
25
+ end
21
26
  end
22
27
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacConfig
4
- VERSION = '0.11.0'
4
+ VERSION = '0.11.1'
5
5
  end
@@ -31,6 +31,10 @@ module EacConfig
31
31
  ::Addressable::URI.parse("file://#{path.expand_path}")
32
32
  end
33
33
 
34
+ def to_s
35
+ "#{self.class}[#{path}]"
36
+ end
37
+
34
38
  private
35
39
 
36
40
  def data_uncached
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'eac_config/envvars_node'
4
+ require 'eac_ruby_utils/ruby'
4
5
 
5
6
  RSpec.describe ::EacConfig::EnvvarsNode do
6
7
  let(:instance) { described_class.new }
@@ -18,6 +19,16 @@ RSpec.describe ::EacConfig::EnvvarsNode do
18
19
  it { expect(entry.value).to eq('AAA') }
19
20
  it { expect(entry.found_node).to eq(instance) }
20
21
  it { expect(entry).to be_found }
22
+
23
+ context 'with a clean ruby environment' do
24
+ let(:entry_value) do
25
+ ::EacRubyUtils::Ruby.on_clean_environment do
26
+ entry.value
27
+ end
28
+ end
29
+
30
+ it { expect(entry_value).to eq('AAA') }
31
+ end
21
32
  end
22
33
 
23
34
  context 'with blank entry' do
@@ -16,9 +16,9 @@ Gem::Specification.new do |s|
16
16
  s.files = Dir['{lib}/**/*', 'MIT-LICENSE', 'README.rdoc']
17
17
 
18
18
  s.add_dependency 'activesupport', '>= 4', '< 7'
19
- s.add_dependency 'addressable', '~> 2.6'
19
+ s.add_dependency 'addressable', '~> 2.8'
20
20
  s.add_dependency 'bundler'
21
- s.add_dependency 'filesize'
21
+ s.add_dependency 'filesize', '~> 0.2'
22
22
  s.add_dependency 'net-ssh', '~> 4.2'
23
23
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
24
24
  end
@@ -1,37 +1,70 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'bundler'
4
+ require 'eac_ruby_utils/ruby/on_replace_objects'
4
5
 
5
6
  module EacRubyUtils
6
7
  module Ruby
7
8
  class << self
8
9
  # Executes a block in an environment when the variables BUNDLE* and RUBY* are removed.
9
- def on_clean_environment
10
- bundler_with_unbundled_env do
11
- on_clean_envvars('BUNDLE', 'RUBY') { yield }
12
- end
10
+ def on_clean_environment(&block)
11
+ OnCleanEnvironment.new(&block).perform
13
12
  end
14
13
 
15
- private
14
+ class OnCleanEnvironment
15
+ ENVVARS_PREFIXES_TO_CLEAN = %w[BUNDLE RUBY].freeze
16
+
17
+ attr_reader :block, :original_env
16
18
 
17
- def bundler_with_unbundled_env(&block)
18
- if ::Bundler.respond_to?(:with_unbundled_env)
19
- ::Bundler.with_unbundled_env(&block)
20
- else
21
- ::Bundler.with_clean_env(&block)
19
+ def initialize(&block)
20
+ @block = block
21
+ @original_env = ::ENV.to_h
22
22
  end
23
- end
24
23
 
25
- def on_clean_envvars(*start_with_vars)
26
- old_values = envvars_starting_with(start_with_vars)
27
- old_values.each_key { |k| ENV.delete(k) }
28
- yield
29
- ensure
30
- old_values&.each { |k, v| ENV[k] = v }
31
- end
24
+ # @return [Array<String>]
25
+ def envvars_prefixes_to_clean
26
+ ENVVARS_PREFIXES_TO_CLEAN
27
+ end
32
28
 
33
- def envvars_starting_with(start_with_vars)
34
- ENV.select { |k, _v| start_with_vars.any? { |var| k.start_with?(var) } }
29
+ def perform
30
+ bundler_with_unbundled_env do
31
+ on_clean_envvars
32
+ end
33
+ end
34
+
35
+ private
36
+
37
+ def bundler_with_unbundled_env(&block)
38
+ with_bundler_modified do
39
+ ::Bundler.send(bundler_with_env_method_name, &block)
40
+ end
41
+ end
42
+
43
+ def bundler_with_env_method_name
44
+ if ::Bundler.respond_to?(:with_unbundled_env)
45
+ :with_unbundled_env
46
+ else
47
+ :with_clean_env
48
+ end
49
+ end
50
+
51
+ def clean_env
52
+ r = original_env.dup
53
+ r.delete_if { |k, _| envvars_prefixes_to_clean.any? { |prefix| k.start_with?(prefix) } }
54
+ r
55
+ end
56
+
57
+ def on_clean_envvars
58
+ ::Bundler.send('with_env', clean_env) { block.call }
59
+ end
60
+
61
+ def with_bundler_modified(&block)
62
+ cloned_env = original_env.dup
63
+ ::EacRubyUtils::Ruby.on_replace_objects do |replacer|
64
+ replacer.replace_self_method(::Bundler, :original_env) { cloned_env }
65
+ block.call
66
+ end
67
+ end
35
68
  end
36
69
  end
37
70
  end