Forum: IronRuby Code Review: __FILE__ and $PROGRAM_NAME paths

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Jimmy S. (Guest)
on 2009-04-21 02:38
(Received via mailing list)
http://github.com/jschementi/ironruby/commit/3ef1b...

Makes __FILE__ and $PROGRAM_NAME (and $0) have canonicalized paths when
Ruby is hosted from ir.exe. However, __FILE__ is not messed with when
including a file via require/load. Fixes
http://ironruby.codeplex.com/WorkItem/View.aspx?Wo....
Jim D. (Guest)
on 2009-04-21 06:02
(Received via mailing list)
Comment left on Github:

Can you move the fixtures up a level and combine them? (Put them in
rubyspec/fixtures instead of rubyspec/command_line/fixtures and
rubyspec/language/fixtures)

Also, shouldn't we move Glob.CanonicalizePath to a more central
location, then use that central location for both the hosting and the
Glob implementation? Seems like this couples the hosting API to Glob,
which doesn't seem good.
Other than that it looks good.

JD

From: Jimmy S.
Sent: Monday, April 20, 2009 3:37 PM
To: removed_email_address@domain.invalid
Cc: IronRuby External Code R.
Subject: Code Review: __FILE__ and $PROGRAM_NAME paths

http://github.com/jschementi/ironruby/commit/3ef1b...

Makes __FILE__ and $PROGRAM_NAME (and $0) have canonicalized paths when
Ruby is hosted from ir.exe. However, __FILE__ is not messed with when
including a file via require/load. Fixes
http://ironruby.codeplex.com/WorkItem/View.aspx?Wo....
Jimmy S. (Guest)
on 2009-04-22 04:20
(Received via mailing list)
http://github.com/jschementi/ironruby/commit/57d18...

Code Review changes
- Moves command_line/fixtures/file* and language/fixtures/file* to
fixtures/
- Create RubyUtils.CanonicalizePath, to dependency on
IronRuby.Builtins.Glob from IronRuby.Hosting

    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/command_line/fixtures/file.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/command_line/fixtures/file/sub.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/command_line/program_name_spec.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/fixtures/file.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/fixtures/file/sub.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/language/file_spec.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/language/fixtures/file.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/language/fixtures/file/sub.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/language/predefined_spec.rb
    * Merlin/Main/Languages/Ruby/Ruby/Builtins/Glob.cs
    * Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyCommandLine.cs
    * Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyOptionsParser.cs
    * Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyUtils.cs

From: Jim D.
Sent: Monday, April 20, 2009 6:53 PM
To: Jimmy S.; removed_email_address@domain.invalid
Cc: IronRuby External Code R.
Subject: RE: Code Review: __FILE__ and $PROGRAM_NAME paths

Comment left on Github:

Can you move the fixtures up a level and combine them? (Put them in
rubyspec/fixtures instead of rubyspec/command_line/fixtures and
rubyspec/language/fixtures)

Also, shouldn't we move Glob.CanonicalizePath to a more central
location, then use that central location for both the hosting and the
Glob implementation? Seems like this couples the hosting API to Glob,
which doesn't seem good.
Other than that it looks good.

JD

From: Jimmy S.
Sent: Monday, April 20, 2009 3:37 PM
To: removed_email_address@domain.invalid
Cc: IronRuby External Code R.
Subject: Code Review: __FILE__ and $PROGRAM_NAME paths

http://github.com/jschementi/ironruby/commit/3ef1b...

Makes __FILE__ and $PROGRAM_NAME (and $0) have canonicalized paths when
Ruby is hosted from ir.exe. However, __FILE__ is not messed with when
including a file via require/load. Fixes
http://ironruby.codeplex.com/WorkItem/View.aspx?Wo....
Tomas M. (Guest)
on 2009-04-22 04:38
(Received via mailing list)
Could you remove

public static MutableString/*!*/ CanonicalizePath(MutableString/*!*/
path) {
   return RubyUtils.CanonicalizePath(path);
}

from Glob and call RubyUtils directly wherever Glob.CanonicalizePath is
used?

Other than that looks good.

Tomas


From: Jimmy S.
Sent: Tuesday, April 21, 2009 5:19 PM
To: Jim D.; removed_email_address@domain.invalid
Cc: IronRuby External Code R.
Subject: RE: Code Review: __FILE__ and $PROGRAM_NAME paths

http://github.com/jschementi/ironruby/commit/57d18...

Code Review changes
- Moves command_line/fixtures/file* and language/fixtures/file* to
fixtures/
- Create RubyUtils.CanonicalizePath, to dependency on
IronRuby.Builtins.Glob from IronRuby.Hosting

    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/command_line/fixtures/file.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/command_line/fixtures/file/sub.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/command_line/program_name_spec.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/fixtures/file.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/fixtures/file/sub.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/language/file_spec.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/language/fixtures/file.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/language/fixtures/file/sub.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/language/predefined_spec.rb
    * Merlin/Main/Languages/Ruby/Ruby/Builtins/Glob.cs
    * Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyCommandLine.cs
    * Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyOptionsParser.cs
    * Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyUtils.cs

From: Jim D.
Sent: Monday, April 20, 2009 6:53 PM
To: Jimmy S.; removed_email_address@domain.invalid
Cc: IronRuby External Code R.
Subject: RE: Code Review: __FILE__ and $PROGRAM_NAME paths

Comment left on Github:

Can you move the fixtures up a level and combine them? (Put them in
rubyspec/fixtures instead of rubyspec/command_line/fixtures and
rubyspec/language/fixtures)

Also, shouldn't we move Glob.CanonicalizePath to a more central
location, then use that central location for both the hosting and the
Glob implementation? Seems like this couples the hosting API to Glob,
which doesn't seem good.
Other than that it looks good.

JD

From: Jimmy S.
Sent: Monday, April 20, 2009 3:37 PM
To: removed_email_address@domain.invalid
Cc: IronRuby External Code R.
Subject: Code Review: __FILE__ and $PROGRAM_NAME paths

http://github.com/jschementi/ironruby/commit/3ef1b...

Makes __FILE__ and $PROGRAM_NAME (and $0) have canonicalized paths when
Ruby is hosted from ir.exe. However, __FILE__ is not messed with when
including a file via require/load. Fixes
http://ironruby.codeplex.com/WorkItem/View.aspx?Wo....
Jimmy S. (Guest)
on 2009-04-22 22:40
(Received via mailing list)
http://github.com/jschementi/ironruby/commit/43514...

Remove Glob.CanonicalizePath (in favor of RubyUtils.CanonicalizePath)


-
Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/FileOps.cs

-          Merlin/Main/Languages/Ruby/Ruby/Builtins/Glob.cs

From: Tomas M.
Sent: Tuesday, April 21, 2009 5:38 PM
To: Jimmy S.; Jim D.; removed_email_address@domain.invalid
Cc: IronRuby External Code R.
Subject: RE: Code Review: __FILE__ and $PROGRAM_NAME paths

Could you remove

public static MutableString/*!*/ CanonicalizePath(MutableString/*!*/
path) {
   return RubyUtils.CanonicalizePath(path);
}

from Glob and call RubyUtils directly wherever Glob.CanonicalizePath is
used?

Other than that looks good.

Tomas


From: Jimmy S.
Sent: Tuesday, April 21, 2009 5:19 PM
To: Jim D.; removed_email_address@domain.invalid
Cc: IronRuby External Code R.
Subject: RE: Code Review: __FILE__ and $PROGRAM_NAME paths

http://github.com/jschementi/ironruby/commit/57d18...

Code Review changes
- Moves command_line/fixtures/file* and language/fixtures/file* to
fixtures/
- Create RubyUtils.CanonicalizePath, to dependency on
IronRuby.Builtins.Glob from IronRuby.Hosting

    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/command_line/fixtures/file.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/command_line/fixtures/file/sub.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/command_line/program_name_spec.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/fixtures/file.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/fixtures/file/sub.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/language/file_spec.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/language/fixtures/file.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/language/fixtures/file/sub.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/language/predefined_spec.rb
    * Merlin/Main/Languages/Ruby/Ruby/Builtins/Glob.cs
    * Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyCommandLine.cs
    * Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyOptionsParser.cs
    * Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyUtils.cs

From: Jim D.
Sent: Monday, April 20, 2009 6:53 PM
To: Jimmy S.; removed_email_address@domain.invalid
Cc: IronRuby External Code R.
Subject: RE: Code Review: __FILE__ and $PROGRAM_NAME paths

Comment left on Github:

Can you move the fixtures up a level and combine them? (Put them in
rubyspec/fixtures instead of rubyspec/command_line/fixtures and
rubyspec/language/fixtures)

Also, shouldn't we move Glob.CanonicalizePath to a more central
location, then use that central location for both the hosting and the
Glob implementation? Seems like this couples the hosting API to Glob,
which doesn't seem good.
Other than that it looks good.

JD

From: Jimmy S.
Sent: Monday, April 20, 2009 3:37 PM
To: removed_email_address@domain.invalid
Cc: IronRuby External Code R.
Subject: Code Review: __FILE__ and $PROGRAM_NAME paths

http://github.com/jschementi/ironruby/commit/3ef1b...

Makes __FILE__ and $PROGRAM_NAME (and $0) have canonicalized paths when
Ruby is hosted from ir.exe. However, __FILE__ is not messed with when
including a file via require/load. Fixes
http://ironruby.codeplex.com/WorkItem/View.aspx?Wo....
Tomas M. (Guest)
on 2009-04-22 22:40
(Received via mailing list)
Looks good.

Tomas

From: Jimmy S.
Sent: Wednesday, April 22, 2009 10:56 AM
To: Tomas M.; Jim D.; removed_email_address@domain.invalid
Cc: IronRuby External Code R.
Subject: RE: Code Review: __FILE__ and $PROGRAM_NAME paths

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

Remove Glob.CanonicalizePath (in favor of RubyUtils.CanonicalizePath)


-
Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/FileOps.cs

-          Merlin/Main/Languages/Ruby/Ruby/Builtins/Glob.cs

From: Tomas M.
Sent: Tuesday, April 21, 2009 5:38 PM
To: Jimmy S.; Jim D.; removed_email_address@domain.invalid
Cc: IronRuby External Code R.
Subject: RE: Code Review: __FILE__ and $PROGRAM_NAME paths

Could you remove

public static MutableString/*!*/ CanonicalizePath(MutableString/*!*/
path) {
   return RubyUtils.CanonicalizePath(path);
}

from Glob and call RubyUtils directly wherever Glob.CanonicalizePath is
used?

Other than that looks good.

Tomas


From: Jimmy S.
Sent: Tuesday, April 21, 2009 5:19 PM
To: Jim D.; removed_email_address@domain.invalid
Cc: IronRuby External Code R.
Subject: RE: Code Review: __FILE__ and $PROGRAM_NAME paths

http://github.com/jschementi/ironruby/commit/57d18...

Code Review changes
- Moves command_line/fixtures/file* and language/fixtures/file* to
fixtures/
- Create RubyUtils.CanonicalizePath, to dependency on
IronRuby.Builtins.Glob from IronRuby.Hosting

    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/command_line/fixtures/file.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/command_line/fixtures/file/sub.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/command_line/program_name_spec.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/fixtures/file.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/fixtures/file/sub.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/language/file_spec.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/language/fixtures/file.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/language/fixtures/file/sub.rb
    *
Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/language/predefined_spec.rb
    * Merlin/Main/Languages/Ruby/Ruby/Builtins/Glob.cs
    * Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyCommandLine.cs
    * Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyOptionsParser.cs
    * Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyUtils.cs

From: Jim D.
Sent: Monday, April 20, 2009 6:53 PM
To: Jimmy S.; removed_email_address@domain.invalid
Cc: IronRuby External Code R.
Subject: RE: Code Review: __FILE__ and $PROGRAM_NAME paths

Comment left on Github:

Can you move the fixtures up a level and combine them? (Put them in
rubyspec/fixtures instead of rubyspec/command_line/fixtures and
rubyspec/language/fixtures)

Also, shouldn't we move Glob.CanonicalizePath to a more central
location, then use that central location for both the hosting and the
Glob implementation? Seems like this couples the hosting API to Glob,
which doesn't seem good.
Other than that it looks good.

JD

From: Jimmy S.
Sent: Monday, April 20, 2009 3:37 PM
To: removed_email_address@domain.invalid
Cc: IronRuby External Code R.
Subject: Code Review: __FILE__ and $PROGRAM_NAME paths

http://github.com/jschementi/ironruby/commit/3ef1b...

Makes __FILE__ and $PROGRAM_NAME (and $0) have canonicalized paths when
Ruby is hosted from ir.exe. However, __FILE__ is not messed with when
including a file via require/load. Fixes
http://ironruby.codeplex.com/WorkItem/View.aspx?Wo....
This topic is locked and can not be replied to.