caboose-cms 0.9.189 → 0.9.190

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 293cf2e6ac743d9d1d145c21bf8ef8be48bd8b61
4
- data.tar.gz: c14236e34426a873a50cdbefc9aea45d64e3ee6b
3
+ metadata.gz: 1a5083f626c310d7d091961387ba3b51011bf56d
4
+ data.tar.gz: 0a9e90704133f1fd2c1fb76fb502eedd5c53ba2b
5
5
  SHA512:
6
- metadata.gz: 79f25b17a9b2e70ff36e43859187636cfde3460a9bfd01752c2569200c3e5e9aae2b661a1a435e47f9b6e2418a3d83ad92bedddc295776a5c5b1eb2b076308d2
7
- data.tar.gz: c52d82c43c417d6ff988b0111570e415146ea01b3f3f0727885286aadfae6f8f4b0001e296505368de8038916a86f6a715bee89d1009a01d459e04b579bf97d9
6
+ metadata.gz: 5f1246e78cd60901e5c3a49c0afb31a20305eb0ad859213b89b16254a9cbfd9695a67b5b944bd6366099197e5cf7fed00ff0d82525f53ead85c443471e3d53fa
7
+ data.tar.gz: 03186636195d2125d8717a3322496c9bc31d25dae304a7bae0952ee21787283c41a012dbc90491a45b36e8454e8af095da7fd1825090a62c3f2327d5f5f98768
@@ -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
- <%= raw ERB.new(render_function).result(self.instance_eval { binding }) %>
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
- <% erb = ERB.new(js).result(self.instance_eval { binding }) %>
8
- <%== erb %>
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
- <% erb = ERB.new(css).result(self.instance_eval { binding }) %>
17
- <%== erb %>
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 %>
@@ -26,7 +26,7 @@ def get_message(fs)
26
26
  field = "field#{ind}_name".to_sym
27
27
  value = "field#{ind}_value".to_sym
28
28
  if fs[field] == 'message' || fs[field] == 'message_required'
29
- return fs[value]
29
+ return fs[value].nil? ? '' : fs[value]
30
30
  break
31
31
  end
32
32
  end
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.9.189'
2
+ VERSION = '0.9.190'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.189
4
+ version: 0.9.190
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry