Issue #8238 has been updated by naruse (Yui NARUSE).

Target version set to current: 2.1.0


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

Author: mjtko (Mark Titorenko)
Status: Assigned
Priority: High
Assignee: nobu (Nobuyoshi Nakada)
Category: core
Target version: current: 2.1.0
ruby -v: ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.0]
Backport: 


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/
_______________________________________________
ruby-core mailing list
ruby-core / ruby-lang.org
http://lists.ruby-lang.org/cgi-bin/mailman/listinfo/ruby-core