I am honored to announce the immediate release of RubyCocoa 0.11.0.
RubyCocoa is a Mac OS X framework that allows Cocoa programming in the
object-oriented scripting language Ruby. In other words, it is a
bridge that let you access Objective-C objects from Ruby, and
You can learn more about RubyCocoa on our new website (which is
actually a Wiki):
This is one of the biggest releases we ever made, thanks to all
contributors. All RubyCocoa users are encouraged to upgrade.
Following are the release notes. Enjoy!
The RubyCocoa Team
- Now shipping with RDoc HTML/ri files covering the frameworks
RubyCocoa supports. The methods and their documentation come from the
latest reference documentation from Apple (07-05-2007) and have been
parsed and manipulated to look like the syntax used on the Ruby side
- Better global support for the C bits of frameworks, thanks to the
new BridgeSupport changes. More exposure of C symbols, support for
string constants, inline functions, functions with pointer-like
arguments, function pointer arguments, opaque structures, magic-cookie
constants, and more. Support for endianness-specific elements. Support
- Introduced ActiveRecord bindings. It means that you can now use
ActiveRecord in the same way you would use CoreData when writing the
backend of your application. It also has support for ActiveRecord
migrations. It comes with some extra OSX support, like creating and
connecting to a SQLite database in the user’s ~/Library. There’s also
a NSTableView subclass which has one extra instance method which
allows you to scaffold the table columns for a given model.
- Added support for overriding class methods, using
#objc_class_method. #objc_export has been deprecated and #objc_method
should be used instead.
- Added support for aliasing Objective-C methods from ruby, via
#objc_alias_method and #objc_alias_class_method.
- Introduced new RBBundle API, to use RubyCocoa in a bundle (like
- Added syntax-sugar APIs to manage property lists. OSA.load_plist, to
deserialize plist data of any format to a Ruby object.
#to_plist(format=nil), to convert the given Ruby object to plist data
of the given format (XML by default).
- Better interface of basic Objective-C types and their Ruby
equivalents. NSString responds to all methods String does. Time
objects are converted to NSDate objects. Added NSObject#to_ruby, which
converts the given Cocoa type to the Ruby equivalent (converting
sub-elements for NSArray and NSDictionary).
- Support for C/Objective-C APIs using format strings. RubyCocoa is
now able to parse the format string value and appropriately convert
the variable arguments to the right type.
- Better ObjcPtr API. #assign, to assign a value to the pointer. #,
to retrieve something at a particular index. #=, to assign something
at a particular index. #regard_as, to specify the Objective-C encoding
of the receiver.
- New tool: rb_nibtool.rb, to synchronize nib files with RubyCocoa
source files. Added #ib_action to declare IBAction methods. Not
necessary unless you want to use the tool.
- New tool: standalonify.rb, to detect all the Ruby dependencies of
your application (including gems) and generate a new application with
everything inside, to make easier its deployment.
- Added Xcode templates to do Ruby unit testing.
- RubyCocoa can now build 64-bit and fundamentally work on a 64-bit
environment. However all tests are not passing yet.
- New sample code: sample/ViewModelDemo, sample/RubyAnywhere,
sample/VPRubyPluginEnabler, sample/Fortune.wdgt, sample/CocoaRepl,
- Ruby 1.9 compatibility fixes.
- Now manually decoding the Objective-C runtime types.
- Better RBObject retention mechanism.
- Make sure builtin frameworks cannot be required twice.
- Fixed a memory leak when calling RBApplicationMain more than once.
- Converted the Xcode templates property lists from the old OpenStep
format to UTF-8 XML.
- Fixed the import of NSProxy-based classes.
- Fixed a bug in the direct override code.
- Various fixes to make Cocoa printing functional (see the PathDemo
sample for an example).
- Make sure everything is compiled with -O3. This is to make sure the
FFI-generated closures are callable from the generated
by GCC. Otherwise closures return C structure may cause memory
- Fixed a bug in the OCException class (making sure #userInfo is
binded to the right instance variable).
- Deprecated ns_override, ns_outlet.
- Make sure to return nil when easy dispatching void methods.
- Fixed a dispatching issue about omitted pointers and CFType-like args.
- Ported to the 2.0 Objective-C runtime. Compatibility with the
previous runtime is ensured.
- Do not access ruby_frame->last_func directly.
- Make sure to ignore classes that start with a lower character.
Normally Ruby forbids this but some SWIG-based extensions have such
- Now converting Ruby arrays to C-like arrays for arguments of type
‘in’ that represent an array of a variable length.
- Fixed ObjCID#inspect.
- Fixed memory leaks in Ruby ↔ ObjC messaging.
- Allows RubyCocoa to be called by Objective-C from a thread that
isn’t the main one, by routing the NSInvocation / FFI closure into the
main thread via the main run loop. Prints a warning before routing.
This is to avoid a crash since Ruby isn’t thread-safe.
- Refactored attachments to add methods directly to the Objective-C
class and not using modules anymore, fixed NSEnumerator#to_a.
- Fixed direct method override feature for Ruby > 1.8.2 and < 1.8.5.
- Better backtrace information of exceptions raised from Ruby.
- When wrapping a returned ocid in a Ruby object, if the wanted class
name can’t be a constant (because starting with ‘_’ or [a-z]), try to
use the superclass name when possible.
- Do not crash if one resource (for example rb_main.rb) isn’t found,
but propose a clear message to the user instead.
- Added support for getting C_ARY_B type arguments by reference.
- Now configure the deployment target based on the
–macosx-deployment-target parameter passed to install.rb config.
- Fixed a bug in [-setValue:forUndefinedKey:] to not insert nil values
in the cache dictionary.
- Introduced a new config phase variable, ‘build-as-embeddable’,
turned on by default, which builds RubyCocoa.framework with an
INSTALL_PATH set to
turned off, INSTALL_PATH will get an absolute path value (the value of
the ‘frameworks’ config phase variable).
- Fixed some bugs when messaging Ruby from Objective-C. Fixed a bug
when the Ruby proxy cannot be determined, and another when OSX methods
couldn’t be called directly on an Objective-C class from Ruby
- Do not allow pointers arguments that don’t have an ‘out’ type
modifier to be omitted.
- Ignore the ‘Nil’ Foundation enumeration.
- Better behavior for C-array like arguments with a length argument.
Do not emit a warning anymore if a value is passed for the length
argument. If the value is either negative or greater than the size of
the given array, raise an exception. Otherwise, just pass the value.
- OSX.objc_symbol_to_obj has been obsoleted.
- Added support to decode structure fields of the union type.
- Properly handle exceptions NSGetSizeAndAlignment could throw.
- Increased the method encoding buffer when analyzing its arguments.