eac_tools 0.10.0 → 0.12.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 +12 -13
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm/lib/avm/application_stereotypes/base.rb +11 -1
- data/sub/avm/lib/avm/applications/base/stereotype.rb +31 -0
- data/sub/avm/lib/avm/applications/base.rb +17 -0
- data/sub/avm/lib/avm/registry/application_stereotypes/build_available.rb +9 -6
- data/sub/avm/lib/avm/registry/application_stereotypes/stereotype_builder.rb +8 -5
- data/sub/avm/lib/avm/registry/application_stereotypes.rb +26 -10
- data/sub/avm/lib/avm/registry/instances.rb +1 -1
- data/sub/avm/lib/avm/registry/source_generators.rb +16 -0
- data/sub/avm/lib/avm/registry.rb +2 -1
- data/sub/avm/lib/avm/scms/base.rb +2 -0
- data/sub/avm/lib/avm/source_generators/base.rb +29 -0
- data/sub/avm/lib/avm/source_generators.rb +9 -0
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/avm/lib/avm/with_application_stereotype.rb +11 -1
- data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/source_generators/base.rb +13 -0
- 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/Gemfile +11 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/Rakefile +8 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/app/assets/config/manifest.js +3 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/app/assets/javascripts/application.js +1 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/app/assets/stylesheets/application.scss +1 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/app/controllers/application_controller.rb +4 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/app/controllers/welcome_controller.rb +5 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/app/views/welcome/index.html.erb +1 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/bin/bundle +5 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/bin/rails +11 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/bin/rake +11 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/bin/yarn +11 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config/application.rb +11 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config/boot.rb +5 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config/cable.yml +8 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config/credentials.yml.enc +1 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config/environment.rb +7 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config/puma.rb +39 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config/routes.rb +5 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config/spring.rb +8 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config.ru +7 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/db/schema.rb +1 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/lib/ability.rb +20 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/lib/ability_mapping.rb +10 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/public/favicon.ico +0 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/spec/ruby_style_spec.rb +3 -0
- data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/spec/spec_helper.rb +8 -0
- data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +1 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb +14 -0
- data/sub/{avm-tools/lib/avm/tools/runner/eac_redmine_base0 → avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners}/docker.rb +3 -3
- data/sub/{avm-tools/lib/avm/tools/runner/eac_redmine_base0 → avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners}/project_rename.rb +3 -3
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners.rb +13 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/runners/base.rb +25 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners/core_update.rb +1 -3
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
- data/sub/avm-tools/README.textile +0 -11
- data/sub/avm-tools/avm-tools.gemspec +1 -3
- data/sub/avm-tools/lib/avm/tools/runner/instance/info.rb +1 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance.rb +6 -1
- data/sub/avm-tools/lib/avm/tools/runner/source_generate.rb +45 -0
- data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/require_sub/base.rb +67 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/require_sub/sub_file.rb +68 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/require_sub.rb +2 -125
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/{require_sub_spec → require_sub/base_spec}/stubbed_module_a.rb +0 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/{require_sub_spec → require_sub/base_spec}/stubbed_not_module.rb +0 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/{require_sub_spec.rb → require_sub/base_spec.rb} +1 -1
- metadata +57 -16
- data/sub/avm/lib/avm/application_stereotypes/base/by_gem.rb +0 -17
- data/sub/avm/lib/avm/application_stereotypes/base/detection.rb +0 -34
- data/sub/avm-tools/lib/avm/tools/runner/eac_redmine_base0.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8e7fe08b68334a93a53b8f91d2becce812f7e5489d36af3718477d77d651cbc
|
4
|
+
data.tar.gz: 484af66fe24d6907d195fb67af719ad79299d3ba978e2387e92737b2c1c72c8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76be1cd01e6f3874a9c3a0a987592cdee9957b723f0ed0dab109f95a0541abd49d62e76a1f3f6da2d633de6ba6bcc115893eb5b44f18180c1deba40c5c7c9b5d
|
7
|
+
data.tar.gz: 8d814b9bfa7c899a56a2721088e6285ca17af658c3e500ff64075682a59eccb0c7347145c2887313c2520cd9315916ff4c73529dc775f5714561b2c3581711b0
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
eac_tools (0.
|
4
|
+
eac_tools (0.12.0)
|
5
5
|
avm-eac_generic_base0 (~> 0.4)
|
6
|
-
avm-eac_rails_base0 (~> 0.
|
6
|
+
avm-eac_rails_base0 (~> 0.6)
|
7
7
|
avm-eac_rails_base1 (~> 0.4, >= 0.4.1)
|
8
|
-
avm-eac_redmine_base0 (~> 0.
|
8
|
+
avm-eac_redmine_base0 (~> 0.11)
|
9
9
|
avm-eac_redmine_plugin_base0 (~> 0.3)
|
10
10
|
avm-eac_ruby_base1 (~> 0.11)
|
11
|
-
avm-tools (~> 0.
|
12
|
-
eac_ruby_utils (~> 0.96)
|
11
|
+
avm-tools (~> 0.127)
|
12
|
+
eac_ruby_utils (~> 0.96, >= 0.96.1)
|
13
13
|
|
14
14
|
PATH
|
15
15
|
remote: sub/avm-eac_generic_base0
|
@@ -21,7 +21,7 @@ PATH
|
|
21
21
|
PATH
|
22
22
|
remote: sub/avm-eac_rails_base0
|
23
23
|
specs:
|
24
|
-
avm-eac_rails_base0 (0.
|
24
|
+
avm-eac_rails_base0 (0.6.0)
|
25
25
|
avm-eac_rails_base1 (~> 0.3)
|
26
26
|
eac_ruby_utils (~> 0.80, >= 0.80.2)
|
27
27
|
|
@@ -36,7 +36,8 @@ PATH
|
|
36
36
|
PATH
|
37
37
|
remote: sub/avm-eac_redmine_base0
|
38
38
|
specs:
|
39
|
-
avm-eac_redmine_base0 (0.
|
39
|
+
avm-eac_redmine_base0 (0.11.0)
|
40
|
+
avm (~> 0.29)
|
40
41
|
avm-eac_generic_base0 (~> 0.4)
|
41
42
|
avm-eac_rails_base1 (~> 0.4, >= 0.4.1)
|
42
43
|
avm-eac_ubuntu_base0 (~> 0.3)
|
@@ -63,12 +64,10 @@ PATH
|
|
63
64
|
PATH
|
64
65
|
remote: sub/avm-tools
|
65
66
|
specs:
|
66
|
-
avm-tools (0.
|
67
|
+
avm-tools (0.127.0)
|
67
68
|
aranha-parsers (~> 0.4)
|
68
|
-
avm (~> 0.
|
69
|
+
avm (~> 0.30)
|
69
70
|
avm-eac_asciidoctor_base0 (~> 0.3, >= 0.3.4)
|
70
|
-
avm-eac_rails_base0 (~> 0.3)
|
71
|
-
avm-eac_redmine_base0 (~> 0.5, >= 0.5.2)
|
72
71
|
avm-eac_ruby_base1 (~> 0.8)
|
73
72
|
avm-eac_ubuntu_base0 (~> 0.3)
|
74
73
|
avm-files (~> 0.1)
|
@@ -82,7 +81,7 @@ PATH
|
|
82
81
|
PATH
|
83
82
|
remote: sub/avm
|
84
83
|
specs:
|
85
|
-
avm (0.
|
84
|
+
avm (0.30.0)
|
86
85
|
eac_cli (~> 0.27, >= 0.27.6)
|
87
86
|
eac_config (~> 0.9)
|
88
87
|
eac_docker (~> 0.3)
|
@@ -135,7 +134,7 @@ PATH
|
|
135
134
|
PATH
|
136
135
|
remote: sub/eac_ruby_utils
|
137
136
|
specs:
|
138
|
-
eac_ruby_utils (0.96.
|
137
|
+
eac_ruby_utils (0.96.1)
|
139
138
|
activesupport (>= 4, < 7)
|
140
139
|
addressable (~> 2.6)
|
141
140
|
bundler
|
data/lib/eac_tools/version.rb
CHANGED
@@ -5,7 +5,11 @@ require 'eac_ruby_utils/core_ext'
|
|
5
5
|
module Avm
|
6
6
|
module ApplicationStereotypes
|
7
7
|
class Base
|
8
|
-
|
8
|
+
enable_listable
|
9
|
+
lists.add_symbol :resource, :instance, :source, :source_generator
|
10
|
+
common_constructor :namespace_module, :resources do
|
11
|
+
self.resources = self.class.lists.resource.hash_keys_validate!(resources)
|
12
|
+
end
|
9
13
|
|
10
14
|
# @return [String]
|
11
15
|
def name
|
@@ -16,6 +20,12 @@ module Avm
|
|
16
20
|
def to_s
|
17
21
|
name
|
18
22
|
end
|
23
|
+
|
24
|
+
lists.resource.each_value do |resource|
|
25
|
+
define_method "#{resource}_class" do
|
26
|
+
resources[resource]
|
27
|
+
end
|
28
|
+
end
|
19
29
|
end
|
20
30
|
end
|
21
31
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/registry'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Applications
|
7
|
+
class Base
|
8
|
+
module Stereotype
|
9
|
+
# @return [Avm::ApplicationStereotypes::Base, nil]
|
10
|
+
def stereotype_by_configuration
|
11
|
+
entry('stereotype').optional_value.if_present do |v|
|
12
|
+
::Avm::Registry.application_stereotypes.detect(v)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
# @return [Avm::ApplicationStereotypes::Base, nil]
|
17
|
+
def stereotype_by_source
|
18
|
+
::Avm::Registry.application_stereotypes.detect_optional(local_source.class)
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
# @return [Avm::ApplicationStereotypes::Base]
|
24
|
+
def stereotype_uncached
|
25
|
+
stereotype_by_configuration || stereotype_by_source ||
|
26
|
+
raise("Could not find stereotype for application \"#{self}\"")
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -1,13 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/instances/entries'
|
4
|
+
require 'avm/registry'
|
4
5
|
require 'eac_ruby_utils/core_ext'
|
5
6
|
|
6
7
|
module Avm
|
7
8
|
module Applications
|
8
9
|
class Base
|
10
|
+
enable_simple_cache
|
11
|
+
require_sub __FILE__, include_modules: true
|
9
12
|
include ::Avm::Instances::Entries
|
10
13
|
|
14
|
+
LOCAL_INSTANCE_SUFFIX = 'dev'
|
15
|
+
|
11
16
|
common_constructor :id do
|
12
17
|
self.id = id.to_s
|
13
18
|
end
|
@@ -23,6 +28,18 @@ module Avm
|
|
23
28
|
def name
|
24
29
|
entry(::Avm::Instances::EntryKeys::NAME).read
|
25
30
|
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
# @return [Avm::Instances::Base]
|
35
|
+
def local_instance_uncached
|
36
|
+
instance(LOCAL_INSTANCE_SUFFIX)
|
37
|
+
end
|
38
|
+
|
39
|
+
# @return [Avm::Sources::Base]
|
40
|
+
def local_source_uncached
|
41
|
+
::Avm::Registry.sources.detect(local_instance.fs_path)
|
42
|
+
end
|
26
43
|
end
|
27
44
|
end
|
28
45
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'avm/application_stereotypes/base'
|
3
4
|
require 'avm/registry/application_stereotypes/stereotype_builder'
|
4
5
|
require 'eac_ruby_utils/core_ext'
|
5
6
|
|
@@ -13,8 +14,7 @@ module Avm
|
|
13
14
|
|
14
15
|
def result
|
15
16
|
reset_buffer
|
16
|
-
|
17
|
-
read_sources_registry
|
17
|
+
read_registries
|
18
18
|
buffer.values.map(&:build)
|
19
19
|
end
|
20
20
|
|
@@ -29,12 +29,15 @@ module Avm
|
|
29
29
|
buffer[object.stereotype_namespace_module].add_object(type, object)
|
30
30
|
end
|
31
31
|
|
32
|
-
def
|
33
|
-
::Avm::
|
32
|
+
def read_registries
|
33
|
+
::Avm::ApplicationStereotypes::Base.lists.resource.each_value do |resource|
|
34
|
+
read_registry(resource)
|
35
|
+
end
|
34
36
|
end
|
35
37
|
|
36
|
-
def
|
37
|
-
::Avm::Registry.
|
38
|
+
def read_registry(resource)
|
39
|
+
::Avm::Registry.send(resource.to_s.pluralize).available
|
40
|
+
.each { |obj| read_object(resource, obj) }
|
38
41
|
end
|
39
42
|
|
40
43
|
def reset_buffer
|
@@ -10,20 +10,23 @@ module Avm
|
|
10
10
|
common_constructor :namespace_module
|
11
11
|
|
12
12
|
def add_object(type, object)
|
13
|
-
|
14
|
-
raise "#{attr_method} is already present" if
|
13
|
+
type = type.to_sym
|
14
|
+
raise "#{attr_method} is already present" if resources.key?(type)
|
15
15
|
|
16
|
-
|
16
|
+
resources[::Avm::ApplicationStereotypes::Base.lists.resource.value_validate!(type)] =
|
17
|
+
object
|
17
18
|
end
|
18
19
|
|
19
20
|
# @return [Avm::ApplicationStereotypes::Base]
|
20
21
|
def build
|
21
|
-
::Avm::ApplicationStereotypes::Base.new(namespace_module,
|
22
|
+
::Avm::ApplicationStereotypes::Base.new(namespace_module, resources)
|
22
23
|
end
|
23
24
|
|
24
25
|
private
|
25
26
|
|
26
|
-
|
27
|
+
def resources
|
28
|
+
@resources ||= {}
|
29
|
+
end
|
27
30
|
end
|
28
31
|
end
|
29
32
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'avm/instances/base'
|
4
|
+
require 'avm/sources/base'
|
3
5
|
require 'eac_ruby_utils/core_ext'
|
4
6
|
|
5
7
|
module Avm
|
@@ -10,26 +12,40 @@ module Avm
|
|
10
12
|
|
11
13
|
common_constructor :module_suffix
|
12
14
|
|
15
|
+
def detect(obj)
|
16
|
+
detect_optional(obj) || raise_not_found(obj)
|
17
|
+
end
|
18
|
+
|
19
|
+
def detect_optional(obj)
|
20
|
+
detect_by_instance_class(obj) || detect_by_source_class(obj) || detecy_by_name(obj)
|
21
|
+
end
|
22
|
+
|
13
23
|
private
|
14
24
|
|
15
25
|
def available_uncached
|
16
26
|
build_available
|
17
27
|
end
|
18
28
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
29
|
+
def detect_by_instance_class(obj)
|
30
|
+
return nil unless obj.is_a?(::Class) && obj < ::Avm::Instances::Base
|
31
|
+
|
32
|
+
available.find { |a| a.instance_class == obj }
|
23
33
|
end
|
24
34
|
|
25
|
-
def
|
26
|
-
|
27
|
-
|
35
|
+
def detecy_by_name(obj)
|
36
|
+
return nil unless obj.is_a?(::String)
|
37
|
+
|
38
|
+
available.find { |a| a.name == obj }
|
39
|
+
end
|
40
|
+
|
41
|
+
def detect_by_source_class(obj)
|
42
|
+
return nil unless obj.is_a?(::Class) && obj < ::Avm::Sources::Base
|
43
|
+
|
44
|
+
available.find { |a| a.source_class == obj }
|
28
45
|
end
|
29
46
|
|
30
|
-
def
|
31
|
-
|
32
|
-
.map { |klass| class_detect(klass, registered_initialize_args) }.find(&:present?)
|
47
|
+
def raise_not_found(obj)
|
48
|
+
raise("No registered module valid for #{obj} (Available: #{available.join(', ')})")
|
33
49
|
end
|
34
50
|
end
|
35
51
|
end
|
@@ -9,7 +9,7 @@ module Avm
|
|
9
9
|
# @return [Avm::Instances::Base, nil]
|
10
10
|
def class_detect(klass, detect_args)
|
11
11
|
r = ::Avm::Instances::Base.by_id(*detect_args)
|
12
|
-
r.application.stereotype.instance_class == klass ?
|
12
|
+
r.application.stereotype.instance_class == klass ? klass.by_id(*detect_args) : nil
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/instances/base'
|
4
|
+
require 'avm/registry/from_gems'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Registry
|
8
|
+
class SourceGenerators < ::Avm::Registry::FromGems
|
9
|
+
# @return [Avm::Instances::Base, nil]
|
10
|
+
def class_detect(klass, detect_args)
|
11
|
+
stereotype_name, target_path = detect_args
|
12
|
+
klass.application_stereotype.name == stereotype_name ? klass.new(target_path) : nil
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/sub/avm/lib/avm/registry.rb
CHANGED
@@ -7,7 +7,8 @@ module Avm
|
|
7
7
|
module Registry
|
8
8
|
require_sub __FILE__
|
9
9
|
enable_listable
|
10
|
-
lists.add_symbol :category, :application_stereotypes, :instances, :runners, :scms,
|
10
|
+
lists.add_symbol :category, :application_stereotypes, :instances, :runners, :scms,
|
11
|
+
:source_generators, :sources
|
11
12
|
|
12
13
|
WITH_PATH = [CATEGORY_SCMS, CATEGORY_SOURCES].freeze
|
13
14
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'avm/with_application_stereotype'
|
3
4
|
require 'eac_ruby_utils/core_ext'
|
4
5
|
|
5
6
|
module Avm
|
@@ -7,6 +8,7 @@ module Avm
|
|
7
8
|
class Base
|
8
9
|
enable_abstract_methods
|
9
10
|
enable_simple_cache
|
11
|
+
include ::Avm::WithApplicationStereotype
|
10
12
|
abstract_methods :update, :valid?
|
11
13
|
common_constructor :path do
|
12
14
|
self.path = path.to_pathname
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/with_application_stereotype'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module SourceGenerators
|
8
|
+
class Base
|
9
|
+
include ::Avm::WithApplicationStereotype
|
10
|
+
common_constructor :target_path do
|
11
|
+
self.target_path = target_path.to_pathname
|
12
|
+
end
|
13
|
+
|
14
|
+
def perform
|
15
|
+
assert_clear_directory
|
16
|
+
apply_template
|
17
|
+
end
|
18
|
+
|
19
|
+
def assert_clear_directory
|
20
|
+
target_path.mkpath
|
21
|
+
raise "\"#{target_path}\" is not empty" if target_path.children.any?
|
22
|
+
end
|
23
|
+
|
24
|
+
def apply_template
|
25
|
+
template.apply(self, target_path)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/sub/avm/lib/avm/version.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'eac_cli/runner_with/subcommands'
|
4
3
|
require 'eac_ruby_utils/core_ext'
|
5
4
|
|
6
5
|
module Avm
|
@@ -10,6 +9,17 @@ module Avm
|
|
10
9
|
end
|
11
10
|
|
12
11
|
module ClassMethods
|
12
|
+
# @return [Avm::ApplicationStereotype::Base]
|
13
|
+
def application_stereotype
|
14
|
+
@application_stereotype ||=
|
15
|
+
::Avm::Registry.application_stereotypes.detect(application_stereotype_name)
|
16
|
+
end
|
17
|
+
|
18
|
+
# @return [String]
|
19
|
+
def application_stereotype_name
|
20
|
+
stereotype_namespace_module.name.demodulize
|
21
|
+
end
|
22
|
+
|
13
23
|
# @return [Module]
|
14
24
|
def stereotype_namespace_module
|
15
25
|
module_parent.module_parent
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
gem 'eac_rails_base0'
|
6
|
+
gem 'eac_rails_gem_support', group: :development
|
7
|
+
|
8
|
+
# Local gems
|
9
|
+
::Dir["#{__dir__}/{sub/gems,engines}/*/*.gemspec"].each do |file|
|
10
|
+
gem ::File.basename(::File.dirname(file)), path: ::File.dirname(file)
|
11
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
4
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
5
|
+
|
6
|
+
require_relative 'config/application'
|
7
|
+
|
8
|
+
Rails.application.load_tasks
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require eac_rails_base0
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "eac_rails_base0";
|
@@ -0,0 +1 @@
|
|
1
|
+
<p>Bem-vindo!</p>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
begin
|
5
|
+
load File.expand_path('spring', __dir__)
|
6
|
+
rescue LoadError => e
|
7
|
+
raise unless e.message.include?('spring')
|
8
|
+
end
|
9
|
+
APP_PATH = File.expand_path('../config/application', __dir__)
|
10
|
+
require_relative '../config/boot'
|
11
|
+
require 'rails/commands'
|
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
5
|
+
Dir.chdir(APP_ROOT) do
|
6
|
+
exec 'yarnpkg', *ARGV
|
7
|
+
rescue Errno::ENOENT
|
8
|
+
warn 'Yarn executable was not detected in the system.'
|
9
|
+
warn 'Download Yarn at https://yarnpkg.com/en/docs/install'
|
10
|
+
exit 1
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
APP_PATH = ::File.dirname(__dir__) unless defined?(APP_PATH)
|
4
|
+
require File.expand_path('boot', __dir__)
|
5
|
+
require 'eac_rails_base0/app_base/application.rb'
|
6
|
+
|
7
|
+
module EacRailsBase0App
|
8
|
+
class Application
|
9
|
+
config.load_defaults 5.2
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
XKDkD3DioFn69hXAhH88mw9ZFRjDdarYU+7htxgTJmBB/vg45Hsb7pBJQaySoc7VD0Vb838ShDeVbhDlSc3PMtIcV6fU/nkYqc+Nu8heKF5mhJmgJmf2Vlp2ZgqVA04PxvmZ/U2FRx40c9welNpABmDn0V33qUsjkrVMqKuyxD9aTpuAFd4SiH7SzA8Is1v7ltr3+Rx0lA/LI2u87uxYBawE7G3sNQA9siEnSPNm24uEK+4GcIuVG0qIvx36uYyBjB8dfn9FaMec/+22EFNKO0JWjIFXRl+TosE3VLFssaMQ2sl0rRkesLzb2DMFO/7kp0T3c1EcvRmy0AJ3UQmKZCtYBzy2a/9rx8sh1a+AUHObSeSeaP4eu+sMnMhSsDhveUiYMnV8viJXj0G0V6UIWP4j+Bv96H/AFgNi--OD4Iuvmt7P3BlyOR--nzDLthG3dBOX14A2J5s4CA==
|
data/sub/avm-eac_rails_base0/template/avm/eac_rails_base0/source_generators/base/config/puma.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Puma can serve each request in a thread from an internal thread pool.
|
4
|
+
# The `threads` method setting takes two numbers: a minimum and maximum.
|
5
|
+
# Any libraries that use thread pools should be configured to match
|
6
|
+
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
7
|
+
# and maximum; this matches the default thread size of Active Record.
|
8
|
+
#
|
9
|
+
threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
|
10
|
+
threads threads_count, threads_count
|
11
|
+
|
12
|
+
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
|
13
|
+
#
|
14
|
+
port ENV.fetch('PORT') { 3000 }
|
15
|
+
|
16
|
+
# Specifies the `environment` that Puma will run in.
|
17
|
+
#
|
18
|
+
environment ENV.fetch('RAILS_ENV') { 'development' }
|
19
|
+
|
20
|
+
# Specifies the `pidfile` that Puma will use.
|
21
|
+
pidfile ENV.fetch('PIDFILE') { 'tmp/pids/server.pid' }
|
22
|
+
|
23
|
+
# Specifies the number of `workers` to boot in clustered mode.
|
24
|
+
# Workers are forked webserver processes. If using threads and workers together
|
25
|
+
# the concurrency of the application would be max `threads` * `workers`.
|
26
|
+
# Workers do not work on JRuby or Windows (both of which do not support
|
27
|
+
# processes).
|
28
|
+
#
|
29
|
+
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
30
|
+
|
31
|
+
# Use the `preload_app!` method when specifying a `workers` number.
|
32
|
+
# This directive tells Puma to first boot the application and load code
|
33
|
+
# before forking the application. This takes advantage of Copy On Write
|
34
|
+
# process behavior so workers use less memory.
|
35
|
+
#
|
36
|
+
# preload_app!
|
37
|
+
|
38
|
+
# Allow puma to be restarted by `rails restart` command.
|
39
|
+
plugin :tmp_restart
|