[Ironruby-core] A couple of doubts (related to Time)

Daniele Alessandri suppakilla at gmail.com
Tue Aug 18 10:04:09 EDT 2009

I encountered a few bugs in IronRuby while running the specs for
rufus-scheduler (http://github.com/jmettraux/rufus-scheduler/). I'm
fixing some of them right now, but in the meanwhile I bumped into a
couple of issues running the rubyspecs for the Time class:

* Time.at creates a dup time object with the value given by time
See http://gist.github.com/169660 . The implementation of
DateTime.Create(object, DateTime) returns a new DateTime created from
self, but the two instances on the "ruby side" have the same
object_id. I investigated a little bit more and noticed that there is
only one DateTime element in the associated _valueTypeInstanceData of
the current RubyContext. Well, no wonder: DateTime is a ValueType, the
two values shares the same hashcode and _valueTypeInstanceData is a
Dictionary<object, RubyInstanceData>. Honestly I don't think this
poses any real problems, but still it is a different behaviour from
the MRI. Thoughts?

* Time.at converts to time object
There was a bug in Time#at which got already fixed on my local
repository, even so this spec is still failing. This time the problem
is related to the rubyspecs: if you take a look at the the localtime
method in rubyspec\core\time\fixtures\methods.rb (it returns the
current local time from the OS), you can note that it works only for
POSIX-systems. I can't think of a good and clean way to get this
fixed, hope to hear Jim's thoughts about this one.


Daniele Alessandri

More information about the Ironruby-core mailing list