execjs-rails 0.0.6 → 0.0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/execjs/rails/template_resolver.rb +14 -10
- data/lib/execjs/rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b3e545fec27d1e7906a4caa437b281dc5baa428
|
4
|
+
data.tar.gz: ddc613d20daefde8cf884e39363b0a080d8619b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 818b63cf094c9f67d8c5a870d109b34c3d8c76c8daa4673b9109f56d85a22f41bda77cd0287200636136fbba8fcf61003a507f6511c85239c559f8f0fed66a24
|
7
|
+
data.tar.gz: 267e16e2129de9fdb041af3c0a88d057081cd5d1abfc0afab4a7762c9d922865c6a7afe890b42e1661142cb8e2fa69c9ff04e0695043a489fbf9488e268a9cef
|
@@ -3,16 +3,20 @@ module ExecJS
|
|
3
3
|
class TemplateResolver < ::ActionView::Resolver
|
4
4
|
|
5
5
|
def find_templates(name, prefix, partial, details)
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
6
|
+
if details[:formats].include?(:html)
|
7
|
+
path = "#{prefix}/#{name}"
|
8
|
+
[::ActionView::Template.new(
|
9
|
+
"<%= execjs_render('#{path}') %>",
|
10
|
+
"ExecJS - #{path}",
|
11
|
+
ActionView::Template.registered_template_handler(:erb),
|
12
|
+
{
|
13
|
+
format: Mime[:erb],
|
14
|
+
virtual_path: path
|
15
|
+
}
|
16
|
+
)]
|
17
|
+
else
|
18
|
+
[]
|
19
|
+
end
|
16
20
|
end
|
17
21
|
|
18
22
|
end
|
data/lib/execjs/rails/version.rb
CHANGED