Hi, Today I merged some patches by Alexander Flatter. He wrote some test cases for HotCocoa, namely: mapping_test.rb, mappings_test.rb, and plist_test.rb. And he also merged and tested Vincent's patch #209. http://www.macruby.org/trac/ticket/209 So first, thanks to you both! :) There are still some problems, which may or may not be related to MacRuby itself. Where they do, they are most probably caused by the constant lookup problem which was fixed. Or might need more fixing… Alexander had to add a work around for this as well, see lib/hotcocoa/ object_ext.rb. The tests in sample-macruby/HotCocoa/graphics/*.rb all have failures. (Should these be moved to test-macruby/cases/hotcocoa btw?) The samples however do work again. Calculater works seemingly, as does LayoutView. However Demo still has issues with the movie and web views. Any input on it would be appreciated, because I myself haven't found the time yet to really play around with HotCocoa. Also, anyone feel free to revert any patch :) This might also be a good time to add that in the future I would like to encourage patches with test coverage. I know it's hard to get into when there aren't much examples yet, but we are slowly getting there. And since time is already a rare luxury for everybody working on this, it will be easier and faster to verify and apply patches. Any thoughts on this subject are also very much appreciated. - Eloy
Hey, Attached a patch with the fix. I checked the test and the fix does indeed make it pass. In my change I also changed Object#full_const_get to return nil (and not false) when it does not find a constant because false seemed odd to me. What do you think? Cheers
Hey, The test looks good to me and I totally agree, false is more unexpected then nil in this case. So then I looked up the tests for it from extlib: http://github.com/sam/extlib/blob/2bc2e8a42c7a49e2e5daf530c29fb2840d0e299d/s... And it doesn't even test for the case that a constant can't be found. Anyways, I think we should copy over that existing test and add an extra one for when a constant can't be looked up. In cases/hotcocoa/object_ext_test.rb. Also, Alexander, you might want to take those changes and tests upstream back to extlib. Cheers, Eloy On 21 jan 2009, at 23:33, Vincent Isambart wrote:
Hey,
Attached a patch with the fix. I checked the test and the fix does indeed make it pass. In my change I also changed Object#full_const_get to return nil (and not false) when it does not find a constant because false seemed odd to me. What do you think?
Cheers
<0001-Fixed-HotCocoa-mapping-after-framework- load.patch>_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Hi there, The extlib's #full_const_get will raise an NameError if there's no constant found. That's what I changed. I agree that returning nil is more adequate than false though we should perhaps stay as near to extlib as possible and raise exceptions to prevent incompatibilities (think of MacRuby users that want to use datamapper). ---- SNIP: extlib behaviour ----
class A; class B; end; end => nil
A.full_const_get 'A::B' NameError: uninitialized constant A::A
A.full_const_get 'B' => A::B
Object.full_const_get 'A::B' => A::B
---- /SNIP ---- Giving some tests back to extlib should be no problem. On Thu, Jan 22, 2009 at 12:06 AM, Eloy Duran <eloy.de.enige@gmail.com> wrote:
Hey,
The test looks good to me and I totally agree, false is more unexpected then nil in this case.
So then I looked up the tests for it from extlib: http://github.com/sam/extlib/blob/2bc2e8a42c7a49e2e5daf530c29fb2840d0e299d/s... And it doesn't even test for the case that a constant can't be found.
Anyways, I think we should copy over that existing test and add an extra one for when a constant can't be looked up. In cases/hotcocoa/object_ext_test.rb.
Also, Alexander, you might want to take those changes and tests upstream back to extlib.
Cheers, Eloy
On 21 jan 2009, at 23:33, Vincent Isambart wrote:
Hey,
Attached a patch with the fix. I checked the test and the fix does indeed make it pass. In my change I also changed Object#full_const_get to return nil (and not false) when it does not find a constant because false seemed odd to me. What do you think?
Cheers
<0001-Fixed-HotCocoa-mapping-after-framework-load.patch>_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Ah yes I see. Actually I think we should just use the original version. Because NameError is what I'd expect it would do. So in our case where the user has specified a framework to be loaded, the constant lookup should occur once the framework is loaded, like in Vincents patch. Eloy On Jan 22, 2009, at 8:39 AM, Alexander Flatter wrote:
Hi there,
The extlib's #full_const_get will raise an NameError if there's no constant found. That's what I changed.
I agree that returning nil is more adequate than false though we should perhaps stay as near to extlib as possible and raise exceptions to prevent incompatibilities (think of MacRuby users that want to use datamapper).
---- SNIP: extlib behaviour ----
class A; class B; end; end => nil
A.full_const_get 'A::B' NameError: uninitialized constant A::A
A.full_const_get 'B' => A::B
Object.full_const_get 'A::B' => A::B
---- /SNIP ----
Giving some tests back to extlib should be no problem.
On Thu, Jan 22, 2009 at 12:06 AM, Eloy Duran <eloy.de.enige@gmail.com> wrote:
Hey,
The test looks good to me and I totally agree, false is more unexpected then nil in this case.
So then I looked up the tests for it from extlib: http://github.com/sam/extlib/blob/2bc2e8a42c7a49e2e5daf530c29fb2840d0e299d/s... And it doesn't even test for the case that a constant can't be found.
Anyways, I think we should copy over that existing test and add an extra one for when a constant can't be looked up. In cases/hotcocoa/object_ext_test.rb.
Also, Alexander, you might want to take those changes and tests upstream back to extlib.
Cheers, Eloy
On 21 jan 2009, at 23:33, Vincent Isambart wrote:
Hey,
Attached a patch with the fix. I checked the test and the fix does indeed make it pass. In my change I also changed Object#full_const_get to return nil (and not false) when it does not find a constant because false seemed odd to me. What do you think?
Cheers
<0001-Fixed-HotCocoa-mapping-after-framework- load.patch>_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Hi there, Got to correct you, plist_test.rb already existed as the only one. ;-) I'll try to take look into the graphics demo and see what's wrong. Greetings On Tue, Jan 20, 2009 at 9:13 PM, Eloy Duran <eloy.de.enige@gmail.com> wrote:
Hi,
Today I merged some patches by Alexander Flatter. He wrote some test cases for HotCocoa, namely: mapping_test.rb, mappings_test.rb, and plist_test.rb. And he also merged and tested Vincent's patch #209. http://www.macruby.org/trac/ticket/209
So first, thanks to you both! :)
There are still some problems, which may or may not be related to MacRuby itself. Where they do, they are most probably caused by the constant lookup problem which was fixed. Or might need more fixing… Alexander had to add a work around for this as well, see lib/hotcocoa/object_ext.rb.
The tests in sample-macruby/HotCocoa/graphics/*.rb all have failures. (Should these be moved to test-macruby/cases/hotcocoa btw?) The samples however do work again. Calculater works seemingly, as does LayoutView. However Demo still has issues with the movie and web views.
Any input on it would be appreciated, because I myself haven't found the time yet to really play around with HotCocoa. Also, anyone feel free to revert any patch :)
This might also be a good time to add that in the future I would like to encourage patches with test coverage. I know it's hard to get into when there aren't much examples yet, but we are slowly getting there. And since time is already a rare luxury for everybody working on this, it will be easier and faster to verify and apply patches. Any thoughts on this subject are also very much appreciated.
- Eloy _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Hehe, cool thanks :) I guess that's also then why it was written in oldskool test unit style instead of descriptions. Will have to fix that as well one of these days… - Eloy On Jan 22, 2009, at 9:31 AM, Alexander Flatter wrote:
Hi there,
Got to correct you, plist_test.rb already existed as the only one. ;-) I'll try to take look into the graphics demo and see what's wrong.
Greetings
On Tue, Jan 20, 2009 at 9:13 PM, Eloy Duran <eloy.de.enige@gmail.com> wrote:
Hi,
Today I merged some patches by Alexander Flatter. He wrote some test cases for HotCocoa, namely: mapping_test.rb, mappings_test.rb, and plist_test.rb. And he also merged and tested Vincent's patch #209. http://www.macruby.org/trac/ticket/209
So first, thanks to you both! :)
There are still some problems, which may or may not be related to MacRuby itself. Where they do, they are most probably caused by the constant lookup problem which was fixed. Or might need more fixing… Alexander had to add a work around for this as well, see lib/hotcocoa/object_ext.rb.
The tests in sample-macruby/HotCocoa/graphics/*.rb all have failures. (Should these be moved to test-macruby/cases/hotcocoa btw?) The samples however do work again. Calculater works seemingly, as does LayoutView. However Demo still has issues with the movie and web views.
Any input on it would be appreciated, because I myself haven't found the time yet to really play around with HotCocoa. Also, anyone feel free to revert any patch :)
This might also be a good time to add that in the future I would like to encourage patches with test coverage. I know it's hard to get into when there aren't much examples yet, but we are slowly getting there. And since time is already a rare luxury for everybody working on this, it will be easier and faster to verify and apply patches. Any thoughts on this subject are also very much appreciated.
- Eloy _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
participants (3)
-
Alexander Flatter
-
Eloy Duran
-
Vincent Isambart