SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Downloaden Sie, um offline zu lesen
Entwicklung für OS X
                           und iOS mit Ruby
                                   Macoun 2012




                              Boris Bügling (@NeoNacho)




Freitag, 26. Oktober 12
Wozu?
                  • Rapid Prototyping

                  • Sharing von Backend Code

                  • Glücklicher ohne Xcode

                  • Lerneffekt

                  • Spaß


Freitag, 26. Oktober 12
Ruby
                  • interpretiert, dynamisch typisiert

                  • alles ist ein Objekt

                  • blocks

                  • Meta-Programmierung

                  • gems


Freitag, 26. Oktober 12
Ruby

                  • 5.times { print "Hello world!" }

                  • exit unless "restaurant".include?
                    "aura"

                  • ['toast', 'cheese', 'wine'].each
                    { |food| print food.capitalize }




Freitag, 26. Oktober 12
Wie?


                  • MacRuby

                  • RubyMotion




Freitag, 26. Oktober 12
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
Technik
                  • Keine Bridge

                  • Neuimplementierung mit CoreFoundation

                  • Nutzt die Objective-C Runtime und LLVM

                  • Hohe Performance

                  • Kompatibilität


Freitag, 26. Oktober 12
Freitag, 26. Oktober 12
Entwicklung

                  • Kein Xcode sondern Texteditor und Terminal

                  • Rake

                  • Interaktive Konsole (REPL)

                  • App Store kompatibel




Freitag, 26. Oktober 12
Features

                  • Unterstützung für spezielle Gems

                  • Testing

                  • Tooling: IB, Storyboards, Crash Reports,
                    Instruments




Freitag, 26. Oktober 12
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
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
Demo: Shell




Freitag, 26. Oktober 12
Beispiel
                          iOS "Hello World" -> Twitter Client!




Freitag, 26. Oktober 12
• Rakefile - ersetzt .xcodeproj

                          • app - Code

                          • resources - Resourcen

                          • spec - Test Spec (BDD ist in
                            RubyMotion integriert)



Freitag, 26. Oktober 12
Zugriff auf Twitter


                  • Ganz einfach dank Gems!

                  • :( - leider nicht, Gems müssen an RubyMotion
                    angepasst werden




Freitag, 26. Oktober 12
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
Twitter ViewController

                  • IB, Storyboards

                  • Cocoa, ggf. mit Auto-Layout

                  • sugarcube




Freitag, 26. Oktober 12
Demo




Freitag, 26. Oktober 12
Testing
                  • Bringt eigene Variante des BDD-Frameworks
                    Bacon mit




Freitag, 26. Oktober 12
Demo: Testen mit
                            RubyMotion




Freitag, 26. Oktober 12
Beispiel 2
                           OS X Twitter Client




Freitag, 26. Oktober 12
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
Demo




Freitag, 26. Oktober 12
Fragen?




Freitag, 26. Oktober 12
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

Weitere ähnliche Inhalte

Andere mochten auch

Presentazione yana x mas
Presentazione yana x masPresentazione yana x mas
Presentazione yana x mas
Yana Nefedova
 
Unit 10.plantas y hongos
Unit 10.plantas y hongosUnit 10.plantas y hongos
Unit 10.plantas y hongos
luzhernandohbs
 
Graffiti URBAN. SPAIN
Graffiti URBAN. SPAINGraffiti URBAN. SPAIN
Graffiti URBAN. SPAIN
mebalsategui
 
Small think can do better
Small think can do betterSmall think can do better
Small think can do better
Lalit Shaktawat
 

Andere mochten auch (17)

Arte Barroca EPAPU
Arte Barroca EPAPUArte Barroca EPAPU
Arte Barroca EPAPU
 
Volcanes de méxico
Volcanes de méxicoVolcanes de méxico
Volcanes de méxico
 
Ejemplo de vida
Ejemplo de vidaEjemplo de vida
Ejemplo de vida
 
recreacion
recreacion recreacion
recreacion
 
Presentazione yana x mas
Presentazione yana x masPresentazione yana x mas
Presentazione yana x mas
 
Expressions
ExpressionsExpressions
Expressions
 
Unit 10.plantas y hongos
Unit 10.plantas y hongosUnit 10.plantas y hongos
Unit 10.plantas y hongos
 
Graffiti URBAN. SPAIN
Graffiti URBAN. SPAINGraffiti URBAN. SPAIN
Graffiti URBAN. SPAIN
 
9 rosas _1_
9 rosas _1_9 rosas _1_
9 rosas _1_
 
Ivona bačinski
Ivona bačinskiIvona bačinski
Ivona bačinski
 
Spreek jij een andere taal
Spreek jij een andere taal Spreek jij een andere taal
Spreek jij een andere taal
 
The Waiting Game
The Waiting GameThe Waiting Game
The Waiting Game
 
почему канбан не может вам помочь
почему канбан не может вам помочьпочему канбан не может вам помочь
почему канбан не может вам помочь
 
Small think can do better
Small think can do betterSmall think can do better
Small think can do better
 
Mchs full
Mchs fullMchs full
Mchs full
 
Won Park, maestro del Origami
Won Park, maestro del OrigamiWon Park, maestro del Origami
Won Park, maestro del Origami
 
Jornal terp 1
Jornal terp 1Jornal terp 1
Jornal terp 1
 

Ähnlich wie Entwicklung für OS X und iOS mit Ruby

Simon Meggle - Open Source End2End Monitoring with Sakuli and Nagios
Simon Meggle - Open Source End2End Monitoring with Sakuli and Nagios Simon Meggle - Open Source End2End Monitoring with Sakuli and Nagios
Simon Meggle - Open Source End2End Monitoring with Sakuli and Nagios
simmerl121
 
Creative codingday 2_10012014_vor
Creative codingday 2_10012014_vorCreative codingday 2_10012014_vor
Creative codingday 2_10012014_vor
JeongHo Park
 

Ähnlich wie Entwicklung für OS X und iOS mit Ruby (8)

Performanter, hochskalierbarer Web 2.0-Dienst in Ruby
Performanter, hochskalierbarer Web 2.0-Dienst in RubyPerformanter, hochskalierbarer Web 2.0-Dienst in Ruby
Performanter, hochskalierbarer Web 2.0-Dienst in Ruby
 
Native app entwicklung vs. alternativen am beispiel von appcelerator
Native app entwicklung vs. alternativen am beispiel von appceleratorNative app entwicklung vs. alternativen am beispiel von appcelerator
Native app entwicklung vs. alternativen am beispiel von appcelerator
 
Ruby on Rails - Eine kurze Einführung
Ruby on Rails - Eine kurze EinführungRuby on Rails - Eine kurze Einführung
Ruby on Rails - Eine kurze Einführung
 
JM 08/09 - Beginning Scala Review
JM 08/09 - Beginning Scala ReviewJM 08/09 - Beginning Scala Review
JM 08/09 - Beginning Scala Review
 
Ruby und Rails für .NET Entwickler
Ruby und Rails für .NET EntwicklerRuby und Rails für .NET Entwickler
Ruby und Rails für .NET Entwickler
 
Simon Meggle - Open Source End2End Monitoring with Sakuli and Nagios
Simon Meggle - Open Source End2End Monitoring with Sakuli and Nagios Simon Meggle - Open Source End2End Monitoring with Sakuli and Nagios
Simon Meggle - Open Source End2End Monitoring with Sakuli and Nagios
 
Creative codingday 2_10012014_vor
Creative codingday 2_10012014_vorCreative codingday 2_10012014_vor
Creative codingday 2_10012014_vor
 
Blind Date mit Rails - Rails-Einführung
Blind Date mit Rails - Rails-EinführungBlind Date mit Rails - Rails-Einführung
Blind Date mit Rails - Rails-Einführung
 

Entwicklung für OS X und iOS mit Ruby

  • 1. Entwicklung für OS X und iOS mit Ruby Macoun 2012 Boris Bügling (@NeoNacho) 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. Wie? • MacRuby • RubyMotion Freitag, 26. Oktober 12
  • 6. 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
  • 7. Technik • Keine Bridge • Neuimplementierung mit CoreFoundation • Nutzt die Objective-C Runtime und LLVM • Hohe Performance • Kompatibilität Freitag, 26. Oktober 12
  • 9. Entwicklung • Kein Xcode sondern Texteditor und Terminal • Rake • Interaktive Konsole (REPL) • App Store kompatibel Freitag, 26. Oktober 12
  • 10. Features • Unterstützung für spezielle Gems • Testing • Tooling: IB, Storyboards, Crash Reports, Instruments Freitag, 26. Oktober 12
  • 11. 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
  • 12. 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
  • 14. Beispiel iOS "Hello World" -> Twitter Client! Freitag, 26. Oktober 12
  • 15. • Rakefile - ersetzt .xcodeproj • app - Code • resources - Resourcen • spec - Test Spec (BDD ist in RubyMotion integriert) Freitag, 26. Oktober 12
  • 16. Zugriff auf Twitter • Ganz einfach dank Gems! • :( - leider nicht, Gems müssen an RubyMotion angepasst werden Freitag, 26. Oktober 12
  • 17. 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
  • 18. Twitter ViewController • IB, Storyboards • Cocoa, ggf. mit Auto-Layout • sugarcube Freitag, 26. Oktober 12
  • 20. Testing • Bringt eigene Variante des BDD-Frameworks Bacon mit Freitag, 26. Oktober 12
  • 21. Demo: Testen mit RubyMotion Freitag, 26. Oktober 12
  • 22. Beispiel 2 OS X Twitter Client Freitag, 26. Oktober 12
  • 23. 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
  • 26. 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