turbostreamer 2.0.0 → 2.0.1
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e3e72e6678bcd412cbb0d215d6f06ef53d9d5e34526d178c2f5da72a46f5ba7e
|
|
4
|
+
data.tar.gz: 3de72589884f372a6f2e0e97604c806c0b6887fa9739c1482a62286e2345c63e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 647aace313e96ba1fe5f1dd3ce7375763eb6a4e1b8d9ef1b67229f4aca2a931830578bb4c0f3efbc2017d925b32d4b52bff316ded8e1f8406c6c8b48f61a765a
|
|
7
|
+
data.tar.gz: 4b2a77d229f74dc0076473db500cb945947e6299e9e1fb7af29eeb9f62dcd75e4a710977095230a5828313b4f341aa2bc07c2f018f9b9dab4b814b3ba29f871e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
2.0.1
|
|
4
|
+
-----
|
|
5
|
+
|
|
6
|
+
* Fixed `render plain:`, `html:`, `body:` and `file:` raising
|
|
7
|
+
`NoMethodError: undefined method 'handler'` since 2.0.0. ActionView answers
|
|
8
|
+
them with `Template::Text`, `::HTML` and `::RawFile`, which have no handler,
|
|
9
|
+
and the renderers TurboStreamer prepends for layouts asked every template for
|
|
10
|
+
one before handing it back to ActionView.
|
|
11
|
+
|
|
3
12
|
2.0.0
|
|
4
13
|
-----
|
|
5
14
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
module ActionView::StreamingTurboTemplateRenderer
|
|
11
11
|
|
|
12
12
|
def render_template(view, template, layout_name = nil, locals = {})
|
|
13
|
-
return super unless template
|
|
13
|
+
return super unless streamer_template?(template)
|
|
14
14
|
|
|
15
15
|
locals ||= {}
|
|
16
16
|
layout = layout_name && find_layout(layout_name, locals.keys, [formats.first])
|
|
@@ -13,7 +13,7 @@ module ActionView::TurboTemplateRenderer
|
|
|
13
13
|
# and its `yield` renders the template into the layout's own
|
|
14
14
|
# builder, which is what the streaming renderer does too.
|
|
15
15
|
def render_template(view, template, layout_name, locals)
|
|
16
|
-
return super unless template
|
|
16
|
+
return super unless streamer_template?(template)
|
|
17
17
|
|
|
18
18
|
# find_layout returns nil when the layout exists in another format but
|
|
19
19
|
# not this one -- an app with layouts/application.html.erb and no JSON
|
|
@@ -80,4 +80,10 @@ module ActionView::TurboTemplateRenderer
|
|
|
80
80
|
end
|
|
81
81
|
end
|
|
82
82
|
|
|
83
|
+
# render plain:/html:/body:/file: hand us ActionView::Template::Text,
|
|
84
|
+
# ::HTML or ::RawFile, which have no handler at all.
|
|
85
|
+
def streamer_template?(template)
|
|
86
|
+
template.respond_to?(:handler) && template.handler == TurboStreamer::Handler
|
|
87
|
+
end
|
|
88
|
+
|
|
83
89
|
end
|