We are pleased to announce the final release of MacRuby 0.5. After months of hard work and two successful beta releases, we believe 0.5 is good enough to replace the previous stable release, 0.4.
You can download it from here. Please note that this package only runs on Snow Leopard and above. Users on Leopard can also use MacRuby by building the sources from our repository.
Remember that while MacRuby is progressing quickly, it is still not recommended for mainstream development yet. We believe that MacRuby is stable in a lot of areas but others are still a work in progress.
As usual, please give it a try and be sure to report any problems you encounter to us.
If you’re just getting started with MacRuby 0.5, make sure to check out our articles on the previous beta releases: 0.5 beta 1 and 0.5 beta 2.
You can read about all the changes since the last beta in this status report e-mail on the mailing-list, but here are the most visible changes:
HotCocoa is a thin & idiomatic Ruby layer that sits above Cocoa and other frameworks, developed by Rich Kilmer. MacRuby 0.5 now supports HotCocoa.
HotCocoa used to be developed inside the MacRuby project, but we decided that it would have a better life on GitHub, where it is far easier for developers to submit contributions. HotCocoa also has been transformed as a gem and is included in the 0.5 package installer. Be sure to require rubygems before using it.
require 'rubygems'
require 'hotcocoa'
include HotCocoa
application do |app|
win = window :size => [100,50]
b = button :title => 'Hello'
b.on_action { puts 'World!' }
win << b
end
If you’re interested in HotCocoa, make sure to clone the project and start hacking!
The macrubyc command-line tool has been improved to support the compilation of multiple Ruby source file into dynamic libraries. This is useful when you have several executables sharing the same Ruby code.
$ cd /tmp $ echo "def hello(n); puts 'hello ' + n; end" > t1.rb $ echo "def hello_world; hello 'world'; end" > t2.rb $ echo "require 't1'; require 't2'; hello_world" > test.rb $ macrubyc t1.rb t2.rb -o code.dylib --dylib $ file code.dylib code.dylib: Mach-O 64-bit dynamically linked shared library x86_64 $ macrubyc test.rb code.dylib -o test $ rm t1.rb t2.rb test.rb $ ./test hello world
Also, macrubyc now comes with a man-page which provides more information on how to use it. Check it out!
$ man macrubyc
In this release, we completed our GCD support. Every C API of Grand Central Dispatch is now available from MacRuby. We also completed documentation (as rdoc comments), covered everything with specs and we now intend to support this API in further releases.
To get you started with GCD, we wrote a separate tutorial. Check it out!
We plan to provide higher-level, Ruby-centric API’s for GCD in future releases.