Mobile Development with Ruby

quarterceladonΚινητά – Ασύρματες Τεχνολογίες

10 Δεκ 2013 (πριν από 3 χρόνια και 6 μήνες)

76 εμφανίσεις

Mobile Development with Ruby

Ruby Frameworks for Mobile App Development

What is Ruby?


Ruby is:


Dynamic


Reflective


Object
-
Oriented


General purpose

Ruby Implementations


MRI Rubies (1.8.6


2.1.0)


HotRuby


Topaz


Mruby


Jruby


Rubinius


Kiji


Opal


IronRuby

Ruby Implementations


MRI Rubies (1.8.6


2.1.0)
-

C


HotRuby



JavaScript &
ActionScript

3.0


Topaz
-

Python


Mruby



C & Objective C


Jruby

-

JVM


Rubinius



C++


Kiji



Ruby Enterprise Edition


Opal
-

JavaScript


IronRuby

-

.NET

Ruby Implementations

Ruby Implementations


Mruby


MacRuby

MobiRuby


Framework to build Ruby
-
based apps


Runs on C/Objective
-
C & Java platforms


MobiRuby


Developed by
Yuichiro

Masui


iOS

app development kit on
mruby


MIT license


Can access native functions


Android version in the works


Goal: Provide Ruby power to mobile
devices.

mruby


MobiRuby

built on
mruby


Developed by Ruby creator
Matz


Released on April 20
th
, 2012

A light
-
weight implementation of Ruby

Linked and embedded within a program

Functions similarly to
Lua

embedded language

mruby


Simple C program with
mruby

MobiRuby

Continued

MobiRuby

Continued


MobiRuby

-

cfunc


C function bridge for
mruby


Call C based functions directly

MobiRuby

Continued


MobiRuby

-

Cocoa


Cocoa is Apple’s native Object
-
Oriented
API for OS X


Cocoa bridge for
mruby


Use Cocoa functions transparently


Manipulate Cocoa objects


Creates class/instance, and inherit existing
classes


Garbage collection / Memory management

MobiRuby

Continued


MobiRuby

-

Common


Still in development


Will be the common utilities section for
Android

MobiRuby

-

iOS


Utilizes
iOS

specific utilities


Bootstrap Implementation


Xcode

Integration


Uses wrapped classes

Hello World Example


Hello World Example


Pros


Powered with Ruby


Based on
Matz

implemented Ruby


Mrbgems


MIT license


Compact

Cons


Unstable


Less classes / functions


No debugging feature


Need to understand
iOS

and Cocoa


Small community

RubyMotion


A mobile app framework


Develop and test native apps for
iOS

and
OS X


Built on
MacRuby

MacRuby


Implementation of Ruby 1.9


Runs with OS X core technologies


Utilizes Objective
-
C and garbage
collector


Goal: Enable the creation of full
-
fledged
Mac OS X applications which do not
sacrifice performance in order to enjoy
the benefits of using Ruby

Hello World Example

Hello World Example

Hello World Example

Pros


Written in Ruby


MacRuby


REPL/Interactive Shell


Independent of
Xcode


Transparent Memory Management

Cons


Not all standard Ruby libraries and gems
are compatible


Cocoa Touch: Learning Cocoa APIs


No IDE


No Debugger


Unclear documentation (ex: Interacting
with Cocoa APIs)

Conclusion


Ruby gives developers another option


Easy to organize


Makes interactions with native OS X
applications simpler


Simplify Objective
-
C


Simplify use of Cocoa APIs

Questions


What are the benefits of multiple Ruby
implementations?


What are some pros and cons of learning
and using Ruby Frameworks?


What language is
RubyMotion

built on?
What does this imply?



References

http://www.infoq.com/news/2012/05/mruby
-
mobiruby

http://mobiruby.org/

https://github.com/mruby/mruby

http://matt.aimonetti.net/posts/2012/04/25/getting
-
started
-
with
-
mruby/

http://merbist.com/2012/05/04/macruby
-
on
-
ios
-
rubymotion
-
review/

http://macruby.org/

https://rvm.io/

http://opalrb.org/

https://github.com/masuidrive/mobiruby
-
rubyconf2012

http://37signals.com/svn/posts/3432
-
why
-
i
-
loved
-
building
-
basecamp
-
for
-
iphone
-
in
-
rubymotion

http://merbist.com/2012/04/23/new
-
ruby
-
mruby
-
and
-
mobiruby
-
for
-
ios
-
android/

https://developer.apple.com/technologies/mac/cocoa.html

https://github.com/MacRuby/MacRuby

http://www.rubyinside.com/this
-
week
-
in
-
ruby
-
matz
-
on
-
ruby
-
2
-
0
-
numerous
-
conference
-
cfps
-
tenderlove
-
on
-
define_method
-
6043.html