rbexy 2.0.0.beta6 → 2.0.0.beta7
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rbexy/component.rb +6 -0
- data/lib/rbexy/rails/component_template_resolver.rb +6 -4
- data/lib/rbexy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97a3fcda88057f9554949f70bbc5dcd30910354e6eb4a4cd1a83e0b53bd30322
|
4
|
+
data.tar.gz: fe5f40ad4f4820233e2c555e9c0d13852774c75e40d03e1ac6357157e87d6a22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d819a2cdd14c75b73b0fc88aabb57cff4666232601a0cf7aeb554a7841313bfdb9f6a56f43d672bec493e14b4a5fcd6f01613ead04ea1609d36e75368352576a
|
7
|
+
data.tar.gz: 18c2566b9851268b689e43800dd0a9876224c181cd089750416fc2202c65613cc57717c3a354c5da90cecbd6cb2258ec911e56aff59dc44739ee1bf14b5bccce
|
data/Gemfile.lock
CHANGED
data/lib/rbexy/component.rb
CHANGED
@@ -51,6 +51,12 @@ module Rbexy
|
|
51
51
|
self.class.call_component? ? call : _render
|
52
52
|
end
|
53
53
|
|
54
|
+
# Explicitly delegate `render` to the view_context rather than super,
|
55
|
+
# so `render partial: "..."` calls run in the expected context.
|
56
|
+
def render(*args)
|
57
|
+
view_context.render(*args)
|
58
|
+
end
|
59
|
+
|
54
60
|
def content
|
55
61
|
content_block ? content_block.call : ""
|
56
62
|
end
|
@@ -6,7 +6,8 @@ module Rbexy
|
|
6
6
|
COMMENT_SYNTAX = {
|
7
7
|
rbx: "# %s",
|
8
8
|
erb: "<%%# %s %%>",
|
9
|
-
|
9
|
+
haml: "-# %s",
|
10
|
+
slim: "/ %s"
|
10
11
|
}
|
11
12
|
|
12
13
|
# Rails 6 requires us to override `_find_all` in order to hook
|
@@ -78,12 +79,13 @@ module Rbexy
|
|
78
79
|
end
|
79
80
|
|
80
81
|
def cachebuster_digest_as_comment(filename, format)
|
82
|
+
comment_template = COMMENT_SYNTAX[format.to_sym]
|
83
|
+
return "" unless comment_template
|
84
|
+
|
81
85
|
source = File.binread(filename)
|
82
86
|
digest = ActiveSupport::Digest.hexdigest(source)
|
83
87
|
|
84
|
-
comment_template
|
85
|
-
comment = comment_template % digest
|
86
|
-
"\n#{comment}"
|
88
|
+
"\n#{comment_template % digest}"
|
87
89
|
end
|
88
90
|
end
|
89
91
|
end
|
data/lib/rbexy/version.rb
CHANGED