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:
parent
cb6e52186e
commit
e62101b44f
2 changed files with 3 additions and 3 deletions
|
@ -11,7 +11,7 @@ module Haml
|
||||||
preamble = <<END.gsub("\n", ";")
|
preamble = <<END.gsub("\n", ";")
|
||||||
begin
|
begin
|
||||||
extend Haml::Helpers
|
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
|
_erbout = _hamlout.buffer
|
||||||
__in_erb_template = true
|
__in_erb_template = true
|
||||||
END
|
END
|
||||||
|
|
|
@ -70,7 +70,7 @@ MESSAGE
|
||||||
# context.haml_tag :p, "Stuff"
|
# context.haml_tag :p, "Stuff"
|
||||||
#
|
#
|
||||||
def init_haml_helpers
|
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
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -599,7 +599,7 @@ MESSAGE
|
||||||
#
|
#
|
||||||
# @return [Haml::Buffer]
|
# @return [Haml::Buffer]
|
||||||
def haml_buffer
|
def haml_buffer
|
||||||
@haml_buffer
|
@haml_buffer if defined? @haml_buffer
|
||||||
end
|
end
|
||||||
|
|
||||||
# Gives a proc the same local `_hamlout` and `_erbout` variables
|
# Gives a proc the same local `_hamlout` and `_erbout` variables
|
||||||
|
|
Loading…
Add table
Reference in a new issue