# Review: GzipWriter.open

**URL:** <https://www.ruby-forum.com/t/review-gzipwriter-open/164971>\
**Category:** IronRuby\
**Created:** [April 7, 2009, 10:18pm UTC](https://www.ruby-forum.com/t/review-gzipwriter-open/164971 "2009-04-07T22:18:20Z")\
**Posts on this page:** 4\
**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:** [April 7, 2009, 10:18pm UTC](https://www.ruby-forum.com/t/review-gzipwriter-open/164971/1 "2009-04-07T22:18:20Z")

</div>

> <https://github.com/shri-zz/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555>
>
> Added Kernel.abort
> Mapped Errno::EACCES to System.UnauthorizedAccessException
> Fi…le.delete catches IOException and rethrows Errno::EACCES to match MRI
> Adds Errno::EXDEV
> Updated rbconfig.rb to work with the dev environment. Change RbConfig\[:ruby\_install\_name\] to "ir". Note that it is not "ironruby" because RubyGems uses this to spawn new processes for running setup scripts, and so it needs to match the executable name (ir.exe).
> Added Languages\\Ruby\\Tests\\Interop\\uncategorized\_spec.rb as a place for devs to add CLR tests. Jim can later move them into the right place in CLR interop test suite.

GitDiff.bat 9fc3048beb4a315ec7ac3dc82908da8f92bf1a07  
fb6f89146e331a9f20f444d5ca94478dfce7f555

- 

```
    Implemented Zlib::GzipWriter.open

```

- 

```
    Added Kernel.abort

```

- 

```
    Mapped Errno::EACCES to System.UnauthorizedAccessException

```

- 

```
    File.delete catches IOException and rethrows Errno::EACCES to 

```

match MRI

- 

```
    Adds Errno::EXDEV

```

- 

```
    Updated rbconfig.rb to work with the dev environment. Change 

```

RbConfig[:ruby\_install\_name] to “ir”. Note that it is not “ironruby”  
because RubyGems uses this to spawn new processes for running setup  
scripts, and so it needs to match the executable name (ir.exe).

- 

```
    Added Languages\Ruby\Tests\Interop\uncategorized_spec.rb as a 

```

place for devs to add CLR tests. Jim can later move them into the right  
place in CLR interop test suite.

Files modified:

- 

Merlin/External/Languages/IronRuby/mspec/ironruby-tags/core/file/open\_tags.txt[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-0](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-0)  
\*  
Merlin/External/Languages/IronRuby/mspec/ironruby-tags/core/kernel/abort\_tags.txt  
\*  
Merlin/External/Languages/IronRuby/mspec/rubyspec/core/file/open\_spec.rb[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-2](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-2)  
\*  
Merlin/External/Languages/IronRuby/mspec/rubyspec/library/zlib/gzipwriter/open\_spec.rb[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-3](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-3)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/Dir.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-4](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-4)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/Errno.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-5](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-5)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/FileOps.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-6](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-6)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/KernelOps.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-7](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-7)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/StringFormatter.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-8](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-8)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Initializers.Generated.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-9](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-9)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Zlib/zlib.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-10](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-10)  
\*  
Merlin/Main/Languages/Ruby/Libs/rbconfig.rb[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-11](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-11)  
\*  
Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyObject.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-12](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-12)  
\*  
Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized\_spec.rb[http://github.com/shri/ironruby/tree/fb6f89146e331a9f20f444d5ca94478dfce7f555/Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized\_spec.rb](http://github.com/shri/ironruby/tree/fb6f89146e331a9f20f444d5ca94478dfce7f555/Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized_spec.rb)  
\*  
Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized\_specs.rb[http://github.com/shri/ironruby/tree/fb6f89146e331a9f20f444d5ca94478dfce7f555/Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized\_specs.rb](http://github.com/shri/ironruby/tree/fb6f89146e331a9f20f444d5ca94478dfce7f555/Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized_specs.rb)

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:** [April 7, 2009, 10:31pm UTC](https://www.ruby-forum.com/t/review-gzipwriter-open/164971/2 "2009-04-07T22:31:53Z")

</div>

- it “raises TypeError unless the arguments are exactly a String,  
Fixnum and Fixnum” do
- filename = mock(“filename”)
- filename.should\_not\_receive(:to\_s)
- lambda { Zlib::GzipWriter.open(filename) }.should  
raise\_error(TypeError)
- 
- level = mock(“level”)
- level.should\_not\_receive(:to\_int)
- lambda { Zlib::GzipWriter.open(@filename, level) }.should  
raise\_error(TypeError)
- 
- strategy = mock(“strategy”)
- strategy.should\_not\_receive(:to\_int)
- lambda { Zlib::GzipWriter.open(@filename, 0, strategy) }.should  
raise\_error(TypeError)
- end

I would check to\_i, not to\_int in this case. Other than this and the  
extra file, test looks good.  
JD

From: Shri B.  
Sent: Tuesday, April 07, 2009 1:09 PM  
To: IronRuby External Code R.  
Cc: removed\_email\_address@domain.invalid  
Subject: Review: GzipWriter.open

> <https://github.com/shri-zz/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555>
>
> Added Kernel.abort
> Mapped Errno::EACCES to System.UnauthorizedAccessException
> Fi…le.delete catches IOException and rethrows Errno::EACCES to match MRI
> Adds Errno::EXDEV
> Updated rbconfig.rb to work with the dev environment. Change RbConfig\[:ruby\_install\_name\] to "ir". Note that it is not "ironruby" because RubyGems uses this to spawn new processes for running setup scripts, and so it needs to match the executable name (ir.exe).
> Added Languages\\Ruby\\Tests\\Interop\\uncategorized\_spec.rb as a place for devs to add CLR tests. Jim can later move them into the right place in CLR interop test suite.

GitDiff.bat 9fc3048beb4a315ec7ac3dc82908da8f92bf1a07  
fb6f89146e331a9f20f444d5ca94478dfce7f555

- 

```
    Implemented Zlib::GzipWriter.open

```

- 

```
    Added Kernel.abort

```

- 

```
    Mapped Errno::EACCES to System.UnauthorizedAccessException

```

- 

```
    File.delete catches IOException and rethrows Errno::EACCES to 

```

match MRI

- 

```
    Adds Errno::EXDEV

```

- 

```
    Updated rbconfig.rb to work with the dev environment. Change 

```

RbConfig[:ruby\_install\_name] to “ir”. Note that it is not “ironruby”  
because RubyGems uses this to spawn new processes for running setup  
scripts, and so it needs to match the executable name (ir.exe).

- 

```
    Added Languages\Ruby\Tests\Interop\uncategorized_spec.rb as a 

```

place for devs to add CLR tests. Jim can later move them into the right  
place in CLR interop test suite.

Files modified:

- 

Merlin/External/Languages/IronRuby/mspec/ironruby-tags/core/file/open\_tags.txt[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-0](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-0)  
\*  
Merlin/External/Languages/IronRuby/mspec/ironruby-tags/core/kernel/abort\_tags.txt  
\*  
Merlin/External/Languages/IronRuby/mspec/rubyspec/core/file/open\_spec.rb[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-2](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-2)  
\*  
Merlin/External/Languages/IronRuby/mspec/rubyspec/library/zlib/gzipwriter/open\_spec.rb[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-3](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-3)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/Dir.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-4](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-4)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/Errno.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-5](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-5)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/FileOps.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-6](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-6)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/KernelOps.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-7](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-7)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/StringFormatter.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-8](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-8)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Initializers.Generated.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-9](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-9)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Zlib/zlib.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-10](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-10)  
\*  
Merlin/Main/Languages/Ruby/Libs/rbconfig.rb[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-11](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-11)  
\*  
Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyObject.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-12](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-12)  
\*  
Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized\_spec.rb[http://github.com/shri/ironruby/tree/fb6f89146e331a9f20f444d5ca94478dfce7f555/Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized\_spec.rb](http://github.com/shri/ironruby/tree/fb6f89146e331a9f20f444d5ca94478dfce7f555/Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized_spec.rb)  
\*  
Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized\_specs.rb[http://github.com/shri/ironruby/tree/fb6f89146e331a9f20f444d5ca94478dfce7f555/Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized\_specs.rb](http://github.com/shri/ironruby/tree/fb6f89146e331a9f20f444d5ca94478dfce7f555/Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized_specs.rb)

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:** [April 7, 2009, 10:40pm UTC](https://www.ruby-forum.com/t/review-gzipwriter-open/164971/3 "2009-04-07T22:40:05Z")

</div>

Looks good.

Tomas

From: Shri B.  
Sent: Tuesday, April 07, 2009 1:09 PM  
To: IronRuby External Code R.  
Cc: removed\_email\_address@domain.invalid  
Subject: Review: GzipWriter.open

> <https://github.com/shri-zz/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555>
>
> Added Kernel.abort
> Mapped Errno::EACCES to System.UnauthorizedAccessException
> Fi…le.delete catches IOException and rethrows Errno::EACCES to match MRI
> Adds Errno::EXDEV
> Updated rbconfig.rb to work with the dev environment. Change RbConfig\[:ruby\_install\_name\] to "ir". Note that it is not "ironruby" because RubyGems uses this to spawn new processes for running setup scripts, and so it needs to match the executable name (ir.exe).
> Added Languages\\Ruby\\Tests\\Interop\\uncategorized\_spec.rb as a place for devs to add CLR tests. Jim can later move them into the right place in CLR interop test suite.

GitDiff.bat 9fc3048beb4a315ec7ac3dc82908da8f92bf1a07  
fb6f89146e331a9f20f444d5ca94478dfce7f555

- 

```
    Implemented Zlib::GzipWriter.open

```

- 

```
    Added Kernel.abort

```

- 

```
    Mapped Errno::EACCES to System.UnauthorizedAccessException

```

- 

```
    File.delete catches IOException and rethrows Errno::EACCES to 

```

match MRI

- 

```
    Adds Errno::EXDEV

```

- 

```
    Updated rbconfig.rb to work with the dev environment. Change 

```

RbConfig[:ruby\_install\_name] to “ir”. Note that it is not “ironruby”  
because RubyGems uses this to spawn new processes for running setup  
scripts, and so it needs to match the executable name (ir.exe).

- 

```
    Added Languages\Ruby\Tests\Interop\uncategorized_spec.rb as a 

```

place for devs to add CLR tests. Jim can later move them into the right  
place in CLR interop test suite.

Files modified:

- 

Merlin/External/Languages/IronRuby/mspec/ironruby-tags/core/file/open\_tags.txt[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-0](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-0)  
\*  
Merlin/External/Languages/IronRuby/mspec/ironruby-tags/core/kernel/abort\_tags.txt  
\*  
Merlin/External/Languages/IronRuby/mspec/rubyspec/core/file/open\_spec.rb[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-2](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-2)  
\*  
Merlin/External/Languages/IronRuby/mspec/rubyspec/library/zlib/gzipwriter/open\_spec.rb[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-3](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-3)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/Dir.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-4](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-4)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/Errno.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-5](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-5)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/FileOps.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-6](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-6)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/KernelOps.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-7](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-7)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/StringFormatter.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-8](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-8)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Initializers.Generated.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-9](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-9)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Zlib/zlib.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-10](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-10)  
\*  
Merlin/Main/Languages/Ruby/Libs/rbconfig.rb[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-11](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-11)  
\*  
Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyObject.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-12](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-12)  
\*  
Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized\_spec.rb[http://github.com/shri/ironruby/tree/fb6f89146e331a9f20f444d5ca94478dfce7f555/Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized\_spec.rb](http://github.com/shri/ironruby/tree/fb6f89146e331a9f20f444d5ca94478dfce7f555/Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized_spec.rb)  
\*  
Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized\_specs.rb[http://github.com/shri/ironruby/tree/fb6f89146e331a9f20f444d5ca94478dfce7f555/Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized\_specs.rb](http://github.com/shri/ironruby/tree/fb6f89146e331a9f20f444d5ca94478dfce7f555/Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized_specs.rb)

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:** [April 7, 2009, 11:54pm UTC](https://www.ruby-forum.com/t/review-gzipwriter-open/164971/4 "2009-04-07T23:54:26Z")

</div>

The following Ruby code prints “to\_int”. So checking for to\_int seems to  
be correct, right?

class C  
def to\_int  
puts “to\_int”  
0  
end

def to\_i  
puts “to\_i”  
0  
end  
end

[].at(C.new)

Thanks,  
Shri

From: Jim D.  
Sent: Tuesday, April 07, 2009 1:25 PM  
To: Shri B.; IronRuby External Code R.  
Cc: removed\_email\_address@domain.invalid  
Subject: RE: Review: GzipWriter.open

- it “raises TypeError unless the arguments are exactly a String,  
Fixnum and Fixnum” do
- filename = mock(“filename”)
- filename.should\_not\_receive(:to\_s)
- lambda { Zlib::GzipWriter.open(filename) }.should  
raise\_error(TypeError)
- 
- level = mock(“level”)
- level.should\_not\_receive(:to\_int)
- lambda { Zlib::GzipWriter.open(@filename, level) }.should  
raise\_error(TypeError)
- 
- strategy = mock(“strategy”)
- strategy.should\_not\_receive(:to\_int)
- lambda { Zlib::GzipWriter.open(@filename, 0, strategy) }.should  
raise\_error(TypeError)
- end

I would check to\_i, not to\_int in this case. Other than this and the  
extra file, test looks good.  
JD

From: Shri B.  
Sent: Tuesday, April 07, 2009 1:09 PM  
To: IronRuby External Code R.  
Cc: removed\_email\_address@domain.invalid  
Subject: Review: GzipWriter.open

> <https://github.com/shri-zz/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555>
>
> Added Kernel.abort
> Mapped Errno::EACCES to System.UnauthorizedAccessException
> Fi…le.delete catches IOException and rethrows Errno::EACCES to match MRI
> Adds Errno::EXDEV
> Updated rbconfig.rb to work with the dev environment. Change RbConfig\[:ruby\_install\_name\] to "ir". Note that it is not "ironruby" because RubyGems uses this to spawn new processes for running setup scripts, and so it needs to match the executable name (ir.exe).
> Added Languages\\Ruby\\Tests\\Interop\\uncategorized\_spec.rb as a place for devs to add CLR tests. Jim can later move them into the right place in CLR interop test suite.

GitDiff.bat 9fc3048beb4a315ec7ac3dc82908da8f92bf1a07  
fb6f89146e331a9f20f444d5ca94478dfce7f555

- 

```
    Implemented Zlib::GzipWriter.open

```

- 

```
    Added Kernel.abort

```

- 

```
    Mapped Errno::EACCES to System.UnauthorizedAccessException

```

- 

```
    File.delete catches IOException and rethrows Errno::EACCES to 

```

match MRI

- 

```
    Adds Errno::EXDEV

```

- 

```
    Updated rbconfig.rb to work with the dev environment. Change 

```

RbConfig[:ruby\_install\_name] to “ir”. Note that it is not “ironruby”  
because RubyGems uses this to spawn new processes for running setup  
scripts, and so it needs to match the executable name (ir.exe).

- 

```
    Added Languages\Ruby\Tests\Interop\uncategorized_spec.rb as a 

```

place for devs to add CLR tests. Jim can later move them into the right  
place in CLR interop test suite.

Files modified:

- 

Merlin/External/Languages/IronRuby/mspec/ironruby-tags/core/file/open\_tags.txt[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-0](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-0)  
\*  
Merlin/External/Languages/IronRuby/mspec/ironruby-tags/core/kernel/abort\_tags.txt  
\*  
Merlin/External/Languages/IronRuby/mspec/rubyspec/core/file/open\_spec.rb[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-2](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-2)  
\*  
Merlin/External/Languages/IronRuby/mspec/rubyspec/library/zlib/gzipwriter/open\_spec.rb[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-3](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-3)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/Dir.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-4](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-4)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/Errno.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-5](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-5)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/FileOps.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-6](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-6)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/KernelOps.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-7](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-7)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/StringFormatter.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-8](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-8)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Initializers.Generated.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-9](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-9)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Zlib/zlib.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-10](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-10)  
\*  
Merlin/Main/Languages/Ruby/Libs/rbconfig.rb[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-11](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-11)  
\*  
Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyObject.cs[http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-12](http://github.com/shri/ironruby/commit/fb6f89146e331a9f20f444d5ca94478dfce7f555#diff-12)  
\*  
Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized\_spec.rb[http://github.com/shri/ironruby/tree/fb6f89146e331a9f20f444d5ca94478dfce7f555/Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized\_spec.rb](http://github.com/shri/ironruby/tree/fb6f89146e331a9f20f444d5ca94478dfce7f555/Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized_spec.rb)  
\*  
Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized\_specs.rb[http://github.com/shri/ironruby/tree/fb6f89146e331a9f20f444d5ca94478dfce7f555/Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized\_specs.rb](http://github.com/shri/ironruby/tree/fb6f89146e331a9f20f444d5ca94478dfce7f555/Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized_specs.rb)

Thanks,  
Shri
