RubyMotionMaking iOS apps in Ruby
@pd_i
Prerequisites
Prerequisites  Ruby MVC      Objective-C*                     *optional
What isRubyMotion?
Ruby toolchain for iOS
Author:Laurent Sansonetti(MacRuby)
1.9compliant
Something    Objective-CObjective-C RuntimeFoundation Framework     iOS SDK
RubyMotion   Objective-CObjective-C RuntimeFoundation Framework       iOS SDK
Different...
...but the same        Gary       Oldman
Observations
ObjectsRubyMotionObjective-C
RubyMotion Objects# Ruby"PHRUG".class.ancestors=> [String, Comparable, Object, Kernel,BasicObject]# RubyMotion"PHRUG".clas...
RubyMotion Objects# RubyMotionObject == NSObject=> true
Objective-CRubyMotion    Methods
RubyMotion Methods# Objective-C / CocoaNSString *string = [[NSString alloc] initWithString:@"PhRuG"];# RubyMotionstring = ...
RubyMotion Methods# Objective-C / CocoaNSString *string =  [[NSString alloc] initWithString:@"PhRuG"];[string uppercaseStr...
RubyMotion Methods# Objective-C / CocoaNSString *string =  [[NSString alloc] initWithString:@"PhRuG"];[string uppercaseStr...
NamedParameters
Named Parameters# Objective-C, named parameters[string drawAtPoint: point withFont:font]# RubyMotionstring.drawAtPoint(poi...
Named Parameters# Objective-C, named parameters[string drawAtPoint: point withFont:font]# RubyMotionstring.drawAtPoint(poi...
If theyre the   same...
... why use it?
GoodStuff
Power
Editor   +Terminal
Rake
rake simulator
rake device
rake spec
Testing (MacBacon)
GarbageCollection
REPL(read-eval-print loop)
DSLs(domain specific languages)
Cocoapods
Disadvantages
Disadvantages● Cost  ○ $199.99 with 1 year updates  ○ $99 per year to continue updates● Most resources are in Objective-C●...
Demo Time!
Questions?
Resources● rubymotion.com● rubymotion.com/developer-center● slideshare.net/markvilla/macruby-rubymotion-    madridrb-may-2...
Images● http://rubyidentity.org/● http://www.rubymotion.com/press/● developer.apple.  com/technologies/mac/cocoa.html● coc...
Thanks!
Marc Ignaciotwitter: @pd_i   github: @padi
RubyMotion Introduction
RubyMotion Introduction
RubyMotion Introduction
RubyMotion Introduction
Upcoming SlideShare
Loading in …5
×

RubyMotion Introduction

691
-1

Published on

RubyMotion talk by Marc Rendl Ignacio during the October 2012 PHRUG (Philippine Ruby User Group) meetup held at the AELOGICA office.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
691
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
9
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

RubyMotion Introduction

  1. 1. RubyMotionMaking iOS apps in Ruby
  2. 2. @pd_i
  3. 3. Prerequisites
  4. 4. Prerequisites Ruby MVC Objective-C* *optional
  5. 5. What isRubyMotion?
  6. 6. Ruby toolchain for iOS
  7. 7. Author:Laurent Sansonetti(MacRuby)
  8. 8. 1.9compliant
  9. 9. Something Objective-CObjective-C RuntimeFoundation Framework iOS SDK
  10. 10. RubyMotion Objective-CObjective-C RuntimeFoundation Framework iOS SDK
  11. 11. Different...
  12. 12. ...but the same Gary Oldman
  13. 13. Observations
  14. 14. ObjectsRubyMotionObjective-C
  15. 15. RubyMotion Objects# Ruby"PHRUG".class.ancestors=> [String, Comparable, Object, Kernel,BasicObject]# RubyMotion"PHRUG".class.ancestors=> [String, NSMutableString, NSString,Comparable, NSObject, Kernel]
  16. 16. RubyMotion Objects# RubyMotionObject == NSObject=> true
  17. 17. Objective-CRubyMotion Methods
  18. 18. RubyMotion Methods# Objective-C / CocoaNSString *string = [[NSString alloc] initWithString:@"PhRuG"];# RubyMotionstring = NSString.alloc.initWithString "PhRuG"
  19. 19. RubyMotion Methods# Objective-C / CocoaNSString *string = [[NSString alloc] initWithString:@"PhRuG"];[string uppercaseString] => "PHRUG";# RubyMotionstring = NSString.alloc.initWithString "PhRuG"string.uppercaseString => "PHRUG"
  20. 20. RubyMotion Methods# Objective-C / CocoaNSString *string = [[NSString alloc] initWithString:@"PhRuG"];[string uppercaseString] => "PHRUG";# RubyMotionstring = NSString.alloc.initWithString "PhRuG"string.uppercaseString => "PHRUG"# we can still use ruby methods!string.upcase => "PHRUG"
  21. 21. NamedParameters
  22. 22. Named Parameters# Objective-C, named parameters[string drawAtPoint: point withFont:font]# RubyMotionstring.drawAtPoint(point, withFont:font)# using sendstring .send(:"drawAtPoint:withFont:", point, font)
  23. 23. Named Parameters# Objective-C, named parameters[string drawAtPoint: point withFont:font]# RubyMotionstring.drawAtPoint(point, withFont:font)# using sendstring .send(:"drawAtPoint:withFont:", point, font)
  24. 24. If theyre the same...
  25. 25. ... why use it?
  26. 26. GoodStuff
  27. 27. Power
  28. 28. Editor +Terminal
  29. 29. Rake
  30. 30. rake simulator
  31. 31. rake device
  32. 32. rake spec
  33. 33. Testing (MacBacon)
  34. 34. GarbageCollection
  35. 35. REPL(read-eval-print loop)
  36. 36. DSLs(domain specific languages)
  37. 37. Cocoapods
  38. 38. Disadvantages
  39. 39. Disadvantages● Cost ○ $199.99 with 1 year updates ○ $99 per year to continue updates● Most resources are in Objective-C● Not an excuse to not learn Objective-C● No RubyMotion Book (yet)
  40. 40. Demo Time!
  41. 41. Questions?
  42. 42. Resources● rubymotion.com● rubymotion.com/developer-center● slideshare.net/markvilla/macruby-rubymotion- madridrb-may-2012-13154591● http://www.slideshare.net/clayallsopp/preview- unicorns-magic-and-better-apps-with-rubymotion [for the Gary Oldman metaphor :) ]
  43. 43. Images● http://rubyidentity.org/● http://www.rubymotion.com/press/● developer.apple. com/technologies/mac/cocoa.html● cocoapods.org
  44. 44. Thanks!
  45. 45. Marc Ignaciotwitter: @pd_i github: @padi

×