From: Ross Bamford Date: 2006-02-05T09:28:19+09:00 Subject: Re: built-in vs. standard library On Sat, 04 Feb 2006 23:23:36 -0000, Mark Volkmann wrote: > On 2/4/06, James Edward Gray II wrote: >> On Feb 4, 2006, at 2:57 PM, Mark Volkmann wrote: >> >> > I'm confused about whether the Date class is built-in or in the >> > standard library. >> >> It's a standard library. >> >> > I can use it without requiring it in irb, so that tells me it's >> > built-in. >> >> Na, that tells you that irb requires it somewhere. :) > > Then why does this code run? > > d = Date.new > puts "d is a #{d.class}" > > This is telling me that there is a built-in Date class and there is > another one in the Standard Library. > Just curious, what is your output from this code? p 1 if defined? Date require 'irb' p 2 if defined? Date require 'rubygems' p 3 if defined? Date I just get 3 (which I think is expected). Do you require rubygems in your ..irbrc? or $RUBYOPTS? -- Ross Bamford - rosco@roscopeco.remove.co.uk