4. MacRuby
An implementation of the Ruby language that
runs on top of the Objective-C runtime and
garbage collection (libauto)
Based on Ruby 1.9
Uses LLVM and supports both ahead-of-time
and just-in-time compilation
Ships with OS X 10.7 Lion!!
5. MacRuby
Started by Laurent Sansonetti inside Apple
Initial 0.1 release in March 2008
Latest stable release (0.10) March 2011
Nightlies are very stable (0.12)
http://macruby.org/
https://github.com/MacRuby/MacRuby
6. Cocoa
Apple's native object-oriented API for the
Mac OS X operating system
Foundation Kit + Application Kit + Core Data
frameworks
Cocoa Touch: Includes gesture recognition
and different UI to use in iOS
7.
8. How to install
Install XCode (Mac App Store, Free)
Install Command Line Tools (Preferences >
Downloads)
Install MacRuby Nightly
If you are in OS X 10.6.8, install Bridge
Support Preview 3
https://github.com/MacRuby/MacRuby/wiki/Setting-up-MacRuby
10. Key concepts:
Cocoa classes need to be allocated and initialized
>> NSString.alloc.initWithString(“Hello Madridrb!”)
=> "Hello Madridrb!"
New method syntax: named parameters
>> NSDictionary.alloc.initWithObjects(["foo"], forKeys:
["bar"])
=> {"foo"=>"bar"}
26. RubyMotion
Built on top of MacRuby
Uses a new LLVM-based static compiler that
generates optimized machine code
Memory model similar to Objective-C ARC
Based on Rake
http://www.rubymotion.com/
27. RubyMotion
Commercial product. Educational licenses
available at discounted price.
Laurent Sansonetti left Apple to work on it.
Released May 3rd, 2012
Fast growing community!
33. CocoaPods is like RubyGems but for Ojective-C
projects.
$ sudo gem install cocoapods
$ pod setup
$ sudo gem install motion-cocoapods
Choose a pod:
https://github.com/CocoaPods/Specs
Edit Rakefile:
require 'motion-cocoapods'
Motion::Project::App.setup do |app|
# ...
app.pods do
dependency 'JSONKit'
end
end
35. TestFlight helps you distribute development builds
of your app to your betatesters.
$ sudo gem install motion-testflight
Download TestFlight’s SDK and put it in the “vendor” directory inside your
app. http://testflightapp.com/sdk/download
Edit Rakefile:
require 'motion-testflight'
Motion::Project::App.setup do |app|
# ...
app.testflight.sdk = 'vendor/TestFlight'
app.testflight.api_token = '<API token>'
app.testflight.team_token = '<team token>'
end
Run:
$ rake testflight notes='First release!'