1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Silence uninitialised instance var warning.

Use `haml_buffer` method instead of directly accessing `@haml_buffer`
and check for `@haml_buffer` being defined in method.

Use explicit `haml_buffer` method rather than `attr` as the latter
generates `private attribute?` warning.
This commit is contained in:
Matt Wildig 2012-05-15 23:40:07 +01:00 committed by Norman Clarke
parent cb6e52186e
commit e62101b44f
2 changed files with 3 additions and 3 deletions

View file

@ -11,7 +11,7 @@ module Haml
preamble = <<END.gsub("\n", ";")
begin
extend Haml::Helpers
_hamlout = @haml_buffer = Haml::Buffer.new(@haml_buffer, #{options_for_buffer.inspect})
_hamlout = @haml_buffer = Haml::Buffer.new(haml_buffer, #{options_for_buffer.inspect})
_erbout = _hamlout.buffer
__in_erb_template = true
END

View file

@ -70,7 +70,7 @@ MESSAGE
# context.haml_tag :p, "Stuff"
#
def init_haml_helpers
@haml_buffer = Haml::Buffer.new(@haml_buffer, Haml::Engine.new('').send(:options_for_buffer))
@haml_buffer = Haml::Buffer.new(haml_buffer, Haml::Engine.new('').send(:options_for_buffer))
nil
end
@ -599,7 +599,7 @@ MESSAGE
#
# @return [Haml::Buffer]
def haml_buffer
@haml_buffer
@haml_buffer if defined? @haml_buffer
end
# Gives a proc the same local `_hamlout` and `_erbout` variables