SlideShare a Scribd company logo
1 of 40
Download to read offline
MacRuby & RubyMotion
  Programming OS X and iOS apps with Ruby
Hi
I’m @MarkVillacampa
Blame
Him
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!!
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
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
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
Key concepts:
     MacRuby objects are Objective-C objects

>> "Hello Madridrb!".class.ancestors
=> [String, NSMutableString, NSString, Comparable, NSObject,
Kernel]



     Can use Ruby & Cocoa methods

>>   "Hello   Madridrb!".upcase <- Ruby
=>   "HELLO   MADRIDRB!"
>>   "Hello   Madridrb!".uppercaseString <- Cocoa
=>   "HELLO   MADRIDRB!"
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"}
1. The syntax
Objective-C:


NSMutableDictionary *dict = [NSMutableDictionary dictionary];
[dict setObject:[NSArray arrayWithObjects:@"bar", @"baz"]
forKey:@"foo"];
[dict setObject:[NSNumber numberWithInt:2] forKey:@"oof"];




  Ruby:
a = {"foo" => ["bar", "baz"], "oof" => 2}
Objective-C:


NSMutableDictionary *dict = [NSMutableDictionary dictionary];
[dict setObject:[NSArray arrayWithObjects:@"bar", @"baz"]
forKey:@"foo"];
[dict setObject:[NSNumber numberWithInt:2] forKey:@"oof"];




  Ruby:
a = {"foo" => ["bar", "baz"], "oof" => 2}
2. XCode
Interface Builder
3. REPL Console
   ( Read Eval Print Loop )
4. Gems
Any gem that works with Ruby 1.9
   should work with MacRuby
5. Behaviour-Driven Development
MacBacon
A small RSpec clone, with NSRunLoop
powers.

https://github.com/alloy/MacBacon
6. Mac App Store
http://briquetteapp.com/
http://shop.oreilly.com/product/
      0636920000723.do
                                   http://manning.com/lim/
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/
RubyMotion
Commercial product. Educational licenses
available at discounted price.
Laurent Sansonetti left Apple to work on it.
Released May 3rd, 2012
Fast growing community!
$ motion create HelloMadridrb


HelloMadridrb
  app                        .rb files

    app_delegate.rb          Main delegate

  resources                  Images, Sounds, .xib files

  spec                       Tests
    main_spec.rb
  .gitignore
  Rakefile
                              Configuration file
1. Interactive Console
Holding      and clicking in a
UI element assigns that
element to the self variable in
the console
2. CocoaPods
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
3. TestFlight
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!'
4. App Store
Mustachio




http://itunes.apple.com/us/app/
    mustachio/id525324802


  https://github.com/HipByte/
            Mustachio
Demo time
Questions?
No, it doesn’t run Rails.

More Related Content

What's hot

Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Soshi Nemoto
 
Using Protocol to Refactor
Using Protocol to Refactor Using Protocol to Refactor
Using Protocol to Refactor Green Chiu
 
Introduction to Ecmascript - ES6
Introduction to Ecmascript - ES6Introduction to Ecmascript - ES6
Introduction to Ecmascript - ES6Nilesh Jayanandana
 
Ansible fest Presentation slides
Ansible fest Presentation slidesAnsible fest Presentation slides
Ansible fest Presentation slidesAaron Carey
 
How to make the Fastest C# Serializer, In the case of ZeroFormatter
How to make the Fastest C# Serializer, In the case of ZeroFormatterHow to make the Fastest C# Serializer, In the case of ZeroFormatter
How to make the Fastest C# Serializer, In the case of ZeroFormatterYoshifumi Kawai
 
Mac ruby deployment
Mac ruby deploymentMac ruby deployment
Mac ruby deploymentThilo Utke
 
Webエンジニアから見たiOS5
Webエンジニアから見たiOS5Webエンジニアから見たiOS5
Webエンジニアから見たiOS5Satoshi Asano
 
Instruction: dev environment
Instruction: dev environmentInstruction: dev environment
Instruction: dev environmentSoshi Nemoto
 
What's New in ES6 for Web Devs
What's New in ES6 for Web DevsWhat's New in ES6 for Web Devs
What's New in ES6 for Web DevsRami Sayar
 
Coroutines for Kotlin Multiplatform in Practise
Coroutines for Kotlin Multiplatform in PractiseCoroutines for Kotlin Multiplatform in Practise
Coroutines for Kotlin Multiplatform in PractiseChristian Melchior
 
DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)Soshi Nemoto
 
Developing JavaScript Widgets
Developing JavaScript WidgetsDeveloping JavaScript Widgets
Developing JavaScript WidgetsKonstantin Käfer
 
Fabric - a server management tool from Instagram
Fabric - a server management tool from InstagramFabric - a server management tool from Instagram
Fabric - a server management tool from InstagramJay Ren
 
Introduction to asynchronous DB access using Node.js and MongoDB
Introduction to asynchronous DB access using Node.js and MongoDBIntroduction to asynchronous DB access using Node.js and MongoDB
Introduction to asynchronous DB access using Node.js and MongoDBAdrien Joly
 
Matthew Eernisse, NodeJs, .toster {webdev}
Matthew Eernisse, NodeJs, .toster {webdev}Matthew Eernisse, NodeJs, .toster {webdev}
Matthew Eernisse, NodeJs, .toster {webdev}.toster
 
ECMAScript 6: A Better JavaScript for the Ambient Computing Era
ECMAScript 6: A Better JavaScript for the Ambient Computing EraECMAScript 6: A Better JavaScript for the Ambient Computing Era
ECMAScript 6: A Better JavaScript for the Ambient Computing EraAllen Wirfs-Brock
 

What's hot (20)

Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)
 
Using Protocol to Refactor
Using Protocol to Refactor Using Protocol to Refactor
Using Protocol to Refactor
 
Introduction to Ecmascript - ES6
Introduction to Ecmascript - ES6Introduction to Ecmascript - ES6
Introduction to Ecmascript - ES6
 
Ansible fest Presentation slides
Ansible fest Presentation slidesAnsible fest Presentation slides
Ansible fest Presentation slides
 
How to make the Fastest C# Serializer, In the case of ZeroFormatter
How to make the Fastest C# Serializer, In the case of ZeroFormatterHow to make the Fastest C# Serializer, In the case of ZeroFormatter
How to make the Fastest C# Serializer, In the case of ZeroFormatter
 
Mac ruby deployment
Mac ruby deploymentMac ruby deployment
Mac ruby deployment
 
Webエンジニアから見たiOS5
Webエンジニアから見たiOS5Webエンジニアから見たiOS5
Webエンジニアから見たiOS5
 
Instruction: dev environment
Instruction: dev environmentInstruction: dev environment
Instruction: dev environment
 
What's New in ES6 for Web Devs
What's New in ES6 for Web DevsWhat's New in ES6 for Web Devs
What's New in ES6 for Web Devs
 
Coroutines for Kotlin Multiplatform in Practise
Coroutines for Kotlin Multiplatform in PractiseCoroutines for Kotlin Multiplatform in Practise
Coroutines for Kotlin Multiplatform in Practise
 
Doc
DocDoc
Doc
 
Fabric: A Capistrano Alternative
Fabric:  A Capistrano AlternativeFabric:  A Capistrano Alternative
Fabric: A Capistrano Alternative
 
DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)
 
Developing JavaScript Widgets
Developing JavaScript WidgetsDeveloping JavaScript Widgets
Developing JavaScript Widgets
 
Fabric - a server management tool from Instagram
Fabric - a server management tool from InstagramFabric - a server management tool from Instagram
Fabric - a server management tool from Instagram
 
OneRing @ OSCamp 2010
OneRing @ OSCamp 2010OneRing @ OSCamp 2010
OneRing @ OSCamp 2010
 
Introduction to Underscore.js
Introduction to Underscore.jsIntroduction to Underscore.js
Introduction to Underscore.js
 
Introduction to asynchronous DB access using Node.js and MongoDB
Introduction to asynchronous DB access using Node.js and MongoDBIntroduction to asynchronous DB access using Node.js and MongoDB
Introduction to asynchronous DB access using Node.js and MongoDB
 
Matthew Eernisse, NodeJs, .toster {webdev}
Matthew Eernisse, NodeJs, .toster {webdev}Matthew Eernisse, NodeJs, .toster {webdev}
Matthew Eernisse, NodeJs, .toster {webdev}
 
ECMAScript 6: A Better JavaScript for the Ambient Computing Era
ECMAScript 6: A Better JavaScript for the Ambient Computing EraECMAScript 6: A Better JavaScript for the Ambient Computing Era
ECMAScript 6: A Better JavaScript for the Ambient Computing Era
 

Viewers also liked

Impresión 3D: Desktop Manufacturing
Impresión 3D: Desktop ManufacturingImpresión 3D: Desktop Manufacturing
Impresión 3D: Desktop ManufacturingMark Villacampa
 
Improving your workflow with RubyMotion
Improving your workflow with RubyMotionImproving your workflow with RubyMotion
Improving your workflow with RubyMotionMark Villacampa
 
Increasing importance of social media in education by
Increasing importance of social media in education byIncreasing importance of social media in education by
Increasing importance of social media in education byBonita Kamthae
 
Increasing importance of social media in education by
Increasing importance of social media in education byIncreasing importance of social media in education by
Increasing importance of social media in education byBonita Kamthae
 
Bmi live screen designs 032712
Bmi live screen designs 032712Bmi live screen designs 032712
Bmi live screen designs 032712Chad Crouch
 
2012 1 arduino_rs232
2012 1 arduino_rs2322012 1 arduino_rs232
2012 1 arduino_rs232Don Doerres
 
Single Boards Overview
Single Boards OverviewSingle Boards Overview
Single Boards OverviewDon Doerres
 
визитная карточка ВНИИА (ТЕМП-2012)
визитная карточка ВНИИА (ТЕМП-2012) визитная карточка ВНИИА (ТЕМП-2012)
визитная карточка ВНИИА (ТЕМП-2012) Alex Bolshakov
 
Happy animals with a z
Happy animals with a zHappy animals with a z
Happy animals with a zBonita Kamthae
 
2013 1 arduino_datalogger
2013 1 arduino_datalogger2013 1 arduino_datalogger
2013 1 arduino_dataloggerDon Doerres
 
Connecting RubyMotion with Hardware - Rubymotion #Inspect 2014
Connecting RubyMotion with Hardware - Rubymotion #Inspect 2014Connecting RubyMotion with Hardware - Rubymotion #Inspect 2014
Connecting RubyMotion with Hardware - Rubymotion #Inspect 2014Mark Villacampa
 
Raspberry pi lnl
Raspberry pi lnlRaspberry pi lnl
Raspberry pi lnlDon Doerres
 
presentation on ferrite core memory
presentation on ferrite core memorypresentation on ferrite core memory
presentation on ferrite core memorysukumar_csm11
 
Hadoop Monitoring best Practices
Hadoop Monitoring best PracticesHadoop Monitoring best Practices
Hadoop Monitoring best PracticesEdward Capriolo
 
Rasberry pi class
Rasberry pi classRasberry pi class
Rasberry pi classDon Doerres
 
How to use stock photos and still look cool
How to use stock photos and still look coolHow to use stock photos and still look cool
How to use stock photos and still look coolChris 'Kubby' Kubbernus
 

Viewers also liked (20)

Impresión 3D: Desktop Manufacturing
Impresión 3D: Desktop ManufacturingImpresión 3D: Desktop Manufacturing
Impresión 3D: Desktop Manufacturing
 
Improving your workflow with RubyMotion
Improving your workflow with RubyMotionImproving your workflow with RubyMotion
Improving your workflow with RubyMotion
 
California FHA Loan
California FHA LoanCalifornia FHA Loan
California FHA Loan
 
Increasing importance of social media in education by
Increasing importance of social media in education byIncreasing importance of social media in education by
Increasing importance of social media in education by
 
Increasing importance of social media in education by
Increasing importance of social media in education byIncreasing importance of social media in education by
Increasing importance of social media in education by
 
Bmi live screen designs 032712
Bmi live screen designs 032712Bmi live screen designs 032712
Bmi live screen designs 032712
 
Moss 2010 oct2012
Moss 2010 oct2012Moss 2010 oct2012
Moss 2010 oct2012
 
2012 1 arduino_rs232
2012 1 arduino_rs2322012 1 arduino_rs232
2012 1 arduino_rs232
 
Single Boards Overview
Single Boards OverviewSingle Boards Overview
Single Boards Overview
 
визитная карточка ВНИИА (ТЕМП-2012)
визитная карточка ВНИИА (ТЕМП-2012) визитная карточка ВНИИА (ТЕМП-2012)
визитная карточка ВНИИА (ТЕМП-2012)
 
Happy animals with a z
Happy animals with a zHappy animals with a z
Happy animals with a z
 
2013 1 arduino_datalogger
2013 1 arduino_datalogger2013 1 arduino_datalogger
2013 1 arduino_datalogger
 
Connecting RubyMotion with Hardware - Rubymotion #Inspect 2014
Connecting RubyMotion with Hardware - Rubymotion #Inspect 2014Connecting RubyMotion with Hardware - Rubymotion #Inspect 2014
Connecting RubyMotion with Hardware - Rubymotion #Inspect 2014
 
Industrial Land Raigad
Industrial Land RaigadIndustrial Land Raigad
Industrial Land Raigad
 
Quinoa - Legacy from Inkas
Quinoa - Legacy from InkasQuinoa - Legacy from Inkas
Quinoa - Legacy from Inkas
 
Raspberry pi lnl
Raspberry pi lnlRaspberry pi lnl
Raspberry pi lnl
 
presentation on ferrite core memory
presentation on ferrite core memorypresentation on ferrite core memory
presentation on ferrite core memory
 
Hadoop Monitoring best Practices
Hadoop Monitoring best PracticesHadoop Monitoring best Practices
Hadoop Monitoring best Practices
 
Rasberry pi class
Rasberry pi classRasberry pi class
Rasberry pi class
 
How to use stock photos and still look cool
How to use stock photos and still look coolHow to use stock photos and still look cool
How to use stock photos and still look cool
 

Similar to MacRuby & RubyMotion - Madridrb May 2012

RubyMotion Introduction
RubyMotion IntroductionRubyMotion Introduction
RubyMotion IntroductionLori Olson
 
Macruby& Hotcocoa presentation by Rich Kilmer
Macruby& Hotcocoa presentation by Rich KilmerMacruby& Hotcocoa presentation by Rich Kilmer
Macruby& Hotcocoa presentation by Rich KilmerMatt Aimonetti
 
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureCloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureHabeeb Rahman
 
Docker module 1
Docker module 1Docker module 1
Docker module 1Liang Bo
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopmentgillygize
 
Ruby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developerRuby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developergicappa
 
Ruby Meets Cocoa
Ruby Meets CocoaRuby Meets Cocoa
Ruby Meets CocoaRobbert
 
Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102Heng-Yi Wu
 
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...MongoDB
 
Cocoapods and Most common used library in Swift
Cocoapods and Most common used library in SwiftCocoapods and Most common used library in Swift
Cocoapods and Most common used library in SwiftWan Muzaffar Wan Hashim
 
RubyMotion: Hack Your iOS App Like Never Before
RubyMotion: Hack Your iOS App Like Never BeforeRubyMotion: Hack Your iOS App Like Never Before
RubyMotion: Hack Your iOS App Like Never BeforeJoseph Ku
 
Mobile Development integration tests
Mobile Development integration testsMobile Development integration tests
Mobile Development integration testsKenneth Poon
 
Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Eugene Yokota
 
Play Support in Cloud Foundry
Play Support in Cloud FoundryPlay Support in Cloud Foundry
Play Support in Cloud Foundryrajdeep
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Enginecatherinewall
 

Similar to MacRuby & RubyMotion - Madridrb May 2012 (20)

RubyMotion Introduction
RubyMotion IntroductionRubyMotion Introduction
RubyMotion Introduction
 
Macruby& Hotcocoa presentation by Rich Kilmer
Macruby& Hotcocoa presentation by Rich KilmerMacruby& Hotcocoa presentation by Rich Kilmer
Macruby& Hotcocoa presentation by Rich Kilmer
 
Play framework
Play frameworkPlay framework
Play framework
 
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureCloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopment
 
MacRuby, an introduction
MacRuby, an introductionMacRuby, an introduction
MacRuby, an introduction
 
Ruby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developerRuby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developer
 
Ruby Meets Cocoa
Ruby Meets CocoaRuby Meets Cocoa
Ruby Meets Cocoa
 
Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102
 
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
 
How to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDKHow to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDK
 
Cocoapods and Most common used library in Swift
Cocoapods and Most common used library in SwiftCocoapods and Most common used library in Swift
Cocoapods and Most common used library in Swift
 
Bye flex. Hey js.
Bye flex. Hey js.Bye flex. Hey js.
Bye flex. Hey js.
 
RubyMotion: Hack Your iOS App Like Never Before
RubyMotion: Hack Your iOS App Like Never BeforeRubyMotion: Hack Your iOS App Like Never Before
RubyMotion: Hack Your iOS App Like Never Before
 
Mobile Development integration tests
Mobile Development integration testsMobile Development integration tests
Mobile Development integration tests
 
Intro to Rack
Intro to RackIntro to Rack
Intro to Rack
 
Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)
 
Play Support in Cloud Foundry
Play Support in Cloud FoundryPlay Support in Cloud Foundry
Play Support in Cloud Foundry
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Engine
 

Recently uploaded

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 

Recently uploaded (20)

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 

MacRuby & RubyMotion - Madridrb May 2012

  • 1. MacRuby & RubyMotion Programming OS X and iOS apps with Ruby
  • 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
  • 9. Key concepts: MacRuby objects are Objective-C objects >> "Hello Madridrb!".class.ancestors => [String, NSMutableString, NSString, Comparable, NSObject, Kernel] Can use Ruby & Cocoa methods >> "Hello Madridrb!".upcase <- Ruby => "HELLO MADRIDRB!" >> "Hello Madridrb!".uppercaseString <- Cocoa => "HELLO MADRIDRB!"
  • 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"}
  • 12. Objective-C: NSMutableDictionary *dict = [NSMutableDictionary dictionary]; [dict setObject:[NSArray arrayWithObjects:@"bar", @"baz"] forKey:@"foo"]; [dict setObject:[NSNumber numberWithInt:2] forKey:@"oof"]; Ruby: a = {"foo" => ["bar", "baz"], "oof" => 2}
  • 13. Objective-C: NSMutableDictionary *dict = [NSMutableDictionary dictionary]; [dict setObject:[NSArray arrayWithObjects:@"bar", @"baz"] forKey:@"foo"]; [dict setObject:[NSNumber numberWithInt:2] forKey:@"oof"]; Ruby: a = {"foo" => ["bar", "baz"], "oof" => 2}
  • 15.
  • 17. 3. REPL Console ( Read Eval Print Loop )
  • 18.
  • 20. Any gem that works with Ruby 1.9 should work with MacRuby
  • 22. MacBacon A small RSpec clone, with NSRunLoop powers. https://github.com/alloy/MacBacon
  • 23. 6. Mac App Store
  • 25. http://shop.oreilly.com/product/ 0636920000723.do http://manning.com/lim/
  • 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!
  • 28.
  • 29. $ motion create HelloMadridrb HelloMadridrb app .rb files app_delegate.rb Main delegate resources Images, Sounds, .xib files spec Tests main_spec.rb .gitignore Rakefile Configuration file
  • 31. Holding and clicking in a UI element assigns that element to the self variable in the console
  • 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!'
  • 37. Mustachio http://itunes.apple.com/us/app/ mustachio/id525324802 https://github.com/HipByte/ Mustachio
  • 40. No, it doesn’t run Rails.