eac_tools 0.12.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +46 -34
  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 +2 -2
  6. data/sub/avm/lib/avm/entries/auto_values/entry.rb +32 -0
  7. data/sub/avm/lib/avm/entries/auto_values.rb +11 -0
  8. data/sub/avm/lib/avm/{instances/entries.rb → entries/base.rb} +9 -5
  9. data/sub/avm/lib/avm/{instances → entries}/entry.rb +3 -12
  10. data/sub/avm/lib/avm/entries.rb +9 -0
  11. data/sub/avm/lib/avm/instances/base/auto_values/admin.rb +2 -2
  12. data/sub/avm/lib/avm/instances/base/auto_values/database.rb +1 -1
  13. data/sub/avm/lib/avm/instances/base/auto_values/filesystem.rb +9 -8
  14. data/sub/avm/lib/avm/instances/base/auto_values/install.rb +48 -0
  15. data/sub/avm/lib/avm/instances/base/auto_values/mailer.rb +5 -4
  16. data/sub/avm/lib/avm/instances/base/auto_values/ruby.rb +1 -1
  17. data/sub/avm/lib/avm/instances/base/auto_values/system.rb +3 -3
  18. data/sub/avm/lib/avm/instances/base/auto_values.rb +4 -5
  19. data/sub/avm/lib/avm/instances/base.rb +10 -10
  20. data/sub/avm/lib/avm/instances/entry_keys.rb +8 -7
  21. data/sub/avm/lib/avm/instances.rb +3 -2
  22. data/sub/avm/lib/avm/scms/base.rb +2 -2
  23. data/sub/avm/lib/avm/source_generators/base.rb +2 -2
  24. data/sub/avm/lib/avm/sources/base.rb +4 -4
  25. data/sub/avm/lib/avm/version.rb +1 -1
  26. data/sub/avm/lib/avm/with/application_stereotype.rb +35 -0
  27. data/sub/avm/lib/avm/with/extra_subcommands.rb +44 -0
  28. data/sub/avm/spec/lib/avm/instances/base_spec.rb +50 -50
  29. data/sub/avm/spec/lib/avm/instances/base_spec_configs_storage.yml +5 -3
  30. data/sub/avm-eac_asciidoctor_base0/Gemfile +8 -0
  31. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/avm-eac_asciidoctor_base0.gemspec +0 -0
  32. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/apache_host.rb +0 -0
  33. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/apache_path.rb +0 -0
  34. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/deploy.rb +0 -0
  35. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/instance.rb +0 -0
  36. data/sub/{avm-tools/lib/avm/tools/runner/eac_asciidoctor_base0.rb → avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/runners/base.rb} +3 -4
  37. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/runners.rb +11 -0
  38. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/base.rb +0 -0
  39. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/build/file.rb +0 -0
  40. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/build.rb +0 -0
  41. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/runner/build.rb +0 -0
  42. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/runner.rb +0 -0
  43. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners/build.rb +54 -0
  44. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners.rb +13 -0
  45. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources.rb +0 -0
  46. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
  47. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0.rb +0 -0
  48. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/spec/lib/avm/eac_asciidoctor_base0/sources/base_spec.rb +0 -0
  49. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/spec/rubocop_spec.rb +0 -0
  50. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/spec/spec_helper.rb +0 -0
  51. data/sub/avm-eac_rails_base0/avm-eac_rails_base0.gemspec +3 -3
  52. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/version.rb +1 -1
  53. data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/spec/{ruby_style_spec.rb → code/rubocop_spec.rb} +0 -0
  54. data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +3 -2
  55. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit.rb +1 -1
  56. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
  57. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubygems/gemspec/add_or_replace_gem_line.rb +62 -0
  58. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubygems/gemspec/dependency.rb +19 -0
  59. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubygems/gemspec.rb +42 -0
  60. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
  61. data/sub/avm-eac_webapp_base0/Gemfile +8 -0
  62. data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +22 -0
  63. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_host.rb +78 -0
  64. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_path.rb +51 -0
  65. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/appended_directories.rb +25 -0
  66. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/build.rb +48 -0
  67. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb +42 -0
  68. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/git_info.rb +62 -0
  69. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/version.rb +24 -0
  70. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/write_on_target.rb +18 -0
  71. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy.rb +73 -0
  72. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instance/subcommand_parent.rb +24 -0
  73. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instance.rb +62 -0
  74. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/apache_host.rb +35 -0
  75. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/apache_path.rb +40 -0
  76. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data/dump.rb +63 -0
  77. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data/load.rb +55 -0
  78. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data.rb +17 -0
  79. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/deploy.rb +39 -0
  80. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner.rb +12 -0
  81. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/sources/base.rb +15 -0
  82. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/sources.rb +11 -0
  83. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +7 -0
  84. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0.rb +9 -0
  85. data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/sources/base_spec.rb +7 -0
  86. data/sub/avm-eac_webapp_base0/spec/rubocop_spec.rb +3 -0
  87. data/sub/avm-eac_webapp_base0/spec/spec_helper.rb +4 -0
  88. data/sub/avm-eac_webapp_base0/template/avm/eac_webapp_base0/apache_host/no_ssl.conf +11 -0
  89. data/sub/avm-eac_webapp_base0/template/avm/eac_webapp_base0/apache_path/default.conf +9 -0
  90. data/sub/avm-tools/avm-tools.gemspec +0 -1
  91. data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
  92. data/sub/eac_config/eac_config.gemspec +1 -1
  93. data/sub/eac_config/lib/eac_config/entry_path.rb +15 -4
  94. data/sub/eac_config/lib/eac_config/version.rb +1 -1
  95. data/sub/eac_ruby_utils/lib/eac_ruby_utils/regexp_parser.rb +5 -0
  96. data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  97. metadata +112 -42
  98. data/sub/avm/lib/avm/instances/base/auto_values/access.rb +0 -40
  99. data/sub/avm/lib/avm/with_application_stereotype.rb +0 -33
  100. data/sub/avm/lib/avm/with_dynamic_runners.rb +0 -42
  101. data/sub/avm-tools/lib/avm/tools/runner/app_src/eac_asciidoctor_base0/build.rb +0 -56
  102. data/sub/avm-tools/lib/avm/tools/runner/app_src/eac_asciidoctor_base0.rb +0 -14
  103. data/sub/avm-tools/sub/avm-eac_asciidoctor_base0/Gemfile +0 -5
@@ -2,8 +2,8 @@
2
2
 
3
3
  require 'avm/registry'
4
4
  require 'avm/scms/null'
5
- require 'avm/with_application_stereotype'
6
- require 'avm/with_dynamic_runners'
5
+ require 'avm/with/application_stereotype'
6
+ require 'avm/with/extra_subcommands'
7
7
  require 'eac_git'
8
8
  require 'eac_ruby_utils/core_ext'
9
9
 
@@ -11,8 +11,8 @@ module Avm
11
11
  module Sources
12
12
  class Base
13
13
  require_sub __FILE__, include_modules: true
14
- include ::Avm::WithApplicationStereotype
15
- include ::Avm::WithDynamicRunners
14
+ include ::Avm::With::ApplicationStereotype
15
+ include ::Avm::With::ExtraSubcommands
16
16
  compare_by :path
17
17
  enable_abstract_methods
18
18
  enable_simple_cache
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avm
4
- VERSION = '0.30.0'
4
+ VERSION = '0.33.0'
5
5
  end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module With
7
+ module ApplicationStereotype
8
+ common_concern do
9
+ include ClassMethods
10
+ end
11
+
12
+ module ClassMethods
13
+ # @return [Avm::ApplicationStereotype::Base]
14
+ def application_stereotype
15
+ @application_stereotype ||=
16
+ ::Avm::Registry.application_stereotypes.detect(application_stereotype_name)
17
+ end
18
+
19
+ # @return [String]
20
+ def application_stereotype_name
21
+ stereotype_namespace_module.name.demodulize
22
+ end
23
+
24
+ # @return [Module]
25
+ def stereotype_namespace_module
26
+ module_parent.module_parent
27
+ end
28
+ end
29
+
30
+ def stereotype_namespace_module
31
+ self.class.stereotype_namespace_module
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/runner_with/subcommands'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module With
8
+ module ExtraSubcommands
9
+ # @return [Hash<String, EacCli::Runner>]
10
+ def extra_available_subcommands
11
+ extra_available_subcommands_from_runners_module
12
+ end
13
+
14
+ # @return [Hash<String, EacCli::Runner>]
15
+ def extra_available_subcommands_from_runners_module
16
+ self.class.ancestors.reverse.inject({}) do |a, e|
17
+ a.merge(RunnersFromModule.new(e).result)
18
+ end
19
+ end
20
+
21
+ class RunnersFromModule
22
+ enable_simple_cache
23
+ common_constructor :the_module
24
+
25
+ # @return [Hash<String, EacCli::Runner>]
26
+ def result
27
+ return {} if runners_module.blank?
28
+
29
+ ::EacCli::RunnerWith::Subcommands.subcommands_from_module(runners_module)
30
+ end
31
+
32
+ def runners_module_uncached
33
+ return nil if the_module.module_parent.blank?
34
+
35
+ begin
36
+ the_module.module_parent.const_get('Runners')
37
+ rescue ::NameError
38
+ nil
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -13,56 +13,56 @@ RSpec.describe ::Avm::Instances::Base do
13
13
  .stub_eac_config_node(self, ::File.join(__dir__, 'base_spec_configs_storage.yml'))
14
14
 
15
15
  describe '#read_entry' do
16
- context 'when a auto value is requested' do
17
- {
18
- 'app_0' => {
19
- fs_path: '/fs_root/app_0',
20
- data_fs_path: '/data_fs_root/app_0',
21
- ::Avm::Instances::EntryKeys::DATABASE_NAME => 'app_0',
22
- ::Avm::Instances::EntryKeys::DATABASE_USERNAME => 'user1',
23
- ::Avm::Instances::EntryKeys::DATABASE_PASSWORD => 'pass1',
24
- ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => 'database.net',
25
- ::Avm::Instances::EntryKeys::DATABASE_PORT => 5432,
26
- ::Avm::Instances::EntryKeys::SSH_HOSTNAME => 'myhost.com',
27
- ::Avm::Instances::EntryKeys::SSH_USERNAME => 'myuser',
28
- ::Avm::Instances::EntryKeys::SSH_URL => 'ssh://otheruser@otherhost.com'
29
- },
30
- 'app_2' => {
31
- ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => '127.0.0.1',
32
- ::Avm::Instances::EntryKeys::SOURCE_INSTANCE_ID => 'app_dev'
33
- },
34
- 'app_3' => {
35
- ::Avm::Instances::EntryKeys::DATABASE_SYSTEM => 'postgresql',
36
- ::Avm::Instances::EntryKeys::DATABASE_NAME => 'app_1_db',
37
- ::Avm::Instances::EntryKeys::DATABASE_USERNAME => 'user1',
38
- ::Avm::Instances::EntryKeys::DATABASE_PASSWORD => 'pass1',
39
- ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => 'database.net',
40
- ::Avm::Instances::EntryKeys::DATABASE_PORT => 5432,
41
- ::Avm::Instances::EntryKeys::MAILER_ID => 'mailer_0',
42
- ::Avm::Instances::EntryKeys::MAILER_FROM => 'noreply@example.net',
43
- ::Avm::Instances::EntryKeys::MAILER_REPLY_TO => nil,
44
- ::Avm::Instances::EntryKeys::MAILER_SMTP_ADDRESS => 'smtp.example.net',
45
- ::Avm::Instances::EntryKeys::MAILER_SMTP_PORT => '587',
46
- ::Avm::Instances::EntryKeys::MAILER_SMTP_DOMAIN => 'example.net',
47
- ::Avm::Instances::EntryKeys::MAILER_SMTP_USERNAME => 'a_user',
48
- ::Avm::Instances::EntryKeys::MAILER_SMTP_PASSWORD => 'a_secret',
49
- ::Avm::Instances::EntryKeys::MAILER_SMTP_AUTHENTICATION => 'plain',
50
- ::Avm::Instances::EntryKeys::MAILER_SMTP_STARTTLS_AUTO => 'true'
51
- },
52
- 'mailer_0' => {
53
- ::Avm::Instances::EntryKeys::MAILER_FROM => 'noreply@example.net',
54
- ::Avm::Instances::EntryKeys::MAILER_REPLY_TO => '',
55
- ::Avm::Instances::EntryKeys::MAILER_SMTP_ADDRESS => 'smtp.example.net',
56
- ::Avm::Instances::EntryKeys::MAILER_SMTP_PORT => '587',
57
- ::Avm::Instances::EntryKeys::MAILER_SMTP_DOMAIN => 'example.net',
58
- ::Avm::Instances::EntryKeys::MAILER_SMTP_USERNAME => 'a_user',
59
- ::Avm::Instances::EntryKeys::MAILER_SMTP_PASSWORD => 'a_secret',
60
- ::Avm::Instances::EntryKeys::MAILER_SMTP_AUTHENTICATION => 'plain',
61
- ::Avm::Instances::EntryKeys::MAILER_SMTP_STARTTLS_AUTO => 'true'
62
- }
63
- }.each do |instance_id, values|
64
- values.each do |input, expected|
65
- it "read entry #{instance_id}.#{input} should return \"#{expected}\"" do
16
+ {
17
+ 'app_0' => {
18
+ fs_path: '/fs_root/app_0',
19
+ data_fs_path: '/data_fs_root/app_0',
20
+ ::Avm::Instances::EntryKeys::DATABASE_NAME => 'app_0',
21
+ ::Avm::Instances::EntryKeys::DATABASE_USERNAME => 'user1',
22
+ ::Avm::Instances::EntryKeys::DATABASE_PASSWORD => 'pass1',
23
+ ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => 'database.net',
24
+ ::Avm::Instances::EntryKeys::DATABASE_PORT => 5432,
25
+ ::Avm::Instances::EntryKeys::INSTALL_HOSTNAME => 'myhost.com',
26
+ ::Avm::Instances::EntryKeys::INSTALL_USERNAME => 'myuser',
27
+ ::Avm::Instances::EntryKeys::INSTALL_URL => 'ssh://otheruser@otherhost.com'
28
+ },
29
+ 'app_2' => {
30
+ ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => '127.0.0.1',
31
+ ::Avm::Instances::EntryKeys::SOURCE_INSTANCE_ID => 'app_dev'
32
+ },
33
+ 'app_3' => {
34
+ ::Avm::Instances::EntryKeys::DATABASE_SYSTEM => 'postgresql',
35
+ ::Avm::Instances::EntryKeys::DATABASE_NAME => 'app_1_db',
36
+ ::Avm::Instances::EntryKeys::DATABASE_USERNAME => 'user1',
37
+ ::Avm::Instances::EntryKeys::DATABASE_PASSWORD => 'pass1',
38
+ ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => 'database.net',
39
+ ::Avm::Instances::EntryKeys::DATABASE_PORT => 5432,
40
+ ::Avm::Instances::EntryKeys::MAILER_ID => 'mailer_0',
41
+ ::Avm::Instances::EntryKeys::MAILER_FROM => 'noreply@example.net',
42
+ ::Avm::Instances::EntryKeys::MAILER_REPLY_TO => nil,
43
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_ADDRESS => 'smtp.example.net',
44
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_PORT => '587',
45
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_DOMAIN => 'example.net',
46
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_USERNAME => 'a_user',
47
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_PASSWORD => 'a_secret',
48
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_AUTHENTICATION => 'plain',
49
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_STARTTLS_AUTO => 'true'
50
+ },
51
+ 'mailer_0' => {
52
+ ::Avm::Instances::EntryKeys::MAILER_FROM => 'noreply@example.net',
53
+ ::Avm::Instances::EntryKeys::MAILER_REPLY_TO => '',
54
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_ADDRESS => 'smtp.example.net',
55
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_PORT => '587',
56
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_DOMAIN => 'example.net',
57
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_USERNAME => 'a_user',
58
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_PASSWORD => 'a_secret',
59
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_AUTHENTICATION => 'plain',
60
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_STARTTLS_AUTO => 'true'
61
+ }
62
+ }.each do |instance_id, values|
63
+ values.each do |input, expected|
64
+ context "when a auto value is requested for \"#{instance_id}.#{input}\"" do
65
+ it ".read_entry should return \"#{expected}\"" do
66
66
  expect(described_class.by_id(instance_id).read_entry(input)).to eq(expected)
67
67
  end
68
68
  end
@@ -1,17 +1,19 @@
1
1
  ---
2
2
  app_0:
3
- host_id: app_1
3
+ install:
4
+ id: app_1
4
5
  app_1:
5
6
  fs_path: /fs_root
6
7
  data_fs_path: /data_fs_root
7
- host_id: app_2
8
+ install:
9
+ id: app_2
8
10
  database:
9
11
  name: app_1_db
10
12
  username: user1
11
13
  password: pass1
12
14
  hostname: database.net
13
15
  app_2:
14
- ssh:
16
+ install:
15
17
  hostname: myhost.com
16
18
  username: myuser
17
19
  url: ssh://otheruser@otherhost.com
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
6
+
7
+ local_gemfile = ::File.join(::File.dirname(__FILE__), 'Gemfile.local')
8
+ eval_gemfile local_gemfile if ::File.exist?(local_gemfile)
@@ -1,12 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'avm/eac_webapp_base0/runner'
4
- require 'avm/eac_asciidoctor_base0'
5
4
 
6
5
  module Avm
7
- module Tools
8
- class Runner
9
- class EacAsciidoctorBase0 < ::Avm::EacWebappBase0::Runner
6
+ module EacAsciidoctorBase0
7
+ module Runners
8
+ class Base < ::Avm::EacWebappBase0::Runner
10
9
  require_sub __FILE__
11
10
  end
12
11
  end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacAsciidoctorBase0
7
+ module Runners
8
+ require_sub __FILE__
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/tools/core_ext'
4
+ require 'avm/eac_asciidoctor_base0/sources/build'
5
+ require 'os'
6
+
7
+ module Avm
8
+ module EacAsciidoctorBase0
9
+ module Sources
10
+ module Runners
11
+ class Build
12
+ runner_with :help do
13
+ desc 'Build the project'
14
+ arg_opt '-d', '--target-dir', 'Directory to build'
15
+ bool_opt '--open', 'Show the result.'
16
+ end
17
+
18
+ def run
19
+ start_banner
20
+ build.run
21
+ open
22
+ end
23
+
24
+ private
25
+
26
+ def build_uncached
27
+ ::Avm::EacAsciidoctorBase0::Sources::Build.new(runner_context.call(:project),
28
+ target_directory: parsed.target_dir)
29
+ end
30
+
31
+ def default_target_directory
32
+ runner_context.call(:project).root.join('build')
33
+ end
34
+
35
+ def open
36
+ return unless parsed.open?
37
+
38
+ infom "Opening \"#{open_path}\"..."
39
+ ::EacRubyUtils::Envs.local.command(OS.open_file_command, open_path).system!
40
+ end
41
+
42
+ def open_path
43
+ build.source_files.first.target_path
44
+ end
45
+
46
+ def start_banner
47
+ runner_context.call(:project_banner)
48
+ infov 'Target directory', build.target_directory
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacAsciidoctorBase0
7
+ module Sources
8
+ module Runners
9
+ require_sub __FILE__
10
+ end
11
+ end
12
+ end
13
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacAsciidoctorBase0
5
- VERSION = '0.3.4'
5
+ VERSION = '0.4.0'
6
6
  end
7
7
  end
@@ -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.3'
16
- s.add_dependency 'eac_ruby_utils', '~> 0.80', '>= 0.80.2'
15
+ s.add_dependency 'avm-eac_rails_base1', '~> 0.4', '>= 0.4.2'
16
+ s.add_dependency 'eac_ruby_utils', '~> 0.97'
17
17
 
18
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.4'
18
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
19
19
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRailsBase0
5
- VERSION = '0.6.0'
5
+ VERSION = '0.6.1'
6
6
  end
7
7
  end
@@ -12,9 +12,10 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib,template}/**/*']
14
14
 
15
- s.add_dependency 'avm-eac_ruby_base1', '~> 0.9', '>= 0.9.1'
15
+ s.add_dependency 'avm', '~> 0.31'
16
+ s.add_dependency 'avm-eac_ruby_base1', '~> 0.11'
16
17
  s.add_dependency 'avm-eac_webapp_base0', '~> 0.3'
17
- s.add_dependency 'eac_ruby_utils', '~> 0.95', '>= 0.95.2'
18
+ s.add_dependency 'eac_ruby_utils', '~> 0.97'
18
19
 
19
20
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
20
21
  end
@@ -38,7 +38,7 @@ module Avm
38
38
  end
39
39
 
40
40
  def user
41
- instance.ssh_username
41
+ instance.install_username
42
42
  end
43
43
 
44
44
  private
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRailsBase1
5
- VERSION = '0.4.1'
5
+ VERSION = '0.4.2'
6
6
  end
7
7
  end
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRubyBase1
7
+ module Rubygems
8
+ class Gemspec
9
+ class AddOrReplaceGemLine
10
+ enable_method_class
11
+ common_constructor :sender, :gem_name, :gem_specs
12
+ delegate :lines, to: :sender
13
+
14
+ DEPENDENCY_PREFIX = ' s.add_dependency'
15
+
16
+ def existing_gem_line_index
17
+ lines.index { |line| line.start_with?(gem_line_prefix) }
18
+ end
19
+
20
+ def result
21
+ if existing_gem_line_index.present?
22
+ replace_line
23
+ else
24
+ add_line
25
+ end
26
+ end
27
+
28
+ def add_line
29
+ lines.insert(add_line_index, new_gem_line)
30
+ end
31
+
32
+ def add_line_index
33
+ (gems_lines_start_index..(lines.count - 1)).each do |e|
34
+ return e if new_gem_line < lines[e]
35
+ end
36
+ lines.count
37
+ end
38
+
39
+ def gems_lines_start_index
40
+ lines.index { |line| line.start_with?(DEPENDENCY_PREFIX) } || lines.count
41
+ end
42
+
43
+ def new_gem_line
44
+ ([gem_line_prefix] + quoted_gem_specs).join(', ')
45
+ end
46
+
47
+ def gem_line_prefix
48
+ "#{DEPENDENCY_PREFIX} '#{gem_name}'"
49
+ end
50
+
51
+ def replace_line
52
+ lines[existing_gem_line_index] = new_gem_line
53
+ end
54
+
55
+ def quoted_gem_specs
56
+ gem_specs.map { |gem_spec| "'#{gem_spec}'" }
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRubyBase1
7
+ module Rubygems
8
+ class Gemspec
9
+ class Dependency
10
+ common_constructor :gemspec, :gem_name
11
+
12
+ def version_specs=(version_specs)
13
+ gemspec.add_or_replace_gem_line(gem_name, version_specs)
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRubyBase1
7
+ module Rubygems
8
+ class Gemspec
9
+ require_sub __FILE__, require_dependency: true
10
+
11
+ DEPENDENCY_LINE_PARSER = /s\.add_dependency\s*'(\S+)'/.to_parser { |m| m[1] }
12
+
13
+ class << self
14
+ def from_file(path)
15
+ new(path.read.each_line.map(&:rstrip))
16
+ end
17
+ end
18
+
19
+ common_constructor :lines
20
+
21
+ # @return [Avm::EacRubyBase1::Bundler::Gemfile::Dependency]
22
+ def dependency(gem_name)
23
+ ::Avm::EacRubyBase1::Rubygems::Gemspec::Dependency.new(self, gem_name)
24
+ end
25
+
26
+ # @return [Array<Avm::EacRubyBase1::Bundler::Gemfile::Dependency>]
27
+ def dependencies
28
+ lines.lazy.map { |line| DEPENDENCY_LINE_PARSER.parse(line) }.reject(&:blank?)
29
+ .map { |gem_name| dependency(gem_name) }.to_a
30
+ end
31
+
32
+ def write(path)
33
+ path.to_pathname.write(to_text)
34
+ end
35
+
36
+ def to_text
37
+ lines.map { |line| "#{line}\n" }.join
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRubyBase1
5
- VERSION = '0.11.0'
5
+ VERSION = '0.12.0'
6
6
  end
7
7
  end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
6
+
7
+ local_gemfile = ::File.join(::File.dirname(__FILE__), 'Gemfile.local')
8
+ eval_gemfile local_gemfile if ::File.exist?(local_gemfile)
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.push File.expand_path('lib', __dir__)
4
+
5
+ require 'avm/eac_webapp_base0/version'
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = 'avm-eac_webapp_base0'
9
+ s.version = Avm::EacWebappBase0::VERSION
10
+ s.authors = ['Put here the authors']
11
+ s.summary = 'Put here de description.'
12
+
13
+ s.files = Dir['{lib,template}/**/*']
14
+
15
+ s.add_dependency 'avm', '~> 0.1'
16
+ s.add_dependency 'avm-eac_generic_base0', '~> 0.1'
17
+ s.add_dependency 'avm-eac_postgresql_base0', '~> 0.1'
18
+ s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.3'
19
+ s.add_dependency 'eac_ruby_utils', '~> 0.68'
20
+
21
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
22
+ end