view_component-fragment_caching 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21103a5d9df674efecebb73f125a10625180fb3b87e5fccd59f9ed3e67956fda
|
4
|
+
data.tar.gz: cd03c59b1c3fb16f6b87e3a0a4e586674961e3dc6dc339a29e86c608bab1944f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebaf8c548694121e1eccfaef06211957ed10c9bb562f9bdee6d4c975c0dca908aeae37ac640b6c8aad8755d186f7566c18b2baba2ccb8a952d1bd3fcc8af7901
|
7
|
+
data.tar.gz: 23af3729cd0ae8eda74f87ed9fb6d7b2aaa5a6f30e7ffd178796cc8619471be87c2e7364ab1d9dc065e08ddf09d14fcc9177c12975c1f4d72fd8398ceb55686e
|
@@ -9,38 +9,46 @@ module ViewComponent
|
|
9
9
|
|
10
10
|
class PathParser < ActionView::Resolver::PathParser
|
11
11
|
class MatchedAttributes
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
12
|
+
class << self
|
13
|
+
def formats
|
14
|
+
@formats ||= (ActionView::Template::Types.symbols | %i(rb)).map(&Regexp.method(:escape)).join('|').freeze
|
15
|
+
end
|
16
|
+
|
17
|
+
def handlers
|
18
|
+
@handlers ||= ActionView::Template::Handlers.extensions.map(&Regexp.method(:escape)).join('|').freeze
|
19
|
+
end
|
20
|
+
|
21
|
+
def locales
|
22
|
+
@locales ||= '(?!rb)[a-z]{2}(?:-[A-Z]{2})?'.freeze
|
23
|
+
end
|
24
|
+
|
25
|
+
def variants
|
26
|
+
@variants ||= '[^.]*'.freeze
|
27
|
+
end
|
28
|
+
|
29
|
+
def match_names
|
30
|
+
@match_names ||= %i(prefix partial action locale format variant handler).freeze
|
31
|
+
end
|
32
|
+
|
33
|
+
def regex
|
34
|
+
@regex ||= %r{
|
35
|
+
\A
|
36
|
+
(?:(?<prefix>.*)/)?
|
37
|
+
(?<partial>_)?
|
38
|
+
(?<action>.*?)
|
39
|
+
(?:\.(?<locale>#{locales}))??
|
40
|
+
(?:\.(?<format>#{formats}))??
|
41
|
+
(?:\+(?<variant>#{variants}))??
|
42
|
+
(?:\.(?<handler>#{handlers}))?
|
43
|
+
\z
|
44
|
+
}x.freeze
|
45
|
+
end
|
46
|
+
end
|
39
47
|
|
40
48
|
delegate :[], to: :match
|
41
49
|
|
42
50
|
def initialize(path)
|
43
|
-
@match =
|
51
|
+
@match = self.class.regex.match path
|
44
52
|
end
|
45
53
|
|
46
54
|
def format
|
@@ -60,11 +68,11 @@ module ViewComponent
|
|
60
68
|
end
|
61
69
|
|
62
70
|
def method_missing(method_name, *)
|
63
|
-
match[method_name] if
|
71
|
+
match[method_name] if self.class.match_names.include? method_name
|
64
72
|
end
|
65
73
|
|
66
74
|
def respond_to_missing?(method_name)
|
67
|
-
|
75
|
+
self.class.match_names.include? method_name
|
68
76
|
end
|
69
77
|
|
70
78
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: view_component-fragment_caching
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Arnett
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|