Issue #8238 has been reported by mjtko (Mark Titorenko).

----------------------------------------
Bug #8238: Prepending any module to DateTime causes infiinite loop when using zone-related methods
https://bugs.ruby-lang.org/issues/8238

Author: mjtko (Mark Titorenko)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.0]


Prepending a Module to DateTime and then inspecting or trying to use any of the methods associated with the timezone causes what appears to be an inifinite loop.

The following code demonstrates the issue:

require 'date'
DateTime.instance_eval { prepend Module.new }
DateTime.now.offset

A cursory inspection shows that similar results (or lack of!) are yielded from #zone, #hour, #minute etc. though #year, #month and #day appear unaffected:

2.0.0p0 :001 > require 'date'
 => true
2.0.0p0 :002 > DateTime.instance_eval { prepend Module.new }
 => DateTime
2.0.0p0 :003 > d = DateTime.now; nil
 => nil
2.0.0p0 :004 > d.year
 => 2013
2.0.0p0 :005 > d.month
 => 4
2.0.0p0 :006 > d.day
 => 8
2.0.0p0 :007 > d.minute
^C



-- 
http://bugs.ruby-lang.org/