component-framework 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/component/framework.rb +9 -8
- data/lib/component/framework/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69f60778d849f743b41ac5100fd22cfee38bd970
|
4
|
+
data.tar.gz: da05e0928aa3648b5c49eaffe2be016a44cda5b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bede9faa7728ec1458205353ceff9fe45b4299d8a557adaa432d327677bf78247fd3865d6e03718372e21065acb4eb1253afd6b47a675a024d22456e9facc6e9
|
7
|
+
data.tar.gz: f7e231f1dddabd9b740dc46115d9b7154ecb994b7acfdb039c602e6de0289de9fb458fc033f8b17f6f84eb839b9b62f3080caaf1e81b45883b8b74e0519b21b6
|
data/lib/component/framework.rb
CHANGED
@@ -56,11 +56,7 @@ module Component
|
|
56
56
|
# First cycle is a part of Rails initialization, so it's possible to configure Rails env in it
|
57
57
|
# like registering middleware etc.
|
58
58
|
application.initializer :initialize_components, group: :all do |app|
|
59
|
-
|
60
|
-
Component::Framework.log("Load Components Initializers")
|
61
|
-
Component::Framework._load_components_initializers
|
62
|
-
|
63
|
-
components = Component::Framework.get_component_modules
|
59
|
+
components = Component::Framework.get_component_modules(load_initializers: true)
|
64
60
|
Component::Framework.log("Initialize Components")
|
65
61
|
components.each {|component| component.send("init") if component.respond_to?("init") }
|
66
62
|
end
|
@@ -91,9 +87,14 @@ module Component
|
|
91
87
|
|
92
88
|
|
93
89
|
# List of component root modules
|
94
|
-
#
|
90
|
+
# @param load_initializers [bool] force component initialize.rb load
|
95
91
|
# @return [Array<Object>] List of component root modules
|
96
|
-
def self.get_component_modules
|
92
|
+
def self.get_component_modules(load_initializers: false)
|
93
|
+
if load_initializers
|
94
|
+
Component::Framework.log("Load Components Initializers")
|
95
|
+
Component::Framework._load_components_initializers
|
96
|
+
end
|
97
|
+
|
97
98
|
get_component_names.map { |name| component_module_by_name(name) }
|
98
99
|
end
|
99
100
|
|
@@ -174,7 +175,7 @@ module Component
|
|
174
175
|
# initializers are optional, so ignore the missing ones
|
175
176
|
get_component_names.each do |name|
|
176
177
|
begin
|
177
|
-
|
178
|
+
require_dependency(components_base_dir.join("#{name}/initialize"))
|
178
179
|
rescue LoadError
|
179
180
|
end
|
180
181
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: component-framework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Yegorov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|