Re: [MacRuby-devel] MacRuby 0.9 - crash using Proc.new with NSArray.enumerateObjectsUsingBlock

2011-02-13 Thread Laurent Sansonetti
Hi Jonathan, Your snippet does not require the Foundation framework. Add the following line to your script framework 'Foundation' You will also need MacRuby 0.8 and the latest BridgeSupport Preview 3 release. Then let us know if you still reproduce the crash. The snippet works fine i

Re: [MacRuby-devel] MacRuby 0.9 - crash using Proc.new with NSArray.enumerateObjectsUsingBlock

2011-02-13 Thread Matt Aimonetti
That's really odd, can we see the stack trace? My guess is that BridgeSupport isn't properly installed. Can you try to reinstall it (if Jordan's suggestions don't help). - Matt Sent from my iPhone On Feb 13, 2011, at 14:03, Robert Payne wrote: > I'm actually experiencing this on my iMac now b

Re: [MacRuby-devel] MacRuby 0.9 - crash using Proc.new with NSArray.enumerateObjectsUsingBlock

2011-02-13 Thread Robert Payne
I'm actually experiencing this on my iMac now but it doesn't occur on my laptop. -Robert On Feb 14, 2011, at 10:57 AM, Jordan K. Hubbard wrote: > Dang, that's it for ideas from me. Just to check all the boxes, when you: > > 1. Have no signs of Xcode4 on your system but are clearly using Xcod

Re: [MacRuby-devel] MacRuby 0.9 - crash using Proc.new with NSArray.enumerateObjectsUsingBlock

2011-02-13 Thread Jordan K. Hubbard
Dang, that's it for ideas from me. Just to check all the boxes, when you: 1. Have no signs of Xcode4 on your system but are clearly using Xcode3. 2. Have installed BS Preview 3 3. Have installed MacRuby from -trunk rather than 0.8 The problem persists, yes? Thanks, - Jordan On Feb 13, 2011, a

Re: [MacRuby-devel] MacRuby 0.9 - NSDate initWithTimeInterval:sinceDate: problem

2011-02-13 Thread Alan Skipp
I think you've just managed to get your variable names mixed up. You've used 'cocoaFinishTime' where you should have used 'cocoaTime' last line should be: puts "Cocoa Later time: #{cocoaFinishTime}, interval: #{cocoaFinishTime.timeIntervalSinceDate(cocoaTime)} seconds" al On 13 Feb 2011, at 1

Re: [MacRuby-devel] MacRuby 0.9 - crash using Proc.new with NSArray.enumerateObjectsUsingBlock

2011-02-13 Thread Jonathan Waddilove
Just reinstalled xcode 3, MacRuby 0.8 and added BS preview 3 - still have the same problem:-( -Jonathan On 13 Feb 2011, at 19:14, Jordan K. Hubbard wrote: > And with the most recent BridgeSupport installed? > > On Feb 13, 2011, at 10:53 AM, Jonathan Waddilove wrote: > >> I'm on 10.6.6 wit

Re: [MacRuby-devel] MacRuby 0.9 - crash using Proc.new with NSArray.enumerateObjectsUsingBlock

2011-02-13 Thread Robert Payne
Yes Bridge Support Preview 3 -Robert On Feb 14, 2011, at 8:14 AM, Jordan K. Hubbard wrote: > And with the most recent BridgeSupport installed? > > On Feb 13, 2011, at 10:53 AM, Jonathan Waddilove wrote: > >> I'm on 10.6.6 with MacRuby 0.9 >> >> -Jonathan >> >> >> On 13 Feb 2011, at 18:18,

Re: [MacRuby-devel] MacRuby 0.9 - crash using Proc.new with NSArray.enumerateObjectsUsingBlock

2011-02-13 Thread Jordan K. Hubbard
And with the most recent BridgeSupport installed? On Feb 13, 2011, at 10:53 AM, Jonathan Waddilove wrote: > I'm on 10.6.6 with MacRuby 0.9 > > -Jonathan > > > On 13 Feb 2011, at 18:18, Robert Payne wrote: > >> I did notice I was getting the same error and crash when I was calling >> Objecti

Re: [MacRuby-devel] MacRuby 0.9 - crash using Proc.new with NSArray.enumerateObjectsUsingBlock

2011-02-13 Thread Jonathan Waddilove
I'm on 10.6.6 with MacRuby 0.9 -Jonathan On 13 Feb 2011, at 18:18, Robert Payne wrote: > I did notice I was getting the same error and crash when I was calling > Objective-C/C methods with blocks that didn't name the parameters in their > typing such as void(^)(NSInteger) instead of void(^)(

Re: [MacRuby-devel] MacRuby 0.9 - crash using Proc.new with NSArray.enumerateObjectsUsingBlock

2011-02-13 Thread Robert Payne
I did notice I was getting the same error and crash when I was calling Objective-C/C methods with blocks that didn't name the parameters in their typing such as void(^)(NSInteger) instead of void(^)(NSInteger result) but all of Apple's API name the parameters. It could be something else in MacRu

Re: [MacRuby-devel] MacRuby 0.9 - crash using Proc.new with NSArray.enumerateObjectsUsingBlock

2011-02-13 Thread Jonathan Waddilove
OK, thanks for having a look I thought I'd raise the issue incase it's a bug that needs addressing before 1.0 I guess it could be something subtle in my environment. best wishes, Jonathan On 13 Feb 2011, at 18:11, Robert Payne wrote: > I just updated to the latest source just to be safe a

Re: [MacRuby-devel] MacRuby 0.9 - crash using Proc.new with NSArray.enumerateObjectsUsingBlock

2011-02-13 Thread Robert Payne
I just updated to the latest source just to be safe and I'm still not getting any issues with it... someone else might be able to help. -Robert On 14/02/2011, at 7:01 AM, Jonathan Waddilove wrote: > Hello Robert, > > Sorry, I must be using the 'other' macirb ;-) - still doesn't work, here's

Re: [MacRuby-devel] MacRuby 0.9 - crash using Proc.new with NSArray.enumerateObjectsUsingBlock

2011-02-13 Thread Jonathan Waddilove
Hello Robert, Sorry, I must be using the 'other' macirb ;-) - still doesn't work, here's the output JTW:~ jonathan$ macirb irb(main):001:0> framework "Cocoa" => true irb(main):002:0> a = [0,1,2,3,4] => [0, 1, 2, 3, 4] irb(main):003:0> a.enumerateObjectsUsingBlock(Proc.new{|object, index, stop|

Re: [MacRuby-devel] MacRuby 0.9 - crash using Proc.new with NSArray.enumerateObjectsUsingBlock

2011-02-13 Thread Robert Payne
Hi Jonathan, Can you try just exactly this in macirb? framework "Cocoa" a = [0,1,2,3,4] a.enumerateObjectsUsingBlock(Proc.new{|object, index, stop| puts "#{object}" }) It's working over here in MacIrb On 14/02/2011, at 6:52 AM, Jonathan Waddilove wrote: > Hi Robert, Thanks for the quick

Re: [MacRuby-devel] MacRuby 0.9 - crash using Proc.new with NSArray.enumerateObjectsUsingBlock

2011-02-13 Thread Jonathan Waddilove
Hi Robert, Thanks for the quick response. I'm using trunk (installed straight from the MacRuby front page). For what it's worth I have both Xcode3 and Xcode4 installed but can happily reproduce the error in textmate/xcode3/macirb regards Jonathan On 13 Feb 2011, at 17:31, Robert Payne wrote:

Re: [MacRuby-devel] MacRuby 0.9 - crash using Proc.new with NSArray.enumerateObjectsUsingBlock

2011-02-13 Thread Robert Payne
Hi Jonathan, The syntax looks good and it works on my end. Are you using a nightly of MacRuby or the 0.8 trunk? a = [0,1,2,3,4] puts "#{a}" a.enumerateObjectsUsingBlock(Proc.new{|object, index, stop| puts "object: #{object}" }) On 14/02/2011, at 5:55 AM, Jonathan Waddilove wrote: > Hi,

[MacRuby-devel] MacRuby 0.9 - crash using Proc.new with NSArray.enumerateObjectsUsingBlock

2011-02-13 Thread Jonathan Waddilove
Hi, another MacRuby 0.9 question... I've been trying to use lambda and/or Proc.new to provide callback blocks (as suggested in Matt's excellent draft book). Again I have seen discussions about problems in this area and for me all the suggested variants of code fail. Here's a snip of failing cod

[MacRuby-devel] MacRuby 0.9 - NSDate initWithTimeInterval:sinceDate: problem

2011-02-13 Thread Jonathan Waddilove
Hi, I have been trying to use the NSDate initWithTimeInterval:sinceDate: method to measure elapsed times. I know there has been some discussion about the mapping from Cocoa NSDate to Ruby Time and back but I'm not sure if this is supposed to be working now? Here's a snip of code that calculates

Re: [MacRuby-devel] Issue with running unit tests when requiring rubygems

2011-02-13 Thread Gabriel Ayuso
I reinstalled the minitest and mocha gems to the following versions: minitest-2.0.2, mocha-0.9.12 The same issue I described before occurred once again. Here's the code I ran on macirb and the result: require 'rubygems' #=> true gem 'minitest' #=> true require 'test/unit'

Re: [MacRuby-devel] Issue with running unit tests when requiring rubygems

2011-02-13 Thread Eloy Duran
Did you also try installing the latest minitest + mocha as suggested? I would expect that to fix such issues. Which would also mean that, like Joshua suggested, we should update our version in stdlib. On 11 feb 2011, at 23:53, Gabriel Ayuso wrote: > I did a little more testing and I found out t

[MacRuby-devel] MacRuby Unit Test Code Coverage

2011-02-13 Thread Gabriel Ayuso
MacRuby is great for testing not only MacRuby code but also Objective-C code. I find it nicer than using OCTest and OCMock. Is there a way to use existing code coverage tools such as rcov or gcov to check the coverage of MacRuby unit tests? Thanks, Gabriel Ayuso _