Re: [MacRuby-devel] Crash with NSUInteger in delegate method

2009-05-22 Thread Łukasz Adamczak
> an NSNumber object should do it.

Laurent, thanks for the answer. I believed that was the case.

What about the delegate method case, though? I mean, the framework I'm
playing with expects a certain delegate method and passes C unsigned
ints to it:

http://github.com/lukhnos/objectiveflickr/blob/b480aa39fa0e96f40a1b44523e0b6f918b2ed441/Source/ObjectiveFlickr.m#L525

In this case I have no say in the Objective-C side of things. I write
only Ruby code. The only thing I can do is to not implement the method
at all (and lose some functionality provided by the framework).
Obviously in an open-source environment I'm free to patch the library
to my liking, but that's not optimal and not always possible.

There may be more cases like this. Unless there is a policy on not
using primitive types in delegates (is there?), more libraries (or
maybe Cocoa itself?) can have problems with MacRuby.


-- 
Regards,
Łukasz Adamczak
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] REXML

2009-05-22 Thread Robert Rice

Dear MacRuby development team:

I am new to Ruby and I have an application that I would like to port  
to MacRuby. The two extensions I will need are XML and serial port I/O.

So far I have not been able to get them to work:

Last login: Fri May 22 12:31:48 on ttys000
new-host:~ robertrice$ macirb
>> require "rexml/document"
NameError: uninitialized constant REXML::Attribute::NAME_STR
	from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 
1.9.1/rexml/attribute.rb:18:in `'
	from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 
1.9.1/rexml/attribute.rb:9:in `'
	from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 
1.9.1/rexml/attribute.rb:4:in `'
	from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 
1.9.1/rexml/element.rb:3:in `require'
	from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 
1.9.1/rexml/element.rb:3:in `'
	from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 
1.9.1/rexml/document.rb:1:in `require'
	from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 
1.9.1/rexml/document.rb:1:in `'

from (irb):1:in `require'
from (irb):1
from /usr/local/bin/macirb:12:in `'
>> require "rubygems"
=> false
>> require "serialport"
LoadError: no such file to load -- serialport
from (irb):3:in `require'
from (irb):3
from /usr/local/bin/macirb:12:in `'
>> exit
new-host:~ robertrice$ exit
logout

[Process completed]

Can anyone help me? Do I have a bad installation of MacRuby?

Thanks,
Bob Rice
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] REXML

2009-05-22 Thread Matt Aimonetti
For XML, you can use Cocoa API or if you want to ue REXML, you need to use
the hot patch I mentioned there:

http://www.macruby.org/trac/ticket/134

Regarding the serialport library, I can't seem to see it on rubyforge, so
I'm not sure what you are referring to.

- Matt

On Fri, May 22, 2009 at 9:44 AM, Robert Rice  wrote:

> Dear MacRuby development team:
>
> I am new to Ruby and I have an application that I would like to port to
> MacRuby. The two extensions I will need are XML and serial port I/O.
> So far I have not been able to get them to work:
>
> Last login: Fri May 22 12:31:48 on ttys000
> new-host:~ robertrice$ macirb
> >> require "rexml/document"
> NameError: uninitialized constant REXML::Attribute::NAME_STR
>from
> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/attribute.rb:18:in
> `'
>from
> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/attribute.rb:9:in
> `'
>from
> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/attribute.rb:4:in
> `'
>from
> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/element.rb:3:in
> `require'
>from
> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/element.rb:3:in
> `'
>from
> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/document.rb:1:in
> `require'
>from
> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/document.rb:1:in
> `'
>from (irb):1:in `require'
>from (irb):1
>from /usr/local/bin/macirb:12:in `'
> >> require "rubygems"
> => false
> >> require "serialport"
> LoadError: no such file to load -- serialport
>from (irb):3:in `require'
>from (irb):3
>from /usr/local/bin/macirb:12:in `'
> >> exit
> new-host:~ robertrice$ exit
> logout
>
> [Process completed]
>
> Can anyone help me? Do I have a bad installation of MacRuby?
>
> Thanks,
> Bob Rice
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] A MacRuby-users group?

2009-05-22 Thread Łukasz Adamczak
I'd like to propose the creation of macruby-users mailing list or an
appropriate discussion board (the latter maybe even preferred).
I'm thinking of a place for people using MacRuby for their apps, but
not necessarily hacking on MacRuby itself.

It feels a little intimidating to post to a "-devel" group, and I feel
even I might be of some help to folks at a "-users" group.
I don't mind starting something myself, but maybe an "official"
discussion board is on the way.

-- 
Regards,
Łukasz Adamczak
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Crash with NSUInteger in delegate method

2009-05-22 Thread Laurent Sansonetti

Hi Łukasz,

On May 22, 2009, at 1:58 AM, Łukasz Adamczak wrote:


an NSNumber object should do it.


Laurent, thanks for the answer. I believed that was the case.

What about the delegate method case, though? I mean, the framework I'm
playing with expects a certain delegate method and passes C unsigned
ints to it:

http://github.com/lukhnos/objectiveflickr/blob/b480aa39fa0e96f40a1b44523e0b6f918b2ed441/Source/ObjectiveFlickr.m#L525

In this case I have no say in the Objective-C side of things. I write
only Ruby code. The only thing I can do is to not implement the method
at all (and lose some functionality provided by the framework).
Obviously in an open-source environment I'm free to patch the library
to my liking, but that's not optimal and not always possible.

There may be more cases like this. Unless there is a policy on not
using primitive types in delegates (is there?), more libraries (or
maybe Cocoa itself?) can have problems with MacRuby.


MacRuby can deal with specialized delegate methods like this one, but  
you need to generate a bridgesupport file for the framework you're  
targeting. Most frameworks that ship with Mac OS X are already  
covered, but in your case you might want to manually cover  
ObjectiveFlickr too.


You can learn more by reading the gen_bridge_metadata(1) or  
BridgeSupport(5) man-pages.


What's going to happen is that informal protocols will be described  
and at runtime MacRuby will appropriately use the right method  
encoding in case the selector matches.


HTH,
Laurent
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] A MacRuby-users group?

2009-05-22 Thread Laurent Sansonetti

Hi Łukasz,

This mailing-list was usually created for all people developing with  
MacRuby, not necessarily people developing MacRuby itself. But I can  
understand that the group name is ambiguous.


Just to let everyone know, there is absolutely no problem posting  
anything related to MacRuby on this list. It's also true that there  
are more users discussions than core discussions here, but this might  
change once we get more people involved in the project. I think that  
the list traffic is still very light so I wonder if we need 2 separate  
lists.


Any though? If most people agree to create a -users group I can ask  
for an official (macosforge.org) one.


Laurent

On May 22, 2009, at 10:09 AM, Łukasz Adamczak wrote:


I'd like to propose the creation of macruby-users mailing list or an
appropriate discussion board (the latter maybe even preferred).
I'm thinking of a place for people using MacRuby for their apps, but
not necessarily hacking on MacRuby itself.

It feels a little intimidating to post to a "-devel" group, and I feel
even I might be of some help to folks at a "-users" group.
I don't mind starting something myself, but maybe an "official"
discussion board is on the way.

--
Regards,
Łukasz Adamczak
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] REXML

2009-05-22 Thread Robert Rice

Matt:

Thanks for your quick reply.  The hot patch seems to work.

You may find serialport named as 'ruby-serialport'.

At one time I had serialport working in ruby 1.8.7 but then after  
attempting to install some other Gems I now get the error:


irb 0.9.5(05/04/13)
new-host:~ robertrice$ ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9.7.0]
new-host:~ robertrice$ irb
irb(main):001:0> require "rubygems"
=> true
irb(main):002:0> require "serialport"
[BUG] cross-thread violation on rb_gc()
ruby 1.8.6 (2008-08-11) [universal-darwin9.0]

Abort trap
new-host:~ robertrice$ exit
logout

[Process completed]

Could you suggest a fix for this?

Thanks,
Bob Rice


On May 22, 2009, at 12:59 PM, Matt Aimonetti wrote:

For XML, you can use Cocoa API or if you want to ue REXML, you need  
to use the hot patch I mentioned there:


http://www.macruby.org/trac/ticket/134

Regarding the serialport library, I can't seem to see it on  
rubyforge, so I'm not sure what you are referring to.


- Matt

On Fri, May 22, 2009 at 9:44 AM, Robert Rice   
wrote:

Dear MacRuby development team:

I am new to Ruby and I have an application that I would like to port  
to MacRuby. The two extensions I will need are XML and serial port I/ 
O.

So far I have not been able to get them to work:

Last login: Fri May 22 12:31:48 on ttys000
new-host:~ robertrice$ macirb
>> require "rexml/document"
NameError: uninitialized constant REXML::Attribute::NAME_STR
   from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ 
lib/ruby/1.9.1/rexml/attribute.rb:18:in `'
   from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ 
lib/ruby/1.9.1/rexml/attribute.rb:9:in `'
   from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ 
lib/ruby/1.9.1/rexml/attribute.rb:4:in `'
   from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ 
lib/ruby/1.9.1/rexml/element.rb:3:in `require'
   from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ 
lib/ruby/1.9.1/rexml/element.rb:3:in `'
   from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ 
lib/ruby/1.9.1/rexml/document.rb:1:in `require'
   from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ 
lib/ruby/1.9.1/rexml/document.rb:1:in `'

   from (irb):1:in `require'
   from (irb):1
   from /usr/local/bin/macirb:12:in `'
>> require "rubygems"
=> false
>> require "serialport"
LoadError: no such file to load -- serialport
   from (irb):3:in `require'
   from (irb):3
   from /usr/local/bin/macirb:12:in `'
>> exit
new-host:~ robertrice$ exit
logout

[Process completed]

Can anyone help me? Do I have a bad installation of MacRuby?

Thanks,
Bob Rice
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] REXML

2009-05-22 Thread Matt Aimonetti
Hi Bob,

 Unfortunately, the gem you are trying to use is based on a C extensions
which doesn't seem to be well written. That's why it doesn't run on Ruby
1.8.7. (and probably not 1.9)

Unfortunately, even if the gem was working fine, it wouldn't currently work
in MacRuby due to a lack of support for C extensions :(

You have a few options,
 1. wait for the next version of MacRuby which should support C extensions.
 2. fix the gem to use FFI instead (so it's compatible with JRuby, MacRuby
etc...
 3. Rewrite the C code in an obj-c wrapper that you load in macruby
 4. use the Cocoa API (I'm personally not familiar with the rs232/serial
API)
 5. something I'm not aware of which would totally solve your problem. (one
can always hope)

My guess is that you'd better off going with 4.

- Matt



On Fri, May 22, 2009 at 1:30 PM, Robert Rice  wrote:

> Matt:
> Thanks for your quick reply.  The hot patch seems to work.
> You may find serialport named as 'ruby-serialport'.
>
> At one time I had serialport working in ruby 1.8.7 but then after
> attempting to install some other Gems I now get the error:
>
> irb 0.9.5(05/04/13)
> new-host:~ robertrice$ ruby -v
> ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9.7.0]
> new-host:~ robertrice$ irb
> irb(main):001:0> require "rubygems"
> => true
> irb(main):002:0> require "serialport"
> [BUG] cross-thread violation on rb_gc()
> ruby 1.8.6 (2008-08-11) [universal-darwin9.0]
>
> Abort trap
> new-host:~ robertrice$ exit
> logout
>
> [Process completed]
>
> Could you suggest a fix for this?
>
> Thanks,
> Bob Rice
>
>
> On May 22, 2009, at 12:59 PM, Matt Aimonetti wrote:
>
> For XML, you can use Cocoa API or if you want to ue REXML, you need to use
> the hot patch I mentioned there:
>
> http://www.macruby.org/trac/ticket/134
>
> Regarding the serialport library, I can't seem to see it on rubyforge, so
> I'm not sure what you are referring to.
>
> - Matt
>
> On Fri, May 22, 2009 at 9:44 AM, Robert Rice  wrote:
>
>> Dear MacRuby development team:
>>
>> I am new to Ruby and I have an application that I would like to port to
>> MacRuby. The two extensions I will need are XML and serial port I/O.
>> So far I have not been able to get them to work:
>>
>> Last login: Fri May 22 12:31:48 on ttys000
>> new-host:~ robertrice$ macirb
>> >> require "rexml/document"
>> NameError: uninitialized constant REXML::Attribute::NAME_STR
>>from
>> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/attribute.rb:18:in
>> `'
>>from
>> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/attribute.rb:9:in
>> `'
>>from
>> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/attribute.rb:4:in
>> `'
>>from
>> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/element.rb:3:in
>> `require'
>>from
>> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/element.rb:3:in
>> `'
>>from
>> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/document.rb:1:in
>> `require'
>>from
>> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/document.rb:1:in
>> `'
>>from (irb):1:in `require'
>>from (irb):1
>>from /usr/local/bin/macirb:12:in `'
>> >> require "rubygems"
>> => false
>> >> require "serialport"
>> LoadError: no such file to load -- serialport
>>from (irb):3:in `require'
>>from (irb):3
>>from /usr/local/bin/macirb:12:in `'
>> >> exit
>> new-host:~ robertrice$ exit
>> logout
>>
>> [Process completed]
>>
>> Can anyone help me? Do I have a bad installation of MacRuby?
>>
>> Thanks,
>> Bob Rice
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] A MacRuby-users group?

2009-05-22 Thread Jeremy Voorhis
Personally, I'm in favor of a single mailing list, especially with a
small group like this. If there is some perception that a name ending
in -devel is intimidating, maybe we should just be pitched as "the
MacRuby mailing list" :)

Best,

Jeremy

On Fri, May 22, 2009 at 10:35 AM, Laurent Sansonetti
 wrote:
> Hi Łukasz,
>
> This mailing-list was usually created for all people developing with
> MacRuby, not necessarily people developing MacRuby itself. But I can
> understand that the group name is ambiguous.
>
> Just to let everyone know, there is absolutely no problem posting anything
> related to MacRuby on this list. It's also true that there are more users
> discussions than core discussions here, but this might change once we get
> more people involved in the project. I think that the list traffic is still
> very light so I wonder if we need 2 separate lists.
>
> Any though? If most people agree to create a -users group I can ask for an
> official (macosforge.org) one.
>
> Laurent
>
> On May 22, 2009, at 10:09 AM, Łukasz Adamczak wrote:
>
>> I'd like to propose the creation of macruby-users mailing list or an
>> appropriate discussion board (the latter maybe even preferred).
>> I'm thinking of a place for people using MacRuby for their apps, but
>> not necessarily hacking on MacRuby itself.
>>
>> It feels a little intimidating to post to a "-devel" group, and I feel
>> even I might be of some help to folks at a "-users" group.
>> I don't mind starting something myself, but maybe an "official"
>> discussion board is on the way.
>>
>> --
>> Regards,
>> Łukasz Adamczak
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] HotCocoa LayoutView Patch

2009-05-22 Thread dan sinclair

Hello,

Attached is a simple patch to make the ability to enable a border  
around a layout_view available without being in debug mode. It also  
allows different colours to be set on each layout_view. Makes it  
easier, for me at least, to figure out where all the bounding boxes  
are sitting.


Does this make sense to go back into SVN? Anything that should be  
changed to make it committable?


Thanks,
dan



frame_color.diff
Description: Binary data


___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel