# Review: File.expand\_path

**URL:** <https://www.ruby-forum.com/t/review-file-expand-path/169443>\
**Category:** IronRuby\
**Created:** [June 3, 2009, 8:26pm UTC](https://www.ruby-forum.com/t/review-file-expand-path/169443 "2009-06-03T20:26:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shri\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Post date:** [June 3, 2009, 8:26pm UTC](https://www.ruby-forum.com/t/review-file-expand-path/169443/1 "2009-06-03T20:26:17Z")

</div>

> <https://github.com/shri-zz/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3>
>
> The motivating reason was that RSpec does File.expand\_path("filename:linenumber"…), and the old implementation complained that : is not valid in filenames, whereas MRI allows such input
> Fixed "\[nil\].uniq" - Cucumber was running into this.
> Renamed scripts\\ruby19.bat to ruby1.9.bat as "mspec -tr19" seems to have changed.

Reimplemented File.expand\_path such that it does not use System.IO.Path.  
This allows us to get better compatibility with MRI.  
The motivating reason was that RSpec does  
File.expand\_path(“filename:linenumber”), and the old implementation  
complained that : is not valid in filenames, whereas MRI allows such  
input

Fixed “[nil].uniq” - Cucumber was running into this.  
Renamed scripts\ruby19.bat to ruby1.9.bat as “mspec -tr19” seems to have  
changed.

List of files:

- 

Merlin/External.LCA\_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/file/expand\_path\_tags.txt[http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-0](http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-0)  
\*  
Merlin/External.LCA\_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/array/uniq\_spec.rb[http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-1](http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-1)  
\*  
Merlin/External.LCA\_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/file/expand\_path\_spec.rb[http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-2](http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-2)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/Dir.cs[http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-3](http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-3)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/FileOps.cs[http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-4](http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-4)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Extensions/IListOps.cs[http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-5](http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-5)  
\*  
Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyUtils.cs[http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-6](http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-6)  
\*  
Merlin/Main/Languages/Ruby/Scripts/RakeTests.rb[http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-7](http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-7)  
\*  
Merlin/Main/Languages/Ruby/Scripts/ruby1.9.bat[http://github.com/shri/ironruby/tree/ec9eae2e12e97ab53082dbfd35d0d57b337731b3/Merlin/Main/Languages/Ruby/Scripts/ruby1.9.bat](http://github.com/shri/ironruby/tree/ec9eae2e12e97ab53082dbfd35d0d57b337731b3/Merlin/Main/Languages/Ruby/Scripts/ruby1.9.bat)

- Merlin/Main/Languages/Ruby/Scripts/ruby19.bat
- 

Merlin/Main/Runtime/Microsoft.Scripting/Utils/ArrayUtils.cs[http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-10](http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-10)  
Thanks,  
Shri

---

<div class="post-metadata">

**Author:** ![Shri\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Post date:** [June 3, 2009, 8:28pm UTC](https://www.ruby-forum.com/t/review-file-expand-path/169443/2 "2009-06-03T20:28:38Z")

</div>

Looks good.

From: Shri B.  
Sent: Wednesday, June 03, 2009 11:07 AM  
To: removed\_email\_address@domain.invalid  
Cc: IronRuby External Code R.  
Subject: Review: File.expand\_path

> <https://github.com/shri-zz/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3>
>
> The motivating reason was that RSpec does File.expand\_path("filename:linenumber"…), and the old implementation complained that : is not valid in filenames, whereas MRI allows such input
> Fixed "\[nil\].uniq" - Cucumber was running into this.
> Renamed scripts\\ruby19.bat to ruby1.9.bat as "mspec -tr19" seems to have changed.

Reimplemented File.expand\_path such that it does not use System.IO.Path.  
This allows us to get better compatibility with MRI.  
The motivating reason was that RSpec does  
File.expand\_path(“filename:linenumber”), and the old implementation  
complained that : is not valid in filenames, whereas MRI allows such  
input

Fixed “[nil].uniq” - Cucumber was running into this.  
Renamed scripts\ruby19.bat to ruby1.9.bat as “mspec -tr19” seems to have  
changed.

List of files:

- 

Merlin/External.LCA\_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/file/expand\_path\_tags.txt[http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-0](http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-0)  
\*  
Merlin/External.LCA\_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/array/uniq\_spec.rb[http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-1](http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-1)  
\*  
Merlin/External.LCA\_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/file/expand\_path\_spec.rb[http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-2](http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-2)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/Dir.cs[http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-3](http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-3)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/FileOps.cs[http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-4](http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-4)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Extensions/IListOps.cs[http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-5](http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-5)  
\*  
Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyUtils.cs[http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-6](http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-6)  
\*  
Merlin/Main/Languages/Ruby/Scripts/RakeTests.rb[http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-7](http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-7)  
\*  
Merlin/Main/Languages/Ruby/Scripts/ruby1.9.bat[http://github.com/shri/ironruby/tree/ec9eae2e12e97ab53082dbfd35d0d57b337731b3/Merlin/Main/Languages/Ruby/Scripts/ruby1.9.bat](http://github.com/shri/ironruby/tree/ec9eae2e12e97ab53082dbfd35d0d57b337731b3/Merlin/Main/Languages/Ruby/Scripts/ruby1.9.bat)

- Merlin/Main/Languages/Ruby/Scripts/ruby19.bat
- 

Merlin/Main/Runtime/Microsoft.Scripting/Utils/ArrayUtils.cs[http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-10](http://github.com/shri/ironruby/commit/ec9eae2e12e97ab53082dbfd35d0d57b337731b3#diff-10)  
Thanks,  
Shri
