[Ironruby-core] Core Review: Time and IO#open fixes

Tomas Matousek Tomas.Matousek at microsoft.com
Sun Aug 23 17:51:25 EDT 2009

The IO#open block fix is almost correct yet it should rather be fixed in the RuleControlFlowBuilder.
Since "args.GetBlock() != null" is a dynamic condition (the call-site doesn't statically encode the value of the block) a rule test also needs to be added for nullity of the block. Otherwise call-site caching would be broken.
I'll take a look at it.


-----Original Message-----
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri
Sent: Sunday, August 23, 2009 6:16 AM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] Core Review: Time and IO#open fixes

here are some fixes for bugs I encountered while testing Ruote
(http://github.com/jmettraux/ruote/) with IronRuby. As a side note, Ruote and its test suite depend on about 13 external libraries, and the fact that the number of failing tests is pretty much similar as if the suite was executed under MRI 1.8.6 on Windows is impressive to me.
There is still a bunch of issues though, I will write a report later this week.

* http://github.com/nrk/ironruby/commit/48a4a02b5b47d61f2f7a3f3887ea4bf02d63edb4

Miscellaneous fixes to Time:
 o The local time in Time.at must be computed on the result of the addition of seconds to the UTC value of epoch  o Wrong bitmask in TimeOps.Load(RubyContext,object,MutableString)
used to extract minutes and seconds from the binary data representing a ruby-marshalled instance of DateTime.
 o Time.local/Time.utc:
    . Added support for string and float arguments
    . The month argument is parsed as a number or a three-letter English name when it is string.
    . Added overloads to accepts 10 int/float arguments (C-style gmtime values, Time#to_a)

* http://github.com/nrk/ironruby/commit/87d97c2cea0d917d72c5cd513b793bea3a502d3f

Fixed a NullReferenceException in RubyIOOps.Open() raised when IO#open receives nil as the block parameter.

    irb(main):001:0> File.open("test.txt", &(nil))
    => #<File:test.txt>
    irb(main):002:0> File.open("test.txt", &(Proc.new { |f| puts f.path }))
    => nil

See the attached diff.

Daniele Alessandri

More information about the Ironruby-core mailing list