[#3726] Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...>

Hi --

15 messages 2004/11/12
[#3749] Re: Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...> 2004/11/16

Hi --

[#3751] Re: Fixnum#clone and Float#clone raise different exceptions — Yukihiro Matsumoto <matz@...> 2004/11/16

Hi,

[#3752] Re: Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...> 2004/11/16

Hi --

[#3785] The latest 1.8.2 cvs prints parse error when starting extension compiling — Yukihiro Matsumoto <matz@...>

Hi,

13 messages 2004/11/23
[#3787] Re: The latest 1.8.2 cvs prints parse error when starting extension compiling — Johan Holmberg <holmberg@...> 2004/11/23

Re: ERB suggestions

From: Gavin Sinclair <gsinclair@...>
Date: 2004-11-16 13:08:12 UTC
List: ruby-core #3750
On Tuesday, November 16, 2004, 10:00:26 PM, Michael wrote:

>> Second, the Ruby 'erb' interface could be much improved.  Code written
>> with it is very cryptic.  I'm happy to prepare a patch, but only if
>> there's support for changing it.

> Can you give an example, how your proposed non-cryptic code would look like?

Instead of

  erb = ERB.new(template_text, 1, '%<>')

the following is at least an improvement.

  erb = ERB.new(template_text, :safe_level => 1, :shortcut => true,
                               :cut_lines => '<>')

I'd prefer

  erb = ERB.new(template_text) do |e|
    e.safe_level = 1
    e.shortcut = true
    e.cut_lines = '<>'      # This is still cryptic, but that's OK.
  end

Gavin




In This Thread

Prev Next