When I was still at Apple, I actually started work on a library for MacRuby backed by CoreData, but I had to leave it before it was done. To address the "why" question: CoreData ties in very closely with a lot of the Cocoa UI libraries (and other libraries). It also has features that other Ruby ORMs lack (like the ability to do fuzzy searching using NSPredicates). That said, it is a bit cumbersome if you're used to Ruby ORMs.

I don't have time currently to lead such a project, but I think it's an excellent idea and I will answer what questions I can. As it happens, my second Boston.rb talk covered some of working with CoreData from MacRuby…

Video: http://bostonrb.org/presentations/macruby-for-fun-and-profit
Slides: http://www.slideshare.net/jballanc/macruby-for-fun-and-profit

- Josh

On Monday, April 9, 2012 at 12:04 AM, Francis Chong wrote:

Compare with ActiveRecord/DataMapper, i really have no love on Core Data.

If MacRuby could run all those ActiveRecord/DataMapper adapters, there are few reason to use a Core Data wrapper (much like ruby dev will not ever normally use mysql/postgres gem directly). Certainly if such wrapper follow ActiveModel it would be very useful, but if we can already use AR to use sqlite db, why bother another layer of wrapper?

Colin Thomas-Arnold ©ó 2012¦~4¤ë9¤é ¤W¤È11:50 ¼g¹D¡G

tl;dr: I propose getting tutorials and code under one structured collection, and
to create classes that wrap Core Data in the same way HotCocoa wraps NSViews.

I agree with the sentiments about "setting ourselves apart". How do we do that?
Please allow me to pontificate. I apologize for the length.

I think we have already answered this question: Cocoa is huge and hard to learn
when you are getting started. Let's fix that!

Let's make it easy - NAY - FUN to get started. That's what made Rails so darn
popular, right? It's not because it was the fastest, or had a long history of
support, or zero bugs, or stability. It was FUN. And that's what *Ruby* is
about, too!

I think we should also show off how "grown up" MacRuby already is. When I saw
that there was already a Core Data project template, I was sold. If that
*hadn't* been there, I would have balked, for sure, and maybe even walked away.
Also, Matt Aimoetti's MacRuby book, and the upcoming book, MacRuby in Action,
indicate that the support is out there.

I think that HotCocoa is a great example of "fun" and "distinctive development
cycle". It aims to be a replacement for Interface Builder. I don't think we
need to stop there. We can replace *Xcode*. Hotcocoa already handles
compilation, using macrake to run or deploy or embed a project. If we could go
so far as to wrap up Core Data into ruby classes, hoohoo boy would we be having
fun then! "HotCocoaData" anyone?

For my part, I'd like to reach out to those of you that have collections of
recipes and tutorials, and start creating a structured repository of these
resources (jballanc/Josh recommended using the github wiki as this tutorial
repository).

I would *really* like it if our tutorials did the same things most
do (pushing a button => prints "hello" - WOW!), but then always take that a few
steps further. If it is easy to print "hello", why would you stop there? Do
something useful, or at least something complicated, that provides food for
thought.

With help, I think we could create a project that allows us to create Core
Data models using ruby code. At that point, *everything* could be done in ruby,
but with full access to Cocoa, and then we'd be doing something really exciting.
Not that MacRuby isn't already exciting - if it wasn't, we wouldn't be talking
about this stuff!

#colinta


_______________________________________________
MacRuby-devel mailing list

_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel