haml-edge 2.3.239 → 2.3.240

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.
data/EDGE_GEM_VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.239
1
+ 2.3.240
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.239
1
+ 2.3.240
@@ -169,6 +169,22 @@ module ActionView
169
169
  alias_method :form_for_without_haml, :form_for
170
170
  alias_method :form_for, :form_for_with_haml
171
171
  end
172
+
173
+ module CacheHelper
174
+ # This is a workaround for a Rails 3 bug
175
+ # that's present at least through beta 3.
176
+ # Their fragment_for assumes that the block
177
+ # will return its contents as a string,
178
+ # which is not always the case.
179
+ # Luckily, it only makes this assumption if caching is disabled,
180
+ # so we only override that case.
181
+ def fragment_for_with_haml(*args, &block)
182
+ return fragment_for_without_haml(*args, &block) if controller.perform_caching
183
+ capture(&block)
184
+ end
185
+ alias_method :fragment_for_without_haml, :fragment_for
186
+ alias_method :fragment_for, :fragment_for_with_haml
187
+ end
172
188
  else
173
189
  module FormTagHelper
174
190
  def form_tag_with_haml(url_for_options = {}, options = {}, *parameters_for_url, &proc)
@@ -401,6 +401,17 @@ window.location.reload();
401
401
  HTML
402
402
  = update_page do |p|
403
403
  - p.reload
404
+ HAML
405
+ end
406
+
407
+ def test_cache
408
+ @base.controller = ActionController::Base.new
409
+ @base.controller.perform_caching = false
410
+ assert_equal(<<HTML, render(<<HAML, :action_view))
411
+ Test
412
+ HTML
413
+ - cache do
414
+ Test
404
415
  HAML
405
416
  end
406
417
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml-edge
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.239
4
+ version: 2.3.240
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Weizenbaum