Code Review: core/module/autoload


#1

http://github.com/jschementi/ironruby/commit/bbfa3c4a35cc331e58fb9da9a4097de86ed0dbff

autoload uses ‘/’ to join load-path and autoload-path.
Fixes http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=674

This makes Rails 2.3.2 startup without any modifications! =)

Changes:

Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/module/autoload_spec.rb

Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/module/fixtures/autoload_join.rb

  • Merlin/Main/Languages/Ruby/Ruby/Runtime/Loader.cs

#2

Looks good.

JD


#3

/ is not appended if the path ends with /. It is if it ends with \ -
which seems like a bug in Ruby that we shouldn’t copy.
Could you rather implement " Combine" somewhere (in RubyUtils e.g.) that
uses / for joining paths but checks if the directory ends with \ or /?

Tomas


#4

http://github.com/jschementi/ironruby/commit/78bd7541cebae33b3b07bfed17ce74a63ecb49d4

Code review updates:

  • Don’t combine paths with ‘/’ if the base-path already ends with ‘/’ or
    ‘\’

    • Merlin/Main/Languages/Ruby/Ruby/Runtime/Loader.cs
    • Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyUtils.cs

#5

Looks good.

Tomas