From: Aaron Patterson Date: 2010-04-12T04:02:50+09:00 Subject: [ruby-core:29457] Re: [Bug #3112] require "yaml" doesn't use psych as default --0OAP2g/MAC+5xKAE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 11, 2010 at 02:04:06PM +0900, NARUSE, Yui wrote: > (2010/04/11 8:48), Aaron Patterson wrote: > > diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/te= st_gem_specification.rb > > index 5979890..337073f 100644 > > --- a/test/rubygems/test_gem_specification.rb > > +++ b/test/rubygems/test_gem_specification.rb > > @@ -1,5 +1,6 @@ > > require_relative 'gemutilities' > > require 'stringio' > > +require 'date' > > require 'rubygems/specification' > >=20 > > class TestGemSpecification< RubyGemTestCase >=20 > This is from the difference of loaded libraries between syck and psych. > So this is considered as compatibility problem and this is fixed by psych. >=20 > Example is following but where "require 'date' is is upon you. >=20 > diff --git a/ext/psych/lib/psych/deprecated.rb b/ext/psych/lib/psych/depr= ecated.rb > index 5a96e91..c0c9abe 100644 > --- a/ext/psych/lib/psych/deprecated.rb > +++ b/ext/psych/lib/psych/deprecated.rb > @@ -1,3 +1,5 @@ > +require 'date' > + > module Psych > module DeprecatedMethods # :nodoc: > attr_accessor :taguri Yes. I will apply this patch, though not requiring 'date' did lead me to find strange code. From lib/rubygems/specification.rb (around line 12): require 'rubygems/version' require 'rubygems/requirement' require 'rubygems/platform' =20 # :stopdoc: class Date; end # for ruby_code if date.rb wasn't required # :startdoc: It seems to be a bug of rubygems to not require 'date'. I will add the require to psych for backwards compatibility, but relying on the YAML parser to require date doesn't seem good. --=20 Aaron Patterson http://tenderlovemaking.com/ --0OAP2g/MAC+5xKAE Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (Darwin) iQEcBAEBAgAGBQJLwhzWAAoJEJUxcLy0/6/GyuYH/RtyuYyH0MrOLq99+Opc8toB cRuQe2/yOqD7aULp7+4apy29EqczbRbU3iQrcX896m86Klmyj4V+EXRVANwfPM5S y0DsCC2SwNEdY01z1/tTGNUSFrKJTZIcRMz3NZWOW3jT59H70bZl7dR5nhhMsqGQ Cpr4M+WmaRH4eHCKQryxBwFCEC4Pu9BJdQsc3cDTHYyer9AomvrEASXQk5KvBp58 xSiJv3G49GNQxmIPr0Lom0XZcDmW/HUK5f3EgBz9aHaommMlhtpen+GKZy+333jD iIj04W83p023DEZNWQxCDIm7su7X/Uxwj8QmL6mtBIf/CyAdybdyVwFPKKbOtMc= =U9Fu -----END PGP SIGNATURE----- --0OAP2g/MAC+5xKAE--