RubyCocoa
RubyCocoa is a macOS framework that provides a bridge between the Ruby and the Objective-C programming languages, allowing the user to manipulate Objective-C objects from Ruby, and vice versa. It makes it possible to write a Cocoa application completely in Ruby as well as to write an application that mixes Ruby and Objective-C code. An Apple project called MacRuby was under development to replace RubyCocoa in 2008. A proprietary spin-off called RubyMotion was subsequently released in 2012, available for iOS, macOS and Android. RubyCocoa is used for exploration of a Cocoa object's features with irb interactively, prototyping of a Cocoa application, writing a Cocoa application that combines the features of Ruby and Objective-C, and wrapping macOS' native GUI for a Ruby script. RubyCocoa is free software, released under both the Ruby License and the LGPL.
RubyCocoa is a macOS framework that provides a bridge between the Ruby and the Objective-C programming languages, allowing the user to manipulate Objective-C objects from Ruby, and vice versa. It makes it possible to write a Cocoa application completely in Ruby as well as to write an application that mixes Ruby and Objective-C code. An Apple project called MacRuby was under development to replace RubyCocoa in 2008. A proprietary spin-off called RubyMotion was subsequently released in 2012, available for iOS, macOS and Android. RubyCocoa is used for exploration of a Cocoa object's features with irb interactively, prototyping of a Cocoa application, writing a Cocoa application that combines the features of Ruby and Objective-C, and wrapping macOS' native GUI for a Ruby script. RubyCocoa is free software, released under both the Ruby License and the LGPL. [[NSWindow alloc] initWithContentRect:frame styleMask:NSTitledWindowMask backing:NSBackingStoreBuffered defer:NO] will become: OSX::NSWindow.alloc.initWithContentRect_styleMask_backing_defer(frame, OSX::NSTitledWindowMask, OSX::NSBackingStoreBuffered, false) As you can see, this decreases the code readability by rendering Objective-C parameter naming useless. So, there is another convenient way to write the method calls — the objc_send method, which accepts Ruby symbols as parameter names. For example, the previous code can also be written as: OSX::NSWindow.alloc.objc_send(:initWithContentRect, frame, :styleMask, OSX::NSTitledWindowMask, :backing, OSX::NSBackingStoreBuffered, :defer, false) ==References== ==External links== RubyCocoa page on SourceForge
References
No reference rows published for this article.
Cite this article
MLA
"RubyCocoa." encyclopegia.org, 2026, https://encyclopegia.org/wiki/rubycocoa. Accessed 24 November 2026.
Chicago
"RubyCocoa." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/rubycocoa.
APA
encyclopegia.org. (2026). RubyCocoa. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/rubycocoa
Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON
Claims
| Predicate | Value | Source |
|---|---|---|
| release date | 2012 | Wikipedia |