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.
- checksums.yaml +4 -4
- data/Gemfile.lock +46 -34
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm/avm.gemspec +2 -2
- data/sub/avm/lib/avm/applications/base.rb +2 -2
- data/sub/avm/lib/avm/entries/auto_values/entry.rb +32 -0
- data/sub/avm/lib/avm/entries/auto_values.rb +11 -0
- data/sub/avm/lib/avm/{instances/entries.rb → entries/base.rb} +9 -5
- data/sub/avm/lib/avm/{instances → entries}/entry.rb +3 -12
- data/sub/avm/lib/avm/entries.rb +9 -0
- data/sub/avm/lib/avm/instances/base/auto_values/admin.rb +2 -2
- data/sub/avm/lib/avm/instances/base/auto_values/database.rb +1 -1
- data/sub/avm/lib/avm/instances/base/auto_values/filesystem.rb +9 -8
- data/sub/avm/lib/avm/instances/base/auto_values/install.rb +48 -0
- data/sub/avm/lib/avm/instances/base/auto_values/mailer.rb +5 -4
- data/sub/avm/lib/avm/instances/base/auto_values/ruby.rb +1 -1
- data/sub/avm/lib/avm/instances/base/auto_values/system.rb +3 -3
- data/sub/avm/lib/avm/instances/base/auto_values.rb +4 -5
- data/sub/avm/lib/avm/instances/base.rb +10 -10
- data/sub/avm/lib/avm/instances/entry_keys.rb +8 -7
- data/sub/avm/lib/avm/instances.rb +3 -2
- data/sub/avm/lib/avm/scms/base.rb +2 -2
- data/sub/avm/lib/avm/source_generators/base.rb +2 -2
- data/sub/avm/lib/avm/sources/base.rb +4 -4
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/avm/lib/avm/with/application_stereotype.rb +35 -0
- data/sub/avm/lib/avm/with/extra_subcommands.rb +44 -0
- data/sub/avm/spec/lib/avm/instances/base_spec.rb +50 -50
- data/sub/avm/spec/lib/avm/instances/base_spec_configs_storage.yml +5 -3
- data/sub/avm-eac_asciidoctor_base0/Gemfile +8 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/avm-eac_asciidoctor_base0.gemspec +0 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/apache_host.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/apache_path.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/deploy.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/instance.rb +0 -0
- 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
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/runners.rb +11 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/base.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/build/file.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/build.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/runner/build.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/runner.rb +0 -0
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners/build.rb +54 -0
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners.rb +13 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0.rb +0 -0
- 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
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/spec/rubocop_spec.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/spec/spec_helper.rb +0 -0
- data/sub/avm-eac_rails_base0/avm-eac_rails_base0.gemspec +3 -3
- data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/version.rb +1 -1
- 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
- data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +3 -2
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit.rb +1 -1
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubygems/gemspec/add_or_replace_gem_line.rb +62 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubygems/gemspec/dependency.rb +19 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubygems/gemspec.rb +42 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
- data/sub/avm-eac_webapp_base0/Gemfile +8 -0
- data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +22 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_host.rb +78 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_path.rb +51 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/appended_directories.rb +25 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/build.rb +48 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb +42 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/git_info.rb +62 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/version.rb +24 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/write_on_target.rb +18 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy.rb +73 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instance/subcommand_parent.rb +24 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instance.rb +62 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/apache_host.rb +35 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/apache_path.rb +40 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data/dump.rb +63 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data/load.rb +55 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data.rb +17 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/deploy.rb +39 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner.rb +12 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/sources/base.rb +15 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/sources.rb +11 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +7 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0.rb +9 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/sources/base_spec.rb +7 -0
- data/sub/avm-eac_webapp_base0/spec/rubocop_spec.rb +3 -0
- data/sub/avm-eac_webapp_base0/spec/spec_helper.rb +4 -0
- data/sub/avm-eac_webapp_base0/template/avm/eac_webapp_base0/apache_host/no_ssl.conf +11 -0
- data/sub/avm-eac_webapp_base0/template/avm/eac_webapp_base0/apache_path/default.conf +9 -0
- data/sub/avm-tools/avm-tools.gemspec +0 -1
- data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
- data/sub/eac_config/eac_config.gemspec +1 -1
- data/sub/eac_config/lib/eac_config/entry_path.rb +15 -4
- data/sub/eac_config/lib/eac_config/version.rb +1 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/regexp_parser.rb +5 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- metadata +112 -42
- data/sub/avm/lib/avm/instances/base/auto_values/access.rb +0 -40
- data/sub/avm/lib/avm/with_application_stereotype.rb +0 -33
- data/sub/avm/lib/avm/with_dynamic_runners.rb +0 -42
- data/sub/avm-tools/lib/avm/tools/runner/app_src/eac_asciidoctor_base0/build.rb +0 -56
- data/sub/avm-tools/lib/avm/tools/runner/app_src/eac_asciidoctor_base0.rb +0 -14
- 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/
|
6
|
-
require 'avm/
|
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::
|
15
|
-
include ::Avm::
|
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
|
data/sub/avm/lib/avm/version.rb
CHANGED
@@ -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
|
-
|
17
|
-
{
|
18
|
-
'app_0'
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
it "
|
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
|
-
|
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
|
-
|
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
|
-
|
16
|
+
install:
|
15
17
|
hostname: myhost.com
|
16
18
|
username: myuser
|
17
19
|
url: ssh://otheruser@otherhost.com
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -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
|
8
|
-
|
9
|
-
class
|
6
|
+
module EacAsciidoctorBase0
|
7
|
+
module Runners
|
8
|
+
class Base < ::Avm::EacWebappBase0::Runner
|
10
9
|
require_sub __FILE__
|
11
10
|
end
|
12
11
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -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
|
File without changes
|
File without changes
|
File without changes
|
data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/spec/rubocop_spec.rb
RENAMED
File without changes
|
data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/spec/spec_helper.rb
RENAMED
File without changes
|
@@ -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.
|
16
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
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.
|
18
|
+
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
19
19
|
end
|
File without changes
|
@@ -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
|
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.
|
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
|
data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubygems/gemspec/add_or_replace_gem_line.rb
ADDED
@@ -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
|
@@ -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
|