• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Ruby, Meet iPhone
 

Ruby, Meet iPhone

on

  • 1,862 views

RubyMotion transports the dynamic language ethos and Ruby language to iOS all at once. The language is flexible and dynamic. Instead of in dialogs, configuration happens in a text file using a simple ...

RubyMotion transports the dynamic language ethos and Ruby language to iOS all at once. The language is flexible and dynamic. Instead of in dialogs, configuration happens in a text file using a simple internal Ruby DSL. Apps running in the simulator include a REPL for code evaluation. There’s even a built-in way to click on object in an app for dynamic introspection and manipulation. In this talk, we’ll introduce RubyMotion, the platform’s development tools and workflow, and third-party libraries that push the state of the art in iOS developer tools. We’ll show some example apps and reflect on experiences building real-world production apps in Ruby.

Statistics

Views

Total Views
1,862
Views on SlideShare
1,841
Embed Views
21

Actions

Likes
5
Downloads
15
Comments
0

3 Embeds 21

http://atomicobject.com 13
http://www.atomicobject.com 7
https://twitter.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Ruby, Meet iPhone Ruby, Meet iPhone Presentation Transcript

    • Drew Colthorpwww.atomicobject.comiPhone, meet Ruby
    • @atomicobject http://spin.atomicobject.comA Tour of RubyMotion• Implementation of Ruby• Similar object model to Objective C, natural language forthe platform• UNIX Ethos• Very Flexible
    • From our appdirectory, we can runour app in thesimulator with asimple command.
    • From-scratch implementation of Ruby.Started by apple in 2007.
    • © HipByte SPRL
    • © HipByte SPRL
    • @atomicobject http://spin.atomicobject.comGarbage Collection(Sort of. Auto-release and retain, similar to ARC.)
    • (App idea shamelessly ripped off from HipByte.)
    • @atomicobject http://spin.atomicobject.comRuby
    • Classes and methods; no header files; rest arguments.What you don’t see in the usual case is the flexibility of Ruby.
    • Method invocation syntax.
    • Keyword args: added to RubyMotion for Obj-C compatibility,now standard in Ruby 2.0.
    • do is syntax for blocks. Very similar to Objective C blocksparent= is just a method assumed to exist on el. Aliases tosetParent if el is an Objective C object.
    • These features of ruby make it great for creating internal DSLs.Why create separate parsers for incomplete languages when yourprimary language is so flexible?
    • Unlike most languages, there are no contexts where you can’t put code.For example, within a class definition, you can do whatever you want.
    • For example, we could put a print statement in our class def.
    • This is how you’d normally write it.
    • Checking of valid objects in ActiveRecordvalidates is a method on class objects inheriting from ActiveRecord::Base
    • @atomicobject http://spin.atomicobject.comRake
    • @atomicobject http://spin.atomicobject.comSpecs
    • @atomicobject http://spin.atomicobject.comREPL
    • Now, if we hold command and click on anelement, the context of our REPL changes tothe clicked element. Right now our REPL says(main), meaning we haven’t clicked an element.
    • If we command-click our text-box, we seeUILabel:0xf975. Now “self” refers to that element.
    • So we can set self.backgroundColor to see it change to red.Or we can tweak frame size to get the positioning just right.
    • @atomicobject http://spin.atomicobject.comWhat aboutObjective-C?
    • @atomicobject http://spin.atomicobject.comApps
    • © 37signals
    • @atomicobject http://spin.atomicobject.comThe End