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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ae25d6dfca0a562ffb5f882bfec83d9fc4c8b18
4
- data.tar.gz: 5a05931d1441349a22545cc613c0bdcb4d90e704
3
+ metadata.gz: 69f60778d849f743b41ac5100fd22cfee38bd970
4
+ data.tar.gz: da05e0928aa3648b5c49eaffe2be016a44cda5b4
5
5
  SHA512:
6
- metadata.gz: cad795eb510d34f9d0c45c031b178dbe99f51a22c1ce02d9aa4259f7c110ecedc03bf2f3f0d2b39a0b2c876c30d0773f668aceb76e00bd04a3d4697e53a25abd
7
- data.tar.gz: 4e8fc664517f59e3d7702161446b5d24af9d1272eaadd30e6e1fed742b07c3d740935b56ec3cc5284c728d6ff04a1e3369dd6fae34bab237ad236e2c7b487e83
6
+ metadata.gz: bede9faa7728ec1458205353ceff9fe45b4299d8a557adaa432d327677bf78247fd3865d6e03718372e21065acb4eb1253afd6b47a675a024d22456e9facc6e9
7
+ data.tar.gz: f7e231f1dddabd9b740dc46115d9b7154ecb994b7acfdb039c602e6de0289de9fb458fc033f8b17f6f84eb839b9b62f3080caaf1e81b45883b8b74e0519b21b6
@@ -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
- require_relative(components_base_dir.join("#{name}/initialize"))
178
+ require_dependency(components_base_dir.join("#{name}/initialize"))
178
179
  rescue LoadError
179
180
  end
180
181
  end
@@ -1,5 +1,5 @@
1
1
  module Component
2
2
  module Framework
3
- VERSION = "0.2.4"
3
+ VERSION = "0.2.5"
4
4
  end
5
5
  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
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-07-15 00:00:00.000000000 Z
11
+ date: 2019-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler