[#4595] New block syntax — Daniel Amelang <daniel.amelang@...>

I'm really sorry if this isn't the place to talk about this. I've

25 messages 2005/03/21
[#4606] Re: New block syntax — "David A. Black" <dblack@...> 2005/03/21

Hi --

[#4629] Re: New block syntax — "Sean E. Russell" <ser@...> 2005/03/30

On Monday 21 March 2005 16:17, David A. Black wrote:

[#4648] about REXML::Encoding — speakillof <speakillof@...>

Hi.

15 messages 2005/03/31
[#4659] Re: about REXML::Encoding — "Sean E. Russell" <ser@...> 2005/04/04

On Thursday 31 March 2005 09:44, speakillof wrote:

Re: [patch] logger.rb - allowing logger to be innitialized in a single line

From: Sam Roberts <sroberts@...>
Date: 2005-03-09 21:25:29 UTC
List: ruby-core #4545
Quoting Daniel.Berger@qwest.com, on Thu, Mar 10, 2005 at 06:16:28AM +0900:
> Hm...how about this modification?

Sure, how about some docs? :-)

Sam

> --- logger.orig	Wed Mar  9 14:03:35 2005
> +++ logger.rb	Wed Mar  9 14:02:32 2005
> @@ -246,6 +246,8 @@
>    # Create an instance.  See Logger::LogDevice.new for more information
> if
>    # required.
>    #
> +  attr_accessor :logdev, :shift_age, :shift_size
> +  attr_reader :level
>    def initialize(logdev, shift_age = 0, shift_size = 1048576)
>      @logdev = nil
>      @progname = nil
> @@ -252,6 +254,7 @@
>      @level = DEBUG
>      @datetime_format = nil
>      @logdev = nil
> +    yield self if block_given?
>      if logdev
>        @logdev = LogDevice.new(logdev, :shift_age => shift_age,
> :shift_size => shift_size)
>      end
> 
> This is similar, but it's a little cleaner I think.  I also provides
> accessors for logdev, shift_age and shift_size, as well as a reader for
> level, which all appear to be missing.
> 
> Regards,
> 
> Dan
> 
> 

In This Thread

Prev Next