izi_lightup 1.0.16 → 1.0.17

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
  SHA256:
3
- metadata.gz: f573f7d4f976500f7b282e1ffd0f4451d5f21819fd00db8eb194f94ac04fce96
4
- data.tar.gz: c22e4553b330af4fa7552bd8824abf415a8716379d40fd27401b479b900d7b96
3
+ metadata.gz: f1c5603ca13de2a4cdacbde2661a234b2bc2840658a261914f35ff47cb98d07e
4
+ data.tar.gz: be1513d0fa4e6cb010e80acb83babff7c4464e7d07f566aec0594d23bf37820d
5
5
  SHA512:
6
- metadata.gz: a937fbf2e756c1f4266921c6e47f3700bcd586c628e0137010e7f5baebe13e7c7b2a0bc2b528c37f21d87b5972f3a55fa828e37b05554d81669e1acd8f554dc6
7
- data.tar.gz: 02a4203383a8f675719a4593c419019e8323de9840eda5bff1640f41cc75dd4e9c03f03a9a71c4d2e8bf239443d0a882afb76c5ba154a24af6998ab0fac3ba3b
6
+ metadata.gz: f879475075c1d7e5915cdfd1b13b9583da64c80eeb88aacde80193c2d6e780b8ad4e1b5a7e1f7c078d415408b38023c9db6b48c8a4e63ac6a32ea5ca2d3058fe
7
+ data.tar.gz: b74a74d53569055e21493ca675c7bfd6a0634e8108201a891fbf0d06c427cc84e926882fa6011a346d9d211e7953968c681967450288ca6a29e57f1aab0edc7e
@@ -63,12 +63,23 @@ module CriticalHelper
63
63
 
64
64
  def scoped_css_files(scope_name)
65
65
  [
66
- File.join(scope_name, "#{controller_path}_#{action_name}.css"),
67
- File.join(scope_name, "#{controller_path}.css"),
68
- File.join(scope_name, "#{controller_name}_#{action_name}.css"),
69
- File.join(scope_name, "#{controller_name}.css"),
70
- "#{scope_name}.css"
71
- ].uniq
66
+ "#{controller_path}_#{action_name}",
67
+ controller_path,
68
+ *scoped_namespace_file(scope_name),
69
+ "#{controller_name}_#{action_name}",
70
+ controller_name,
71
+ scope_name
72
+ ].compact.uniq.map { |l| File.join(scope_name, "#{l}.css") }
73
+ end
74
+
75
+ def scoped_namespace_file(scope_name)
76
+ scopes = []
77
+ return scopes if controller_path == controller_name
78
+
79
+ parts = controller_path.gsub(/\/#{controller_name}$/, '').split('/').reject(&:blank?)
80
+ parts.each { |p| scopes.unshift(File.join([scopes.first, p].compact)) }
81
+
82
+ scopes.uniq
72
83
  end
73
84
 
74
85
  def find_scoped_css(scope_name)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IziLightup
4
- VERSION = '1.0.16'
4
+ VERSION = '1.0.17'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: izi_lightup
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.16
4
+ version: 1.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - IzikAJ
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-16 00:00:00.000000000 Z
11
+ date: 2021-02-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |-
14
14
  Utils to speed up page load by using critical css &