deface 1.5.2 → 1.5.3

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/deface.gemspec +1 -1
  3. data/lib/deface/railtie.rb +14 -2
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 040fb8885174112590762a0220dfeb4c1597ff6f4f54804be959d60a9eb80924
4
- data.tar.gz: f87d8e95f18c21a1e75b445556723232365a25003bfdce3898a90c0889eab52d
3
+ metadata.gz: d6fdcb87226be6d4fc38d8b056826594fc3ceb74d9234efcd398817f39121e5a
4
+ data.tar.gz: 7183351e3cd1fe93e4f0d7321e5dbf78f42d9104b465ada920d352d05ebe88b9
5
5
  SHA512:
6
- metadata.gz: 39cab3b39f780056f9c47354f20b868d2409eec007bab49f2b60af96392d34d38d412cd9cee634a64847dcab23552c7a7814b2eb5cebd70534ab380feb7833f8
7
- data.tar.gz: 4d2e948527682681bb53fc8e37aeb7b6f9f71b77f571606ed3e78d59991ae8e7362d6d6319af7f1eb50b0cc52fe279d8bab3daa2f7b34df0b29992a134dae677
6
+ metadata.gz: 828dd08f7d102616db1786851f3e3d9c68aac40a3bc4a2bb04b384d8638e6d38eec98ee76cc5c25d513feb649ea43ff9ad68897b7cb26e2c30fdbcc438d11cd9
7
+ data.tar.gz: cd2f685fd6ad04b559fafadfda375f6f5d58c480db307f34b0d2dddef062d02369f1ed3c8d2dd3f5d7f2a643fe33235291dd55f538a04f1119735eb46e71cbad
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "deface"
3
- s.version = "1.5.2"
3
+ s.version = "1.5.3"
4
4
 
5
5
  s.authors = ["Brian D Quinn"]
6
6
  s.description = "Deface is a library that allows you to customize ERB, Haml and Slim views in a Rails application without editing the underlying view."
@@ -36,7 +36,7 @@ module Deface
36
36
  initializer "deface.tweak_eager_loading", :before => :set_load_path do |app|
37
37
 
38
38
  # application
39
- app.config.eager_load_paths = app.config.eager_load_paths.reject { |path| path.to_s =~ /app\/overrides\z/ }
39
+ tweak_eager_loading(app)
40
40
 
41
41
  # railites / engines / extensions
42
42
  railties = if Rails.version >= "4.0"
@@ -47,8 +47,10 @@ module Deface
47
47
 
48
48
  railties.each do |railtie|
49
49
  next unless railtie.respond_to?(:root) && railtie.config.respond_to?(:eager_load_paths)
50
- railtie.config.eager_load_paths = railtie.config.eager_load_paths.reject { |path| path.to_s =~ /app\/overrides\z/ }
50
+
51
+ tweak_eager_loading(railtie)
51
52
  end
53
+
52
54
  end
53
55
 
54
56
  # sets up deface environment and requires / loads all
@@ -87,5 +89,15 @@ module Deface
87
89
  end
88
90
  end
89
91
 
92
+ private
93
+
94
+ def tweak_eager_loading(railtie)
95
+ paths_to_reject = railtie.config.eager_load_paths.select { |path| path.to_s =~ /app\/overrides\z/ }
96
+ railtie.config.eager_load_paths = railtie.config.eager_load_paths.reject { |path| path.in?(paths_to_reject) }
97
+
98
+ if Rails.version >= "6.0" && Rails.configuration.autoloader == :zeitwerk
99
+ Rails.autoloaders.each { |autoloader| autoloader.ignore(*paths_to_reject) }
100
+ end
101
+ end
90
102
  end
91
103
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deface
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian D Quinn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-17 00:00:00.000000000 Z
11
+ date: 2019-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri