[MacRuby] #1189: ERB.new fails (LocalJumpError) when providing a '<>' trim mode
MacRuby
ruby-noreply at macosforge.org
Thu Mar 10 19:55:05 PST 2011
#1189: ERB.new fails (LocalJumpError) when providing a '<>' trim mode
----------------------------------+-----------------------------------------
Reporter: christian@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: blocker | Milestone:
Component: MacRuby | Keywords: erb
----------------------------------+-----------------------------------------
ERB.new works fine, except if you pass '<>' as the trim_mode for the
template. In that case, it raises a LocalJumpError:
irb(main):001:0> require 'erb'
=> true
irb(main):002:0> ERB.new('Hello, world!')
=> #<ERB:0x20020e480 @safe_level=nil @src="#coding:UTF-8\n_erbout = '';
_erbout.concat \"Hello, world!\"; _erbout.force_encoding(__ENCODING__)"
@enc=#<Encoding:UTF-8> @filename=nil>
irb(main):003:0> ERB.new('Hello, world!', nil, nil)
=> #<ERB:0x2000d3380 @safe_level=nil @src="#coding:UTF-8\n_erbout = '';
_erbout.concat \"Hello, world!\"; _erbout.force_encoding(__ENCODING__)"
@enc=#<Encoding:UTF-8> @filename=nil>
irb(main):004:0> ERB.new('Hello, world!', nil, '')
=> #<ERB:0x2000f75a0 @safe_level=nil @src="#coding:UTF-8\n_erbout = '';
_erbout.concat \"Hello, world!\"; _erbout.force_encoding(__ENCODING__)"
@enc=#<Encoding:UTF-8> @filename=nil>
irb(main):005:0> ERB.new('Hello, world!', nil, '<')
=> #<ERB:0x200229220 @safe_level=nil @src="#coding:UTF-8\n_erbout = '';
_erbout.concat \"Hello, world!\"; _erbout.force_encoding(__ENCODING__)"
@enc=#<Encoding:UTF-8> @filename=nil>
irb(main):006:0> ERB.new('Hello, world!', nil, '<>')
LocalJumpError: no block given
irb(main):007:0>
--
Ticket URL: <http://www.macruby.org/trac/ticket/1189>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list