[MacRuby-devel] obj.method(m) often gives a TypeError

2011-01-05 Thread Tim Rand
I noticed that obj.method(m) is often giving an error. The error given on
[].methods looks like:

Tim:~/Desktop> macirb
>> def err(obj)
>>   obj.methods(1,1).each do |m|
?> begin
?>   obj.method(m)
>> rescue => e
>>   p e
>> end
>>   end
>> end
=> nil
>> err([])
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#

No errors are raised with the same code (without parameters on the methods
of course) in ruby 1.9.1.
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] MacRuby class templates for Xcode 3

2011-01-05 Thread Takao Kouji
Hi,

I created MacRuby class templates for Xcode 3 on Mac OS X 10.6.

An attached patch contains below.
* misc/xcode-templates/File\ Templates/MacRuby/
  * TemplateChooser.plist
  * Ruby NSDocument subclass.pbfiletemplate  
  * Ruby class.pbfiletemplate
  * Ruby NSView subclass.pbfiletemplate  
  * Ruby NSWindowController subclass.pbfiletemplate

Please check it.

Thanks Kouji.
---
TAKAO Kouji 
blog: http://d.hatena.ne.jp/kouji0625/
twitter: takaokouji / projects: ruby, s7-seven



add-xcode-templates.patch
Description: Binary data
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] CoreAudio frameworks

2011-01-05 Thread kyossi
Hi,

> However, I do not see any struct definitions in the generated bridgesupport 
> file.

I found past discussions about C-struct and .bridgesupport. hope this help.

[MacRuby-devel] How to use custom C struct's?
http://www.mail-archive.com/[email protected]/msg01492.html


2011/1/5 Garett Shulman :
> Hello, is it possible to use CoreAudio frameworks from MacRuby?  I am trying 
> the following simple experiment:
> irb(main):001:0> framework 'AudioUnit'
> => true
> irb(main):002:0> load_bridge_support_file 'AudioUnit.bridgesupport'
> => main
> irb(main):003:0> AudioComponentFindNext(nil, [KAudioUnitType_Generator])
> TypeError: unrecognized runtime type `{AudioComponentDescription=I}'
>
> I create the bridgesupport file with: gen_bridge_metadata --64-bit -f 
> AudioUnit -o AudioUnit.bridgesupport
>
> However, I do not see any struct definitions in the generated bridgesupport 
> file.  If anyone has thoughts about documentation resources which may be 
> illuminating or any other insights or suggestions they would be greatly 
> appreciated.
>
> Thanks! -Garett
>
> ___
> 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] Using an SQLite wrapper with macruby

2011-01-05 Thread Ruben Fonseca
Hi all.

I'm trying to build a MacRuby 0.8 app with XCode. I want to interact with
an exisitng Sqlite3 database. Since I don't want to package or mess with
any Rubygem, I decided to look into existing Objective-C Sqlite wrappers.

I've tried PLDatabase and fmdb, and failed with both. The code compiles and
the application runs, but when calling a C function what accepts a va_arg
argument list, my app receives a EXC_BAD_INSTRUCTION.

Example:

Objective-C function interface:

- (FMResultSet *)executeQuery:(NSString*)sql, ... {

Ruby code

db.executeQuery "SELECT * FROM call"

it receives the error on this C line inside the executeQuery function

va_start(args, sql);


Any hints? Do you recommend a simple way of interacting with a Sqlite3
app with macruby + xcode, without using any gems?

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


[MacRuby-devel] Macruby support in Xcode 4?

2011-01-05 Thread Arron Mabrey
Hello,

Is anyone successfully using Macruby in Xcode 4?

I have seen on this list that there seem to be problems with Macruby
and IB in Xcode 4.
I'm wondering if that is still the case?


Thanks,

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


Re: [MacRuby-devel] Macruby support in Xcode 4?

2011-01-05 Thread Matt Aimonetti
Xcode 4 beta is under NDA and can't be addressed here.
However, the beta doesn't support MacRuby and you should really stay on
version 3 for now.

- Matt

On Wed, Jan 5, 2011 at 7:46 PM, Arron Mabrey  wrote:

> Hello,
>
> Is anyone successfully using Macruby in Xcode 4?
>
> I have seen on this list that there seem to be problems with Macruby
> and IB in Xcode 4.
> I'm wondering if that is still the case?
>
>
> Thanks,
>
> Arron
> ___
> 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] Using an SQLite wrapper with macruby

2011-01-05 Thread Laurent Sansonetti
Hi Ruben,

MacRuby cannot call vararg functions without proper BridgeSupport metadata, 
because there is no way it can determine at runtime if a function is variadic 
or not (because the call site must be compiled differently).

You may need to generate a BridgeSupport file for the wrapper you use. See the 
gen_bridge_metadata(1) man page for more info.

If the wrapper is a framework, you just copy the file in the 
Resources/BridgeSupport directory (as documented in the man page), then calling 
#framework from MacRuby will automatically parse it for you.

If the wrapper is a library that you link statically with your app, you will 
have to ship the BridgeSupport file in your app bundle, then use the 
#load_bridge_support_file method from the MacRuby side to load it up.

Laurent

On Jan 5, 2011, at 10:29 AM, Ruben Fonseca wrote:

> Hi all.
> 
> I'm trying to build a MacRuby 0.8 app with XCode. I want to interact with
> an exisitng Sqlite3 database. Since I don't want to package or mess with
> any Rubygem, I decided to look into existing Objective-C Sqlite wrappers.
> 
> I've tried PLDatabase and fmdb, and failed with both. The code compiles and
> the application runs, but when calling a C function what accepts a va_arg
> argument list, my app receives a EXC_BAD_INSTRUCTION.
> 
> Example:
> 
> Objective-C function interface:
> 
> - (FMResultSet *)executeQuery:(NSString*)sql, ... {
> 
> Ruby code
> 
> db.executeQuery "SELECT * FROM call"
> 
> it receives the error on this C line inside the executeQuery function
> 
> va_start(args, sql);
> 
> 
> Any hints? Do you recommend a simple way of interacting with a Sqlite3
> app with macruby + xcode, without using any gems?
> 
> Thank you
> Ruben
> ___
> 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] Using an SQLite wrapper with macruby

2011-01-05 Thread Matt Aimonetti
I also documented the process there:

http://ofps.oreilly.com/titles/9781449380373/ch03.html#_using_objective_c_or_c_code

- Matt

Sent from my iPhone

On Jan 5, 2011, at 21:31, Laurent Sansonetti  wrote:

> Hi Ruben,
> 
> MacRuby cannot call vararg functions without proper BridgeSupport metadata, 
> because there is no way it can determine at runtime if a function is variadic 
> or not (because the call site must be compiled differently).
> 
> You may need to generate a BridgeSupport file for the wrapper you use. See 
> the gen_bridge_metadata(1) man page for more info.
> 
> If the wrapper is a framework, you just copy the file in the 
> Resources/BridgeSupport directory (as documented in the man page), then 
> calling #framework from MacRuby will automatically parse it for you.
> 
> If the wrapper is a library that you link statically with your app, you will 
> have to ship the BridgeSupport file in your app bundle, then use the 
> #load_bridge_support_file method from the MacRuby side to load it up.
> 
> Laurent
> 
> On Jan 5, 2011, at 10:29 AM, Ruben Fonseca wrote:
> 
>> Hi all.
>> 
>> I'm trying to build a MacRuby 0.8 app with XCode. I want to interact with
>> an exisitng Sqlite3 database. Since I don't want to package or mess with
>> any Rubygem, I decided to look into existing Objective-C Sqlite wrappers.
>> 
>> I've tried PLDatabase and fmdb, and failed with both. The code compiles and
>> the application runs, but when calling a C function what accepts a va_arg
>> argument list, my app receives a EXC_BAD_INSTRUCTION.
>> 
>> Example:
>> 
>> Objective-C function interface:
>> 
>> - (FMResultSet *)executeQuery:(NSString*)sql, ... {
>> 
>> Ruby code
>> 
>> db.executeQuery "SELECT * FROM call"
>> 
>> it receives the error on this C line inside the executeQuery function
>> 
>> va_start(args, sql);
>> 
>> 
>> Any hints? Do you recommend a simple way of interacting with a Sqlite3
>> app with macruby + xcode, without using any gems?
>> 
>> Thank you
>> Ruben
>> ___
>> 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] Static Typing

2011-01-05 Thread Brad Hutchins
Will MacRuby eventually allow for optional Static Typing like in
Objective-C?
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Static Typing

2011-01-05 Thread Henry Maddocks

On 6/01/2011, at 2:34 PM, Brad Hutchins wrote:

> Will MacRuby eventually allow for optional Static Typing like in Objective-C?

No.



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


Re: [MacRuby-devel] Static Typing

2011-01-05 Thread Rich Morin
> No.

Gotta love categorical answers like this one.  They
always sound so definitive and are all too frequently
shown to be incorrect.

There's some really interesting work being done in
this area, so a better answer might be "not soon":

  The Mirah Programming Language
  http://www.mirah.org/

  Dynamic Inference of Static Types for Ruby
  http://www.cs.umd.edu/~jfoster/papers/popl11.pdf


-r
-- 
http://www.cfcl.com/rdmRich Morin
http://www.cfcl.com/rdm/resume [email protected]
http://www.cfcl.com/rdm/weblog +1 650-873-7841

Software system design, development, and documentation
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Static Typing

2011-01-05 Thread denny trebbin
mirah is a project to transform the beauty of ruby to java but with respecting 
the rules of java. so mirah forces you to use static typing.god i hope nobody 
tries to implement static typing in ruby. dynamic typing is so much more 
freedom and thanks to cucumber a breeze :)sorry but i hope this "no" for static 
typing is hammered into titan or something other very hard to break material.

--- Rich Morin  schrieb am Do, 6.1.2011:

Von: Rich Morin 
Betreff: Re: [MacRuby-devel] Static Typing
An: "MacRuby development discussions." 
Datum: Donnerstag, 6. Januar, 2011 05:31 Uhr

> No.

Gotta love categorical answers like this one.  They
always sound so definitive and are all too frequently
shown to be incorrect.

There's some really interesting work being done in
this area, so a better answer might be "not soon":

  The Mirah Programming Language
  http://www.mirah.org/

  Dynamic Inference of Static Types for Ruby
  http://www.cs.umd.edu/~jfoster/papers/popl11.pdf


-r
-- 
http://www.cfcl.com/rdm            Rich Morin
http://www.cfcl.com/rdm/resume     [email protected]
http://www.cfcl.com/rdm/weblog     +1 650-873-7841

Software system design, development, and documentation
___
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] Macruby support in Xcode 4?

2011-01-05 Thread Arron Mabrey
Thanks Matt

But just to be clear is support dependent on the Xcode team or is it
just a mater of the macruby team updating macruby once Xcode has
officially been released.

If your not sure or can not speak to the matter because of NDA thats
fine, I'm just curious in who's hands my future lies. :-)

Arron Mabrey


On Wed, Jan 5, 2011 at 2:30 PM, Matt Aimonetti  wrote:
> Xcode 4 beta is under NDA and can't be addressed here.
> However, the beta doesn't support MacRuby and you should really stay on
> version 3 for now.
>
> - Matt
>
> On Wed, Jan 5, 2011 at 7:46 PM, Arron Mabrey  wrote:
>>
>> Hello,
>>
>> Is anyone successfully using Macruby in Xcode 4?
>>
>> I have seen on this list that there seem to be problems with Macruby
>> and IB in Xcode 4.
>> I'm wondering if that is still the case?
>>
>>
>> Thanks,
>>
>> Arron
>> ___
>> 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] Static Typing

2011-01-05 Thread Henry Maddocks

On 6/01/2011, at 5:31 PM, Rich Morin wrote:

>> No.
> 
> Gotta love categorical answers like this one.  They
> always sound so definitive and are all too frequently
> shown to be incorrect.
> 
> There's some really interesting work being done in
> this area, so a better answer might be "not soon":
> 
>  The Mirah Programming Language
>  http://www.mirah.org/
> 
>  Dynamic Inference of Static Types for Ruby
>  http://www.cs.umd.edu/~jfoster/papers/popl11.pdf


Neither of those projects have anything to do with MacRuby and as far as I can 
they don't have much to do with MRI either so their impact will be academic at 
best. The Mirah project is trying to make ruby more like Java. Well there 
already is a language a lot like Java, it's called Java. If you prefer the 
Obj-C way of doing things then feel free to use Obj-C. Me, I like [Mac]Ruby 
just the way it is.

I don't go into McDonalds and complain that they don't make chicken like KFC. I 
go to KFC.

Seeing as I'm not a member of the MacRuby core team, or any team, you should 
take what I say with a bucket of salt. Therefore my answer was more a vote 
against static typing.

Henry

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


Re: [MacRuby-devel] obj.method(m) often gives a TypeError

2011-01-05 Thread Laurent Sansonetti
Hi Tim,

Try loading the Foundation framework first.

framework 'Foundation'

Laurent

On Jan 5, 2011, at 12:49 AM, Tim Rand wrote:

> I noticed that obj.method(m) is often giving an error. The error given on 
> [].methods looks like:
> 
> Tim:~/Desktop> macirb
> >> def err(obj)
> >>   obj.methods(1,1).each do |m|
> ?> begin
> ?>   obj.method(m)
> >> rescue => e
> >>   p e
> >> end
> >>   end
> >> end
> => nil
> >> err([])
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> #
> 
> No errors are raised with the same code (without parameters on the methods of 
> course) in ruby 1.9.1.
> 
> ___
> 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