lib/async_partial/handlers/haml.rb in async_partial-0.6.0 vs lib/async_partial/handlers/haml.rb in async_partial-0.7.0
- old
+ new
@@ -3,9 +3,24 @@
module AsyncPartial
class HamlArrayBuffer < Array
def html_safe
map {|v| AsyncPartial::AsyncResult === v ? v.value : v}.join.html_safe
end
+
+ def rstrip!
+ if last.frozen?
+ if (stripped = last.dup.rstrip!)
+ self[-1] = stripped
+ end
+ else
+ last.rstrip!
+ end
+ if last.blank?
+ last.pop
+ rstrip!
+ end
+ self
+ end
end
module HamlArrayBufferizer
def initialize(*)
super