SlideShare ist ein Scribd-Unternehmen logo
1 von 46
by Brian Sam-Bodden
RubyMotion
TDDing iOS Apps for fun and profit with RubyMotion
http://www.integrallis.com
Thursday, May 2, 13
Thursday, May 2, 13
who’s this guy?
Life-long polyglot programmer
Rubyist since 2005
Integrallis since 2002
Lives in Phoenix, Not in WITSEC
Thursday, May 2, 13
Let’s start with...
Confessions!
Thursday, May 2, 13
I’m an Apple Fan Boy!
Thursday, May 2, 13
I’m an Apple Fan Boy!
My Overpriced Precious!
Thursday, May 2, 13
but I work with Ruby... every day
Thursday, May 2, 13
I really, really wanted to make iPhone and iPad Apps
Thursday, May 2, 13
...but Apple insists you use XCode
I tried, I swear I did!
Thursday, May 2, 13
but it felt very...
Thursday, May 2, 13
an instinct defying experience...
...for a Rubyist
Thursday, May 2, 13
an instinct defying experience...
Let’s paint some pixels here...
...for a Rubyist
Thursday, May 2, 13
an instinct defying experience...
Let’s paint some pixels here...
Oh noes! ⌘-Z, ⌘-Z, ⌘-Z
...for a Rubyist
Thursday, May 2, 13
...and objective-C wasn’t for me
Thursday, May 2, 13
Enter
http://www.rubymotion.com/
Thursday, May 2, 13
A Commercial (*source available)
Ruby-based toolchain for iOS
Thursday, May 2, 13
Based on the MacRuby distribution,
modified to target iOS
http://macruby.org/
Thursday, May 2, 13
Generates compiled binaries that can be
distributed via Apple's App Store
Thursday, May 2, 13
Created by Laurent Sansonetti
Formerly of Apple (7 years)
Worked on iLife and OS X
MacRuby Creator
Thursday, May 2, 13
“We do not believe that Xcode makes a
good environment for Ruby development (or
development in general)”
Thursday, May 2, 13
Who is RubyMotion’s target audience?
Thursday, May 2, 13
(Ruby & Web) Developers new to iOS
Those comfortable with a *NIX Shell
and Agile Practices like BDD & TDD
Thursday, May 2, 13
Why don’t you just build a Mobile Web App?
Thursday, May 2, 13
“The most common reason for this is that [native]
apps are seen to be more convenient (55%), faster
(48%) and easier to browse (40%)”
http://econsultancy.com/us/blog/62326-85-of-consumers-favour-apps-over-mobile-websites
Thursday, May 2, 13
Thursday, May 2, 13
Thursday, May 2, 13
Bonjour, Le Monde!
Thursday, May 2, 13
Check 1, 2, 3
/> motion -v
1.35
/> motion create hello
Create hello
Create hello/.gitignore
Create hello/Rakefile
Create hello/app
Create hello/app/app_delegate.rb
Create hello/resources
Create hello/spec
Create hello/spec/main_spec.rb
Thursday, May 2, 13
Rake-Driven Development
/> rake -T
rake archive # Create an .ipa archive
rake archive:distribution # Create an .ipa archive for distribution (AppStore)
rake build # Build everything
rake build:device # Build the device version
rake build:simulator # Build the simulator version
rake clean # Clear build objects
rake config # Show project config
rake ctags # Generate ctags
rake default # Build the project, then run the simulator
rake device # Deploy on the device
rake simulator # Run the simulator
rake spec # Same as 'spec:simulator'
rake spec:device # Run the test/spec suite on the device
rake spec:simulator # Run the test/spec suite on the simulator
rake static # Create a .a static library
Thursday, May 2, 13
The REPL
Ruby Motion Enjoyment Reason #1
Thursday, May 2, 13
The REPLHighlights
Interact with your running iOS application
Discover & Learn iOS APIs through Ruby
Thursday, May 2, 13
Live Demo
Numero Uno
Where many a presenter has perished ...
Thursday, May 2, 13
The Bacon
Ruby Motion Enjoyment Reason #2
Thursday, May 2, 13
our vehicle for BDD & TDD
bundled with MacBacon
https://github.com/alloy/MacBacon
a small clone of RSpec
http://rspec.info/
Thursday, May 2, 13
A slice of MacBacon
describe 'A new array' do
before do
@ary = Array.new
end
it 'should be empty' do
@ary.should.be.empty
@ary.should.not.include 1
end
it 'should have zero size' do
@ary.size.should.equal 0
@ary.size.should.be.close 0.1, 0.5
end
Thursday, May 2, 13
A slice of MacBacon
describe 'A new array' do
before do
@ary = Array.new
end
it 'should be empty' do
@ary.should.be.empty
@ary.should.not.include 1
end
it 'should have zero size' do
@ary.size.should.equal 0
@ary.size.should.be.close 0.1, 0.5
end
it 'should raise on trying fetch any index' do
lambda { @ary.fetch 0 }.
should.raise(IndexError).
message.should.match(/out of array/)
# Alternatively:
should.raise(IndexError) { @ary.fetch 0 }
end
it 'should have an object identity' do
@ary.should.not.be.same_as Array.new
end
it 'should perform a long running operation' do
@ary.performSelector("addObject:", withObject:"soup", afterDelay:0.5)
wait 0.6 do
@ary.size.should.be 1
end
end
Thursday, May 2, 13
RM TDDHighlights
Testing with Bacon
Red-Green-Refactor for iOS
Libraries: MotionModel & Formotion
Thursday, May 2, 13
Live Demo
Numero Dos
Hey we made it this far!, what could go wrong now?
Thursday, May 2, 13
Okonawa!
A Simple ToDo App
https://github.com/integrallis/okonawa
Let’s build something!
行わ
Thursday, May 2, 13
Okonawa in Action
https://github.com/integrallis/okonawa
Thursday, May 2, 13
Healthy, rapidly growing set of libraries
BubbleWrap, MotionModel, FormMotion,
Teacup, IB and many, many more
There’s a Gem for that!
Thursday, May 2, 13
It’s happening people...
Rubyists are making iOS apps!
Thursday, May 2, 13
http://37signals.com/svn/posts/3430-launch-the-official-basecamp-iphone-app
Basecamp for the iPhone
Thursday, May 2, 13
https://itunes.apple.com/us/app/jukely/id590428284
Jukely
Thursday, May 2, 13
https://itunes.apple.com/us/app/jukely/id590428284
Lines
Thursday, May 2, 13
Thanks
All example code available at:
Watch out for an upcoming ebook at http://integrallis.com
https://github.com/integrallis/okonawa
Thursday, May 2, 13

Weitere ähnliche Inhalte

Ähnlich wie RailsConf 2013: RubyMotion

Game Changing Dependency Management
Game Changing Dependency ManagementGame Changing Dependency Management
Game Changing Dependency Management
Jeremy Kendall
 
Advanced App Building - Tips, Tricks & Lessons Learned
Advanced App Building - Tips, Tricks & Lessons LearnedAdvanced App Building - Tips, Tricks & Lessons Learned
Advanced App Building - Tips, Tricks & Lessons Learned
Jay Graves
 
Evolutionary Architecture at Work
Evolutionary  Architecture at WorkEvolutionary  Architecture at Work
Evolutionary Architecture at Work
Phil Calçado
 
From a monolithic Ruby on Rails app to the JVM
From a monolithic  Ruby on Rails app  to the JVMFrom a monolithic  Ruby on Rails app  to the JVM
From a monolithic Ruby on Rails app to the JVM
Phil Calçado
 

Ähnlich wie RailsConf 2013: RubyMotion (20)

The WordPress Hacker's Guide to the \Galaxy() [@MidwestPHP]
The WordPress Hacker's Guide to the \Galaxy() [@MidwestPHP]The WordPress Hacker's Guide to the \Galaxy() [@MidwestPHP]
The WordPress Hacker's Guide to the \Galaxy() [@MidwestPHP]
 
My mom told me that Git doesn’t scale by Vicent Martí
My mom told me that Git doesn’t scale by Vicent MartíMy mom told me that Git doesn’t scale by Vicent Martí
My mom told me that Git doesn’t scale by Vicent Martí
 
Oxente on Rails 2009
Oxente on Rails 2009Oxente on Rails 2009
Oxente on Rails 2009
 
The WordPress Hacker's Guide to the \Galaxy() [@Baltimore PHP]
The WordPress Hacker's Guide to the \Galaxy() [@Baltimore PHP]The WordPress Hacker's Guide to the \Galaxy() [@Baltimore PHP]
The WordPress Hacker's Guide to the \Galaxy() [@Baltimore PHP]
 
Wphackergalaxy
WphackergalaxyWphackergalaxy
Wphackergalaxy
 
Building fb mobile
Building fb mobileBuilding fb mobile
Building fb mobile
 
Game Changing Dependency Management
Game Changing Dependency ManagementGame Changing Dependency Management
Game Changing Dependency Management
 
Matt training-obj-v2
Matt training-obj-v2Matt training-obj-v2
Matt training-obj-v2
 
Integrating Ember.js into legacy applications
Integrating Ember.js into legacy applicationsIntegrating Ember.js into legacy applications
Integrating Ember.js into legacy applications
 
From HTML5 to Hardware - Simonyi Conference Budapest April 15
From HTML5 to Hardware - Simonyi Conference Budapest April 15From HTML5 to Hardware - Simonyi Conference Budapest April 15
From HTML5 to Hardware - Simonyi Conference Budapest April 15
 
Aleksandar Vacić - iOS App Development iz Srbije
Aleksandar Vacić - iOS App Development iz SrbijeAleksandar Vacić - iOS App Development iz Srbije
Aleksandar Vacić - iOS App Development iz Srbije
 
iPhone Web Development
iPhone Web DevelopmentiPhone Web Development
iPhone Web Development
 
Happy Coding with Ruby on Rails
Happy Coding with Ruby on RailsHappy Coding with Ruby on Rails
Happy Coding with Ruby on Rails
 
Advanced App Building - Tips, Tricks & Lessons Learned
Advanced App Building - Tips, Tricks & Lessons LearnedAdvanced App Building - Tips, Tricks & Lessons Learned
Advanced App Building - Tips, Tricks & Lessons Learned
 
JSDay 2013 - Practical Responsive Web Design
JSDay 2013 - Practical Responsive Web DesignJSDay 2013 - Practical Responsive Web Design
JSDay 2013 - Practical Responsive Web Design
 
Fast Slim Correct: The History and Evolution of JavaScript.
Fast Slim Correct: The History and Evolution of JavaScript.Fast Slim Correct: The History and Evolution of JavaScript.
Fast Slim Correct: The History and Evolution of JavaScript.
 
Introduction to Ruby & Ruby on Rails
Introduction to Ruby & Ruby on RailsIntroduction to Ruby & Ruby on Rails
Introduction to Ruby & Ruby on Rails
 
Games for the Masses (QCon London 2012)
Games for the Masses (QCon London 2012)Games for the Masses (QCon London 2012)
Games for the Masses (QCon London 2012)
 
Evolutionary Architecture at Work
Evolutionary  Architecture at WorkEvolutionary  Architecture at Work
Evolutionary Architecture at Work
 
From a monolithic Ruby on Rails app to the JVM
From a monolithic  Ruby on Rails app  to the JVMFrom a monolithic  Ruby on Rails app  to the JVM
From a monolithic Ruby on Rails app to the JVM
 

Mehr von Brian Sam-Bodden

Baruco 2014 - Rubymotion Workshop
Baruco 2014 - Rubymotion WorkshopBaruco 2014 - Rubymotion Workshop
Baruco 2014 - Rubymotion Workshop
Brian Sam-Bodden
 

Mehr von Brian Sam-Bodden (10)

Baruco 2014 - Rubymotion Workshop
Baruco 2014 - Rubymotion WorkshopBaruco 2014 - Rubymotion Workshop
Baruco 2014 - Rubymotion Workshop
 
Server-Side Push: Comet, Web Sockets come of age (OSCON 2013)
Server-Side Push: Comet, Web Sockets come of age (OSCON 2013)Server-Side Push: Comet, Web Sockets come of age (OSCON 2013)
Server-Side Push: Comet, Web Sockets come of age (OSCON 2013)
 
Ruby Metaprogramming - OSCON 2008
Ruby Metaprogramming - OSCON 2008Ruby Metaprogramming - OSCON 2008
Ruby Metaprogramming - OSCON 2008
 
Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013
 
Road to mobile w/ Sinatra, jQuery Mobile, Spine.js and Mustache
Road to mobile w/ Sinatra, jQuery Mobile, Spine.js and MustacheRoad to mobile w/ Sinatra, jQuery Mobile, Spine.js and Mustache
Road to mobile w/ Sinatra, jQuery Mobile, Spine.js and Mustache
 
Trellis Framework At RubyWebConf
Trellis Framework At RubyWebConfTrellis Framework At RubyWebConf
Trellis Framework At RubyWebConf
 
Integrallis groovy-cloud
Integrallis groovy-cloudIntegrallis groovy-cloud
Integrallis groovy-cloud
 
Ferret
FerretFerret
Ferret
 
Bitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRuby
 
Ruby Metaprogramming 08
Ruby Metaprogramming 08Ruby Metaprogramming 08
Ruby Metaprogramming 08
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

RailsConf 2013: RubyMotion