# Review: ActiveSupport bug fixes

**URL:** <https://www.ruby-forum.com/t/review-activesupport-bug-fixes/167705>\
**Category:** IronRuby\
**Created:** [May 11, 2009, 7:17pm UTC](https://www.ruby-forum.com/t/review-activesupport-bug-fixes/167705 "2009-05-11T19:17:35Z")\
**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:** [May 11, 2009, 7:17pm UTC](https://www.ruby-forum.com/t/review-activesupport-bug-fixes/167705/1 "2009-05-11T19:17:35Z")

</div>

> <https://github.com/shri-zz/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e>
>
> ObjectSpace.each\_byte:
> It was not throwing an exception for the unsupported cas…es.
> Also, the unsupported cases should throw RuntimeError to match ActiveSupport/JRuby conventions
> The return value was also incorrect
> NameError should call #inspect on self, not #to\_s
> \#instance\_method on singleton classes behaves a bit differently - it puts a contraint of the nominal type.
> UnboundMethod#bind was doing an incorrect type check and not dealing with singleton classes. Factored out RubyContext.IsKindOf for this

```
Implement File.chown. It is a nop (on Windows)
ObjectSpace.each_byte:
 It was not throwing an exception for the unsupported cases.
 Also, the unsupported cases should throw RuntimeError to match 

```

ActiveSupport/JRuby conventions  
The return value was also incorrect  
NameError should call #inspect on self, not #to\_s  
#instance\_method on singleton classes behaves a bit differently - it  
puts a contraint of the nominal type.  
UnboundMethod#bind was doing an incorrect type check and not dealing  
with singleton classes. Factored out RubyContext.IsKindOf for this

Files changed:

- 

Merlin/External.LCA\_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/file/chown\_tags.txt  
\*  
Merlin/External.LCA\_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/exception/name\_error\_spec.rb[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-1](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-1)  
\*  
Merlin/External.LCA\_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/module/fixtures/classes.rb[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-2](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-2)  
\*  
Merlin/External.LCA\_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/module/instance\_method\_spec.rb[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-3](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-3)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/Errno.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-4](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-4)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/FileOps.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-5](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-5)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/KernelOps.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-6](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-6)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/ModuleOps.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-7](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-7)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/ObjectSpace.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-8](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-8)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/UnboundMethod.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-9](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-9)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Initializers.Generated.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-10](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-10)  
\*  
Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-11](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-11)  
\*  
Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/ProtocolConversionAction.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-12](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-12)  
\*  
Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyContext.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-13](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-13)  
\*  
Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyExceptions.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-14](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-14)  
\*  
Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized\_spec.rb[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-15](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-15)

Also added mocha gem :

> <https://github.com/shri-zz/ironruby/commit/bdaf0adb28e0a075e5632e3930feaa4bcee1ad30>

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:** [May 12, 2009, 5:04am UTC](https://www.ruby-forum.com/t/review-activesupport-bug-fixes/167705/2 "2009-05-12T05:04:55Z")

</div>

NominalClass is already implemented by GetNonSingletonClass(). The  
difference is that GetNonSingletonClass() finds the first non-singleton  
class in hierarchy. For object singletons this is the immediate  
\_superClass but for class/module singletons the super is also a  
singleton. Have you tried how UnboundMethod#bind works on them?

Tomas

From: Shri B.  
Sent: Monday, May 11, 2009 10:07 AM  
To: removed\_email\_address@domain.invalid; IronRuby External Code R.  
Subject: Review: ActiveSupport bug fixes

> <https://github.com/shri-zz/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e>
>
> ObjectSpace.each\_byte:
> It was not throwing an exception for the unsupported cas…es.
> Also, the unsupported cases should throw RuntimeError to match ActiveSupport/JRuby conventions
> The return value was also incorrect
> NameError should call #inspect on self, not #to\_s
> \#instance\_method on singleton classes behaves a bit differently - it puts a contraint of the nominal type.
> UnboundMethod#bind was doing an incorrect type check and not dealing with singleton classes. Factored out RubyContext.IsKindOf for this

```
Implement File.chown. It is a nop (on Windows)
ObjectSpace.each_byte:
 It was not throwing an exception for the unsupported cases.
 Also, the unsupported cases should throw RuntimeError to match 

```

ActiveSupport/JRuby conventions  
The return value was also incorrect  
NameError should call #inspect on self, not #to\_s  
#instance\_method on singleton classes behaves a bit differently - it  
puts a contraint of the nominal type.  
UnboundMethod#bind was doing an incorrect type check and not dealing  
with singleton classes. Factored out RubyContext.IsKindOf for this

Files changed:

- 

Merlin/External.LCA\_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/file/chown\_tags.txt  
\*  
Merlin/External.LCA\_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/exception/name\_error\_spec.rb[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-1](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-1)  
\*  
Merlin/External.LCA\_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/module/fixtures/classes.rb[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-2](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-2)  
\*  
Merlin/External.LCA\_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/module/instance\_method\_spec.rb[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-3](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-3)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/Errno.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-4](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-4)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/FileOps.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-5](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-5)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/KernelOps.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-6](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-6)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/ModuleOps.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-7](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-7)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/ObjectSpace.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-8](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-8)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Builtins/UnboundMethod.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-9](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-9)  
\*  
Merlin/Main/Languages/Ruby/Libraries.LCA\_RESTRICTED/Initializers.Generated.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-10](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-10)  
\*  
Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-11](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-11)  
\*  
Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/ProtocolConversionAction.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-12](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-12)  
\*  
Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyContext.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-13](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-13)  
\*  
Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyExceptions.cs[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-14](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-14)  
\*  
Merlin/Main/Languages/Ruby/Tests/Interop/uncategorized\_spec.rb[http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-15](http://github.com/shri/ironruby/commit/31d3ab9297eac7ac61dd9cee8fd98558d509886e#diff-15)

Also added mocha gem :

> <https://github.com/shri-zz/ironruby/commit/bdaf0adb28e0a075e5632e3930feaa4bcee1ad30>

Thanks,  
Shri
