[#5563] Non-overridable and non-redefinable methods — Eric Mahurin <eric_mahurin@...>

Lately, I've been thinking about the future of ruby

44 messages 2005/08/19
[#5564] Re: Non-overridable and non-redefinable methods — Austin Ziegler <halostatue@...> 2005/08/19

On 8/19/05, Eric Mahurin <eric_mahurin@yahoo.com> wrote:

[#5571] Re: Non-overridable and non-redefinable methods — Eric Mahurin <eric_mahurin@...> 2005/08/19

--- Austin Ziegler <halostatue@gmail.com> wrote:

[#5574] Re: Non-overridable and non-redefinable methods — TRANS <transfire@...> 2005/08/20

Just wanted to add a few things.

[#5581] Re: Non-overridable and non-redefinable methods — Austin Ziegler <halostatue@...> 2005/08/20

On 8/19/05, TRANS <transfire@gmail.com> wrote:

[#5583] Re: Non-overridable and non-redefinable methods — "David A. Black" <dblack@...> 2005/08/20

Hi --

[#5585] Re: Non-overridable and non-redefinable methods — Eric Mahurin <eric_mahurin@...> 2005/08/20

--- "David A. Black" <dblack@wobblini.net> wrote:

[#5609] Pathname#walk for traversing path nodes (patch) — ES <ruby-ml@...>

Here is a small addition to Pathname against 1.9, probably suited

20 messages 2005/08/22

Re: YAML.load({nil=>1}.to_yaml) raises exception

From: nobuyoshi nakada <nobuyoshi.nakada@...>
Date: 2005-08-10 07:55:22 UTC
List: ruby-core #5546
Hi,

At Tue, 25 Jan 2005 15:46:37 +0900,
Yukihiro Matsumoto wrote in [ruby-core:04318]:
> It's reported in [ruby-list:40570].
> 
> # ruby -r yaml -e 'YAML.load({nil=>1}.to_yaml)'
> /usr/lib/ruby/1.8/yaml.rb:119:in `load': parse error on line 1, col 1: `: 1' (ArgumentError)
>         from /usr/lib/ruby/1.8/yaml.rb:119:in `load'
>         from -e:1
> 
> Is this a bug?

I believe so.

What about this patch?


Index: lib/yaml/baseemitter.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/yaml/baseemitter.rb,v
retrieving revision 1.6
diff -U2 -p -r1.6 baseemitter.rb
--- lib/yaml/baseemitter.rb	18 Aug 2004 20:42:09 -0000	1.6
+++ lib/yaml/baseemitter.rb	10 Aug 2005 07:49:05 -0000
@@ -173,5 +173,5 @@ module YAML
                         self << "? "
                     end
-                    v[0].to_yaml( :Emitter => self )
+                    v[0].to_yaml( :Emitter => self, :ExplicitValue => true )
                     if v[0].is_complex_yaml?
                         self << "\n"
Index: lib/yaml/rubytypes.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/yaml/rubytypes.rb,v
retrieving revision 1.28
diff -U2 -p -r1.28 rubytypes.rb
--- lib/yaml/rubytypes.rb	7 Jun 2005 16:33:00 -0000	1.28
+++ lib/yaml/rubytypes.rb	10 Aug 2005 07:48:01 -0000
@@ -620,5 +620,5 @@ class NilClass 
 	def to_yaml( opts = {} )
 		opts[:KeepValue] = true
-		"".to_yaml( opts )
+		(opts[:ExplicitValue] ? "null" : "").to_yaml( opts )
 	end
 end


-- 
Nobu Nakada

In This Thread

Prev Next