ruhl 0.23.0 → 0.24.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/ruhl/engine.rb +18 -8
  3. data/ruhl.gemspec +2 -2
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.23.0
1
+ 0.24.0
data/lib/ruhl/engine.rb CHANGED
@@ -58,12 +58,12 @@ module Ruhl
58
58
  def render_collection
59
59
  actions = ruhl_actions.join(",").to_s.strip if ruhl_actions
60
60
 
61
- current_tag['data-ruhl'] = actions if actions.length > 0
61
+ current_tag['data-ruhl'] = actions unless actions.empty?
62
62
  html = current_tag.to_html
63
63
 
64
64
  new_content = call_result.collect do |item|
65
65
 
66
- if actions.length == 0 && current_tag.xpath('.//*[@data-ruhl]').length == 0
66
+ if actions.empty? && current_tag.xpath('.//*[@data-ruhl]').empty?
67
67
  if item.is_a?(Hash)
68
68
  t = current_tag.dup
69
69
  apply_hash(t, item)
@@ -82,8 +82,9 @@ module Ruhl
82
82
  end
83
83
 
84
84
  def render_block
85
- Ruhl::Engine.new(current_tag.inner_html,
86
- :block_object => call_result).render(scope)
85
+ Ruhl::Engine.
86
+ new(current_tag.inner_html, :block_object => call_result).
87
+ render(scope)
87
88
  end
88
89
 
89
90
  def render_nodes(nodes)
@@ -97,7 +98,7 @@ module Ruhl
97
98
  end
98
99
 
99
100
  return if nodes.empty?
100
-
101
+
101
102
  @current_tag = nodes.first
102
103
 
103
104
  @ruhl_actions = current_tag.remove_attribute('data-ruhl').value.split(',')
@@ -133,10 +134,17 @@ module Ruhl
133
134
  current_tag[attribute] = call_result.to_s
134
135
  end
135
136
  end
137
+ rescue NoMethodError => nme
138
+ Ruhl.logger.error "Processing Ruhl: #{action}"
139
+ Ruhl.logger.error "Current tag.to_s: #{current_tag.to_s}"
140
+ Ruhl.logger.error "Current tag: #{current_tag.inspect}"
141
+ Ruhl.logger.error "Exception message: #{nme.message}"
142
+ Ruhl.logger.error "Exception backtrace: #{nme.backtrace.join("\n")}"
143
+ raise nme
136
144
  end
137
145
 
138
146
  def ruhl_use_if
139
- ruhl_if {ruhl_use }
147
+ ruhl_if{ ruhl_use }
140
148
  end
141
149
 
142
150
  def ruhl_use
@@ -218,9 +226,11 @@ module Ruhl
218
226
  scope.send(*args)
219
227
  end
220
228
  end
221
- rescue NoMethodError => e
229
+ rescue NoMethodError => nme
230
+ Ruhl.logger.error(nme.message)
231
+ Ruhl.logger.error(nme.backtrace.join("\n"))
222
232
  log_context(code)
223
- raise e
233
+ raise nme
224
234
  end
225
235
 
226
236
  def set_scope(current_scope)
data/ruhl.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ruhl}
8
- s.version = "0.23.0"
8
+ s.version = "0.24.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andrew Stone"]
12
- s.date = %q{2009-12-22}
12
+ s.date = %q{2010-01-06}
13
13
  s.description = %q{Make your HTML dynamic with the addition of a data-ruhl attribute.}
14
14
  s.email = %q{andy@stonean.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruhl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.0
4
+ version: 0.24.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Stone
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-22 00:00:00 -05:00
12
+ date: 2010-01-06 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency