RubyMotion lets developers write native iOS apps using the Ruby programming language. Ray Hightower delivered this presentation at MagicRuby and Aloha Ruby in October 2012. Video is available at RayHightower.com.
1 describe "FizzBuzz Calculator Function" do 2 before do 3 @this_number = 38 4 end 5 ... 17 18 (1..10).each do |this_number| 19 if this_number % 15 == 0 20 it 'should return buzz for multiples of 15' do 21 HomeController.fizzbuzz_calc(this_number).should == 'fizzbuzz' 22 end 23 elsif this_number % 3 == 0 24 it 'should return fizz for multiples of 3' do 25 HomeController.fizzbuzz_calc(this_number).should == 'fizz' 26 end 27 elsif this_number % 5 == 0 28 it 'should return buzz for multiples of 5' do 29 HomeController.fizzbuzz_calc(this_number).should == 'buzz' 30 end 31 else 32 it 'should return the original number' do 33 HomeController.fizzbuzz_calc(this_number).should == this_number 34 end 35 end 36 end 37 end home_controller_spec.rb
describe "FizzBuzz Calculator Function" do before do @this_number = 38 end ... (1..10).each do |this_number| if this_number % 15 == 0 it 'should return buzz for mults of 15' do HomeController.fizzbuzz_calc(this_number) .should == 'fizzbuzz' end home_controller_spec.rb
Resources http://rubymotion-tutorial.com Multi-page tutorial by Clay Allsopp. Also see http://clayallsopp.com http://pragmaticstudio.com/screencasts/rubymotion Pragmatic Studio’s intro to RubyMotion (free) plus a paid intro to Ruby. http://chicagoruby.org/videos/archives/2012/09/04/rubymotion-for-rubyists/ Bill Svec builds a simple RubyMotion weather app in about 90 minutes. http://motioncasts.tv Tutorial videos by Michael Erasmus and Hendrik Swanepoel. http://nshipster.com Mattt Thompson's weekly journal of Objective-C and Cocoa. http://nsscreencast.com/ Ben Scheirman’s Objective-C screencasts, plus a short one on RubyMotion. http://4steps5minutes.com Minimum viable products (MVPs) described in a 5-minute video.