props_template 0.30.0 → 0.32.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -2
- data/lib/props_template/layout_patch.rb +8 -10
- data/lib/props_template/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05bab7587c225bf59ec8800ff93dc86ab3644fbf6d5bd477fd8eb6dde8221600
|
4
|
+
data.tar.gz: c5040b7f32f76f616e59fcd92b36e0f819fa2c644c733bd6ad7a5f3d15da78f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98e2d76dd5fc5ce85e785ee79cb022c9c07caa5eb07d48b9ce8527b5572a657160ee2192ff238c5a8405bba6f0f5559a3e1f776795333864e8bd14d6e64ac0c6
|
7
|
+
data.tar.gz: 682f7b508a520d61ca7fec7506f8acf902c89b0c71f021ca8ce43d409ab3e250e00ea36a45f33decf7d5268d650ae2d73c5d34301eb0dfad2c28aa7501a3c75d
|
data/README.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
module Props
|
2
2
|
module LayoutPatch
|
3
3
|
def render_template(view, template, layout_name, locals)
|
4
|
+
unless view.respond_to? :active_template_virtual_path
|
5
|
+
view.instance_eval <<~RUBY, __FILE__, __LINE__ + 1
|
6
|
+
def active_template_virtual_path; "#{template.virtual_path}";end
|
7
|
+
RUBY
|
8
|
+
end
|
9
|
+
|
4
10
|
if template.respond_to?(:handler) && template.handler == Props::Handler && layout_name
|
5
11
|
prepend_formats(template.format)
|
6
12
|
render_props_template(view, template, layout_name, locals)
|
@@ -10,18 +16,10 @@ module Props
|
|
10
16
|
end
|
11
17
|
|
12
18
|
def render_props_template(view, template, path, locals)
|
13
|
-
|
14
|
-
def virtual_path_of_template;"#{template.virtual_path}";end
|
15
|
-
RUBY
|
16
|
-
|
17
|
-
# Deprecated: Usage of virtual_path_of_template in local_assigns will
|
18
|
-
# be removed for a method definition above
|
19
|
-
layout_locals = locals.dup
|
20
|
-
layout_locals[:virtual_path_of_template] = template.virtual_path
|
19
|
+
layout = resolve_layout(path, locals.keys, [formats.first])
|
21
20
|
|
22
|
-
layout = resolve_layout(path, layout_locals.keys, [formats.first])
|
23
21
|
body = if layout
|
24
|
-
layout.render(view,
|
22
|
+
layout.render(view, locals) do |json|
|
25
23
|
template.render(view, locals)
|
26
24
|
end
|
27
25
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: props_template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.32.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johny Ho
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|