Forum: IronRuby Code Review: Bug Regressions and .NET interop

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.
Jim D. (Guest)
on 2009-04-03 21:43
(Received via mailing list)
Some more changes. Mostly closing bugs and adding .NET interop tests.
Commit range is 90392fff to a39daeae on
git://github.com/jredville/ironruby.git. I rebased this time, so you
should be able to just grab that range and see only my diffs.





*         closing Rubyforge
15060<http://github.com/jredville/ironruby/commit/90392f...

*         [#24589] $PROGRAM_NAME in 'English' not working now
fixed<http://github.com/jredville/ironruby/commit/ab8a90...

*         making $0 the same object as $PROGRAM_NAME and adding specs
for it. Closes [#24589] $PROGRAM_NAME in 'English' not
working<http://github.com/jredville/ironruby/commit/0619c3...

*         closing Rubyforge [#15061] tracking: create generic interface
type<http://github.com/jredville/ironruby/commit/b1cae6...

*         closing RubyForge [#15651] NoMethodError expected when calling
the private method 'initialize' of a ruby
class<http://github.com/jredville/ironruby/commit/35745f...

*         added protected method invocation specs. Closes Rubyforge
[#19118] Protected members not available when inheriting from CLR
type<http://github.com/jredville/ironruby/commit/167197...

*         adding regression test for [#19872] IComparableOps.CompareTo
throws argument error when type is
Decimal<http://github.com/jredville/ironruby/commit/d5e75c...

*         added reference support to
csc.bat<http://github.com/jredville/ironruby/commit/15cc5f...

*         closing [#17467] Accessing IronRuby method from
C#<http://github.com/jredville/ironruby/commit/6c31b0...

*         closing [#19950] Dir.glob doesn't handle
**<http://github.com/jredville/ironruby/commit/125638...

*         closing [#20027] Formatting float to string produces
incorrectly
&amp;amp;amp;quot;Infinity&amp;amp;amp;quot;<http://github.com/jredville/ironruby/commit/d428c0...

*         closing [#20043] creating a generic type when the type is an
interface<http://github.com/jredville/ironruby/commit/bf83e3...

*         closing [#20052] Calculating 3.0/2.0 produces
NaN<http://github.com/jredville/ironruby/commit/40d5b7...

*         closing Rubyforge [#20263] Dir.glob doesn't handle missing
folders<http://github.com/jredville/ironruby/commit/085a6e...

*         closing [#20410]
GetKCodeName<http://github.com/jredville/ironruby/commit/d52203...

*         adding test to ensure that File.stat returns a File::Stat
object<http://github.com/jredville/ironruby/commit/de0e2a...

*         closing Rubyforge [#20640] Calling File.open with an integer
(File descriptor overload) causes the File.open site to be
unusable<http://github.com/jredville/ironruby/commit/a0937f...

*         closing Rubyforge [#20664] Respecting visibility of methods.
Also fixes a compilation error due to multiple IInterface
definitions<http://github.com/jredville/ironruby/commit/d38765...

*         Closing RubyForge [#20665] Can't use an indexer on a WPF
ResourceDictionary<http://github.com/jredville/ironruby/commit/c9830e...

*         removing a tag for
predefined<http://github.com/jredville/ironruby/commit/388c1f...

*         closing Rubyforge [#21943] NullRef exception thrown while
comparing a list containing elements with overriden
==<http://github.com/jredville/ironruby/commit/585ab4...

*         closing Rubyforge [#21995] kind_of? not working with when
extend is
used<http://github.com/jredville/ironruby/commit/c288db...

*         recommiting some changes that were reverted by the merge.
Methinks someone in TFS changed them. This makes describe work with 2
strings for shared behaviors, and it makes csc output #line
pragmas<http://github.com/jredville/ironruby/commit/ac44e0...

*         fixing some more errors from the
merge<http://github.com/jredville/ironruby/commit/c42e84...

*         Adding class instantiation specs for regular classes with
overloaded
constructors<http://github.com/jredville/ironruby/commit/eba230...

*         adding regression tests for [#22197] calling super throw
Argument
Error<http://github.com/jredville/ironruby/commit/9313a9...

*         adding StringBuilder specs to get rid of test_basic.rb. Also
added equal_clr_string
matcher<http://github.com/jredville/ironruby/commit/09d04d...

*         refactor specs to use the equal_clr_string
matcher<http://github.com/jredville/ironruby/commit/410fab...

*         basic string specs to remove
test_basic.rb<http://github.com/jredville/ironruby/commit/044752...

*         added more string specs to get rid of test_basic. Also adds
field
specs<http://github.com/jredville/ironruby/commit/de239f...

*         adding some basic event add and remove
specs<http://github.com/jredville/ironruby/commit/bf37c1...

*         added event invocation
specs<http://github.com/jredville/ironruby/commit/a39dae...



JD
Jimmy S. (Guest)
on 2009-04-04 01:12
(Received via mailing list)
Posted comments on github, but here they are also:


*          'represents the program name' looks strange, asserting that
the splitted string (?) equals a array with two elements, both
containing the expanded path the string represented. How does that make
sense? Jim explained this one, and now it makes sense. He's adding a
comment to explain the witchery

*         Catching NoMethodError to check for a private method is not
enough, you should also ensure that klass.method(:initialize) gives you
back a Method object, and that
klass.private_methods.include?('initialize'). Given those three pieces
of info you can better infer that the method exists and it is private.

*         Make protected_spec less redundant (see comment on
http://github.com/jredville/ironruby/commit/167197...)

*         Indent is off on line 10 in Interop/fixtures.generated.cs (and
seems to be for all generated C#).

*         What's the debug("reference", ref) call doing in csc.rb? (that
name cracks me up)

*         To answer the TODO in conversion_spec.rb: it should belong in
the tests for using IronRuby through the hosting API. I don't think we
have any, and maybe they should exist in our .NET interop?
Interop/dlr/...

*         Is "truncate" the correct terminology in modulo_spec.rb? How
about "rounds"?

*         There's no spec for the obj.my_event { ... } syntax

Otherwise, good job =)

From: Jim D.
Sent: Friday, April 03, 2009 9:45 AM
To: removed_email_address@domain.invalid; IronRuby External Code R.
Subject: Code Review: Bug Regressions and .NET interop


Some more changes. Mostly closing bugs and adding .NET interop tests.
Commit range is 90392fff to a39daeae on
git://github.com/jredville/ironruby.git. I rebased this time, so you
should be able to just grab that range and see only my diffs.





*         closing Rubyforge
15060<http://github.com/jredville/ironruby/commit/90392f...

*         [#24589] $PROGRAM_NAME in 'English' not working now
fixed<http://github.com/jredville/ironruby/commit/ab8a90...

*         making $0 the same object as $PROGRAM_NAME and adding specs
for it. Closes [#24589] $PROGRAM_NAME in 'English' not
working<http://github.com/jredville/ironruby/commit/0619c3...

*         closing Rubyforge [#15061] tracking: create generic interface
type<http://github.com/jredville/ironruby/commit/b1cae6...

*         closing RubyForge [#15651] NoMethodError expected when calling
the private method 'initialize' of a ruby
class<http://github.com/jredville/ironruby/commit/35745f...

*         added protected method invocation specs. Closes Rubyforge
[#19118] Protected members not available when inheriting from CLR
type<http://github.com/jredville/ironruby/commit/167197...

*         adding regression test for [#19872] IComparableOps.CompareTo
throws argument error when type is
Decimal<http://github.com/jredville/ironruby/commit/d5e75c...

*         added reference support to
csc.bat<http://github.com/jredville/ironruby/commit/15cc5f...

*         closing [#17467] Accessing IronRuby method from
C#<http://github.com/jredville/ironruby/commit/6c31b0...

*         closing [#19950] Dir.glob doesn't handle
**<http://github.com/jredville/ironruby/commit/125638...

*         closing [#20027] Formatting float to string produces
incorrectly
&amp;amp;amp;quot;Infinity&amp;amp;amp;quot;<http://github.com/jredville/ironruby/commit/d428c0...

*         closing [#20043] creating a generic type when the type is an
interface<http://github.com/jredville/ironruby/commit/bf83e3...

*         closing [#20052] Calculating 3.0/2.0 produces
NaN<http://github.com/jredville/ironruby/commit/40d5b7...

*         closing Rubyforge [#20263] Dir.glob doesn't handle missing
folders<http://github.com/jredville/ironruby/commit/085a6e...

*         closing [#20410]
GetKCodeName<http://github.com/jredville/ironruby/commit/d52203...

*         adding test to ensure that File.stat returns a File::Stat
object<http://github.com/jredville/ironruby/commit/de0e2a...

*         closing Rubyforge [#20640] Calling File.open with an integer
(File descriptor overload) causes the File.open site to be
unusable<http://github.com/jredville/ironruby/commit/a0937f...

*         closing Rubyforge [#20664] Respecting visibility of methods.
Also fixes a compilation error due to multiple IInterface
definitions<http://github.com/jredville/ironruby/commit/d38765...

*         Closing RubyForge [#20665] Can't use an indexer on a WPF
ResourceDictionary<http://github.com/jredville/ironruby/commit/c9830e...

*         removing a tag for
predefined<http://github.com/jredville/ironruby/commit/388c1f...

*         closing Rubyforge [#21943] NullRef exception thrown while
comparing a list containing elements with overriden
==<http://github.com/jredville/ironruby/commit/585ab4...

*         closing Rubyforge [#21995] kind_of? not working with when
extend is
used<http://github.com/jredville/ironruby/commit/c288db...

*         recommiting some changes that were reverted by the merge.
Methinks someone in TFS changed them. This makes describe work with 2
strings for shared behaviors, and it makes csc output #line
pragmas<http://github.com/jredville/ironruby/commit/ac44e0...

*         fixing some more errors from the
merge<http://github.com/jredville/ironruby/commit/c42e84...

*         Adding class instantiation specs for regular classes with
overloaded
constructors<http://github.com/jredville/ironruby/commit/eba230...

*         adding regression tests for [#22197] calling super throw
Argument
Error<http://github.com/jredville/ironruby/commit/9313a9...

*         adding StringBuilder specs to get rid of test_basic.rb. Also
added equal_clr_string
matcher<http://github.com/jredville/ironruby/commit/09d04d...

*         refactor specs to use the equal_clr_string
matcher<http://github.com/jredville/ironruby/commit/410fab...

*         basic string specs to remove
test_basic.rb<http://github.com/jredville/ironruby/commit/044752...

*         added more string specs to get rid of test_basic. Also adds
field
specs<http://github.com/jredville/ironruby/commit/de239f...

*         adding some basic event add and remove
specs<http://github.com/jredville/ironruby/commit/bf37c1...

*         added event invocation
specs<http://github.com/jredville/ironruby/commit/a39dae...



JD
Jim D. (Guest)
on 2009-04-04 01:18
(Received via mailing list)
From: Jimmy S.
Sent: Friday, April 03, 2009 1:47 PM
To: Jim D.; removed_email_address@domain.invalid; IronRuby External Code
Reviewers
Subject: RE: Code Review: Bug Regressions and .NET interop

Posted comments on github, but here they are also:


*          'represents the program name' looks strange, asserting that
the splitted string (?) equals a array with two elements, both
containing the expanded path the string represented. How does that make
sense? Jim explained this one, and now it makes sense. He's adding a
comment to explain the witchery

Comment added


*         Catching NoMethodError to check for a private method is not
enough, you should also ensure that klass.method(:initialize) gives you
back a Method object, and that
klass.private_methods.include?('initialize'). Given those three pieces
of info you can better infer that the method exists and it is private.

Fixed


*         Make protected_spec less redundant (see comment on
http://github.com/jredville/ironruby/commit/167197...)

I'm going to punt this one, because I want to extract either a shared
behavior or a matcher out of these specs. I'll have that in the next
push.


*         Indent is off on line 10 in Interop/fixtures.generated.cs (and
seems to be for all generated C#).

Yeah, the generated indentation isn't perfect. I'll look into it.


*         What's the debug("reference", ref) call doing in csc.rb? (that
name cracks me up)

Glad you like the name. debug(str, obj) is a debug method that prints
"#{str}: #{obj.to_s}" to stdout if $DEBUG is true


*         To answer the TODO in conversion_spec.rb: it should belong in
the tests for using IronRuby through the hosting API. I don't think we
have any, and maybe they should exist in our .NET interop?
Interop/dlr/...

I'll think about this and make the move if needed.


*         Is "truncate" the correct terminology in modulo_spec.rb? How
about "rounds"?

Fixed


*         There's no spec for the obj.my_event { ... } syntax

Fixed

Otherwise, good job =)

From: Jim D.
Sent: Friday, April 03, 2009 9:45 AM
To: removed_email_address@domain.invalid; IronRuby External Code R.
Subject: Code Review: Bug Regressions and .NET interop


Some more changes. Mostly closing bugs and adding .NET interop tests.
Commit range is 90392fff to a39daeae on
git://github.com/jredville/ironruby.git. I rebased this time, so you
should be able to just grab that range and see only my diffs.





*         closing Rubyforge
15060<http://github.com/jredville/ironruby/commit/90392f...

*         [#24589] $PROGRAM_NAME in 'English' not working now
fixed<http://github.com/jredville/ironruby/commit/ab8a90...

*         making $0 the same object as $PROGRAM_NAME and adding specs
for it. Closes [#24589] $PROGRAM_NAME in 'English' not
working<http://github.com/jredville/ironruby/commit/0619c3...

*         closing Rubyforge [#15061] tracking: create generic interface
type<http://github.com/jredville/ironruby/commit/b1cae6...

*         closing RubyForge [#15651] NoMethodError expected when calling
the private method 'initialize' of a ruby
class<http://github.com/jredville/ironruby/commit/35745f...

*         added protected method invocation specs. Closes Rubyforge
[#19118] Protected members not available when inheriting from CLR
type<http://github.com/jredville/ironruby/commit/167197...

*         adding regression test for [#19872] IComparableOps.CompareTo
throws argument error when type is
Decimal<http://github.com/jredville/ironruby/commit/d5e75c...

*         added reference support to
csc.bat<http://github.com/jredville/ironruby/commit/15cc5f...

*         closing [#17467] Accessing IronRuby method from
C#<http://github.com/jredville/ironruby/commit/6c31b0...

*         closing [#19950] Dir.glob doesn't handle
**<http://github.com/jredville/ironruby/commit/125638...

*         closing [#20027] Formatting float to string produces
incorrectly
&amp;amp;amp;quot;Infinity&amp;amp;amp;quot;<http://github.com/jredville/ironruby/commit/d428c0...

*         closing [#20043] creating a generic type when the type is an
interface<http://github.com/jredville/ironruby/commit/bf83e3...

*         closing [#20052] Calculating 3.0/2.0 produces
NaN<http://github.com/jredville/ironruby/commit/40d5b7...

*         closing Rubyforge [#20263] Dir.glob doesn't handle missing
folders<http://github.com/jredville/ironruby/commit/085a6e...

*         closing [#20410]
GetKCodeName<http://github.com/jredville/ironruby/commit/d52203...

*         adding test to ensure that File.stat returns a File::Stat
object<http://github.com/jredville/ironruby/commit/de0e2a...

*         closing Rubyforge [#20640] Calling File.open with an integer
(File descriptor overload) causes the File.open site to be
unusable<http://github.com/jredville/ironruby/commit/a0937f...

*         closing Rubyforge [#20664] Respecting visibility of methods.
Also fixes a compilation error due to multiple IInterface
definitions<http://github.com/jredville/ironruby/commit/d38765...

*         Closing RubyForge [#20665] Can't use an indexer on a WPF
ResourceDictionary<http://github.com/jredville/ironruby/commit/c9830e...

*         removing a tag for
predefined<http://github.com/jredville/ironruby/commit/388c1f...

*         closing Rubyforge [#21943] NullRef exception thrown while
comparing a list containing elements with overriden
==<http://github.com/jredville/ironruby/commit/585ab4...

*         closing Rubyforge [#21995] kind_of? not working with when
extend is
used<http://github.com/jredville/ironruby/commit/c288db...

*         recommiting some changes that were reverted by the merge.
Methinks someone in TFS changed them. This makes describe work with 2
strings for shared behaviors, and it makes csc output #line
pragmas<http://github.com/jredville/ironruby/commit/ac44e0...

*         fixing some more errors from the
merge<http://github.com/jredville/ironruby/commit/c42e84...

*         Adding class instantiation specs for regular classes with
overloaded
constructors<http://github.com/jredville/ironruby/commit/eba230...

*         adding regression tests for [#22197] calling super throw
Argument
Error<http://github.com/jredville/ironruby/commit/9313a9...

*         adding StringBuilder specs to get rid of test_basic.rb. Also
added equal_clr_string
matcher<http://github.com/jredville/ironruby/commit/09d04d...

*         refactor specs to use the equal_clr_string
matcher<http://github.com/jredville/ironruby/commit/410fab...

*         basic string specs to remove
test_basic.rb<http://github.com/jredville/ironruby/commit/044752...

*         added more string specs to get rid of test_basic. Also adds
field
specs<http://github.com/jredville/ironruby/commit/de239f...

*         adding some basic event add and remove
specs<http://github.com/jredville/ironruby/commit/bf37c1...

*         added event invocation
specs<http://github.com/jredville/ironruby/commit/a39dae...



JD
This topic is locked and can not be replied to.