Permalink
Browse files

Merge pull request #586 from haml/unused-vars

Remove unused variables warnings
  • Loading branch information...
2 parents fe623cf + 3641442 commit f3ebe1cf609c6558f0675ab8d449ddefcb307ea6 @norman norman committed Aug 22, 2012
Showing with 4 additions and 3 deletions.
  1. +2 −2 lib/haml/helpers.rb
  2. +2 −1 lib/haml/helpers/action_view_mods.rb
View
@@ -611,8 +611,8 @@ def haml_buffer
# @return [Proc] A new proc with the new variables bound
def haml_bind_proc(&proc)
_hamlout = haml_buffer
- _erbout = _hamlout.buffer
- _erbout.to_s #"use" the variable to silence warnings
+ #double assignment is to avoid warnings
+ _erbout = _erbout = _hamlout.buffer
proc { |*args| proc.call(*args) }
end
end
@@ -39,7 +39,8 @@ module Helpers
module CaptureHelper
def capture_with_haml(*args, &block)
if Haml::Helpers.block_is_haml?(block)
- _hamlout = eval('_hamlout', block.binding) # Necessary since capture_haml checks _hamlout
+ #double assignment is to avoid warnings
+ _hamlout = _hamlout = eval('_hamlout', block.binding) # Necessary since capture_haml checks _hamlout
value = nil
buffer = capture_haml(*args) { value = yield(*args) }
str =

0 comments on commit f3ebe1c

Please sign in to comment.