Entwicklung für OS X und iOS mit Ruby

Entwicklung für OS X und iOS mit Ruby

Ist Xcode schon wieder abgestürzt? Nervt das Neu-Kompilieren für jede kleine Änderung beim Testen? Oder will man einfach mal eine andere Programmiersprache für Mac/iOS Applikationen nutzen? Zur Abhilfe bietet dieser Vortrag eine leichte Einführung in die Entwicklung mit MacRuby und RubyMotion.

Boris Bügling

October 28, 2012

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

26 slides
  1. Entwicklung für OS X und iOS mit Ruby Boris Bügling

    (@NeoNacho) Macoun 2012 Freitag, 26. Oktober 12
  2. Wozu? • Rapid Prototyping • Sharing von Backend Code •

    Glücklicher ohne Xcode • Lerneffekt • Spaß Freitag, 26. Oktober 12
  3. Ruby • interpretiert, dynamisch typisiert • alles ist ein Objekt

    • blocks • Meta-Programmierung • gems Freitag, 26. Oktober 12
  4. Ruby • 5.times { print "Hello world!" } • exit

    unless "restaurant".include? "aura" • ['toast', 'cheese', 'wine'].each { |food| print food.capitalize } Freitag, 26. Oktober 12
  5. Historie • 2001: RubyCocoa • 2006: WWDC Session zu RubyCocoa

    • MacRuby: seit 2007 in Entwicklung • Entwickler Laurent Sansonetti (lrz) arbeitet Vollzeit bei Apple daran • 2012: RubyMotion ohne Apple Unterstützung Freitag, 26. Oktober 12
  6. Technik • Keine Bridge • Neuimplementierung mit CoreFoundation • Nutzt

    die Objective-C Runtime und LLVM • Hohe Performance • Kompatibilität Freitag, 26. Oktober 12
  7. Entwicklung • Kein Xcode sondern Texteditor und Terminal • Rake

    • Interaktive Konsole (REPL) • App Store kompatibel Freitag, 26. Oktober 12
  8. Features • Unterstützung für spezielle Gems • Testing • Tooling:

    IB, Storyboards, Crash Reports, Instruments Freitag, 26. Oktober 12
  9. Rake • Ruby de-facto Build System • Rakefile ist in

    Ruby geschrieben • Deployment über Kommandozeile: rake simulator device_family=ipad • Ausführung von Tests: rake spec Freitag, 26. Oktober 12
  10. Interaktive Shell • Zur Laufzeit beliebigen Code ausführen • ->

    Besseres Debugging • -> Kleinere Edits on-the-fly • Bisher nur im Simulator möglich Freitag, 26. Oktober 12
  11. • Rakefile - ersetzt .xcodeproj • app - Code •

    resources - Resourcen • spec - Test Spec (BDD ist in RubyMotion integriert) Freitag, 26. Oktober 12
  12. Zugriff auf Twitter • Ganz einfach dank Gems! • :(

    - leider nicht, Gems müssen an RubyMotion angepasst werden Freitag, 26. Oktober 12
  13. Cocoa APIs • Werden 1:1 übernommen • Laut lrz sollen

    DSLs aus der Community kommen • Ruby Standardbibliotheken fehlen, daher gibt es z.B. bubble-wrap oder sugarcube • CocoaPods sind einfach integrierbar Freitag, 26. Oktober 12
  14. Unterschiede • Workflow hängt an Xcode • Besserer Support für

    Gems • Natürlich AppKit statt UIKit • Keine direkte Integration von Tests • Keine interaktive Shell Freitag, 26. Oktober 12
  15. Literatur • Folien und Beispielcode: http://vu0.org/ruby • MacRuby: http://macruby.org •

    RubyMotion: http://rubymotion.com • Screencasts: http://pragmaticstudio.com/ screencasts/rubymotion und http:// motioncasts.tv Freitag, 26. Oktober 12

More Decks by Boris Bügling

Other Decks in Programming