caboose-cms 0.9.189 → 0.9.190
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
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1a5083f626c310d7d091961387ba3b51011bf56d
|
|
4
|
+
data.tar.gz: 0a9e90704133f1fd2c1fb76fb502eedd5c53ba2b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5f1246e78cd60901e5c3a49c0afb31a20305eb0ad859213b89b16254a9cbfd9695a67b5b944bd6366099197e5cf7fed00ff0d82525f53ead85c443471e3d53fa
|
|
7
|
+
data.tar.gz: 03186636195d2125d8717a3322496c9bc31d25dae304a7bae0952ee21787283c41a012dbc90491a45b36e8454e8af095da7fd1825090a62c3f2327d5f5f98768
|
data/app/models/caboose/block.rb
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
require 'timeout'
|
|
1
2
|
|
|
2
3
|
class Caboose::Block < ActiveRecord::Base
|
|
3
4
|
self.table_name = "blocks"
|
|
@@ -224,7 +225,7 @@ class Caboose::Block < ActiveRecord::Base
|
|
|
224
225
|
rf = rf.gsub(/<% content_for :css do %>(.*?)<% end %>/m, '')
|
|
225
226
|
options2[:render_function] = rf
|
|
226
227
|
begin
|
|
227
|
-
str = view.render(:partial => "caboose/blocks/render_function", :locals => options2)
|
|
228
|
+
str = Timeout::timeout(3) { view.render(:partial => "caboose/blocks/render_function", :locals => options2) }
|
|
228
229
|
rescue Exception => ex
|
|
229
230
|
msg = block ? (block.block_type ? "Error with #{block.block_type.name} block (block_type_id #{block.block_type.id}, block_id #{block.id})\n" : "Error with block (block_id #{block.id})\n") : ''
|
|
230
231
|
Caboose.log("#{msg}#{ex.message}\n#{ex.backtrace.join("\n")}")
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
<%== ERB.new(render_function).result(self.instance_eval { binding }) %>
|
|
2
2
|
|
|
3
3
|
<% if caboose_js && caboose_js.length > 1 %>
|
|
4
4
|
<% caboose_js.to_a.each_with_index do |js, ind| %>
|
|
5
5
|
<% next if ind == 0 %>
|
|
6
6
|
<% content_for :js do %>
|
|
7
|
-
<%
|
|
8
|
-
|
|
7
|
+
<% begin %>
|
|
8
|
+
<% erb = ERB.new(js).result(self.instance_eval { binding }) %>
|
|
9
|
+
<%== erb %>
|
|
10
|
+
<% rescue %>
|
|
11
|
+
<% Caboose.log("JS ERROR for block #{block.id}") %>
|
|
12
|
+
<% end %>
|
|
9
13
|
<% end %>
|
|
10
14
|
<% end %>
|
|
11
15
|
<% end %>
|
|
@@ -13,8 +17,12 @@
|
|
|
13
17
|
<% caboose_css.to_a.each_with_index do |css, ind| %>
|
|
14
18
|
<% next if ind == 0 %>
|
|
15
19
|
<% content_for :css do %>
|
|
16
|
-
<%
|
|
17
|
-
|
|
20
|
+
<% begin %>
|
|
21
|
+
<% erb = ERB.new(css).result(self.instance_eval { binding }) %>
|
|
22
|
+
<%== erb %>
|
|
23
|
+
<% rescue %>
|
|
24
|
+
<% Caboose.log("CSS ERROR for block #{block.id}") %>
|
|
25
|
+
<% end %>
|
|
18
26
|
<% end %>
|
|
19
27
|
<% end %>
|
|
20
28
|
<% end %>
|
data/lib/caboose/version.rb
CHANGED