wallaby-core 0.2.10 → 0.2.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wallaby/core/version.rb +1 -1
- data/lib/wallaby/engine.rb +12 -12
- data/lib/wallaby/preloader.rb +5 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f1ac3bd8eff66540e6b9f6c6c7b1f569bffe58177134b70fde36bd5b9e3df82
|
4
|
+
data.tar.gz: ec78aac3194fe1dd051160d9f77695247213565260b1035d1aebd7acd84ea1a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5b70441c58655aa2bd9aa49175f137e8680a78619c9a5236e560a912dc86995dba8597a60f54ad90ac3a80a074a4ddb8bfca346c8a73fa772edae8e63aa2fc9
|
7
|
+
data.tar.gz: 459f70f2d01dba201f7873b5a7fa61c33ea3cf8ff8824ea7d33f450878ddbb01242bf71887a3200229cfe44b3c0c70190e76ea165872fe43238e424ed5a0254e
|
data/lib/wallaby/core/version.rb
CHANGED
data/lib/wallaby/engine.rb
CHANGED
@@ -5,27 +5,27 @@ module Wallaby
|
|
5
5
|
class Engine < ::Rails::Engine
|
6
6
|
initializer 'wallaby.development.reload' do |_|
|
7
7
|
# NOTE: Rails reload! will hit here
|
8
|
-
# @see
|
8
|
+
# @see https://rmosolgo.github.io/ruby/rails/2017/04/12/watching-files-during-rails-development.html
|
9
9
|
config.to_prepare do
|
10
|
-
|
11
|
-
|
12
|
-
Preloader.pending!
|
13
|
-
end
|
10
|
+
Map.clear
|
11
|
+
Preloader.clear
|
14
12
|
end
|
15
13
|
end
|
16
14
|
|
17
15
|
config.before_eager_load do
|
18
|
-
|
19
|
-
Logger.debug 'Preload all `app/models` files.', sourcing: false
|
16
|
+
Logger.debug 'Preload all model files before everything else.', sourcing: false
|
20
17
|
Preloader.require_models
|
21
18
|
end
|
22
19
|
|
23
20
|
config.after_initialize do
|
24
|
-
#
|
25
|
-
unless Rails.
|
26
|
-
|
27
|
-
|
28
|
-
|
21
|
+
# Preload will be postponed to Map when `cache_classes` is set to false
|
22
|
+
next unless Rails.configuration.cache_classes
|
23
|
+
# Models are preloaded in `before_eager_load` block,
|
24
|
+
# therefore, it's not essential to preload all files Since Rails will do it
|
25
|
+
next if Rails.configuration.eager_load
|
26
|
+
|
27
|
+
Logger.debug 'Preload all files in model first and non-model last order', sourcing: false
|
28
|
+
Preloader.require_all
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
data/lib/wallaby/preloader.rb
CHANGED
@@ -12,17 +12,16 @@ module Wallaby
|
|
12
12
|
include ActiveModel::Model
|
13
13
|
|
14
14
|
class << self
|
15
|
-
|
16
|
-
|
17
|
-
@pending = true
|
15
|
+
def clear
|
16
|
+
@all_required = nil
|
18
17
|
end
|
19
18
|
|
20
19
|
# Require all files
|
21
20
|
# @see #all_file_paths
|
22
21
|
def require_all
|
23
|
-
return
|
22
|
+
return if @all_required
|
24
23
|
|
25
|
-
@
|
24
|
+
@all_required = true
|
26
25
|
Logger.debug 'Loading all files', sourcing: false
|
27
26
|
new.all_file_paths.each(&method(:require_dependency))
|
28
27
|
end
|
@@ -36,7 +35,7 @@ module Wallaby
|
|
36
35
|
|
37
36
|
# @return [Array<String>] all files under **Rails.configuration.eager_load_paths**
|
38
37
|
def all_file_paths
|
39
|
-
sort
|
38
|
+
sort(all_eager_load_file_paths)
|
40
39
|
end
|
41
40
|
|
42
41
|
# @return [Array<String>] model files under {Wallaby::Configuration#model_paths}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wallaby-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tian Chen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|