Slide 1

Slide 1 text

@kattrali Crafting iOS Dev Tools in Redcar, the Ruby Editor Delisa Mason

Slide 2

Slide 2 text

@kattrali

Slide 3

Slide 3 text

(Obligatory Adorable Animal)

Slide 4

Slide 4 text

A journey to find better editors for Ruby

Slide 5

Slide 5 text

@kattrali Why I like Redcar • It is written in Ruby • It is an editor for Ruby • Open source • Easily extensible • Lightweight • It was open source TextMate before TextMate was open source

Slide 6

Slide 6 text

@kattrali Features • Source control integration • Support for TextMate bundles • Fast project navigation between files and methods • Ability to run shell commands and process the output • Syntax checking

Slide 7

Slide 7 text

@kattrali So many features! • Two-way communication between javascript and ruby in embedded web views • Evaluates Ruby code in a REPL and change the editor itself in real time • Easy to test new feature ideas • Excellent RubyMotion support! ΁(◕. ◕ ΁ʣ

Slide 8

Slide 8 text

@kattrali Under the Hood • Runs on JRuby • Uses Standard Widget Toolkit for GUI bindings • Adds functionality by composition • Everything is a plugin

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

@kattrali Plugin Format

Slide 11

Slide 11 text

@kattrali Plugin Specification # plugin.rb Plugin.define do name "HTML View" version "0.3.2" object "Redcar::HtmlView" file "lib", "html_view" dependencies "core", ">0", "application", ">0", "application_swt", ">0", "edit_view", ">0" end

Slide 12

Slide 12 text

@kattrali Event Hooks self.menus # Define Menu and Submenu Items self.keymaps # Define Keyboard Shortcuts for Menu Items self.toolbars # Define Toolbar Items and Icons self.storage # Define Settings and Defaults self.before_save # Perform an action before saving a tab self.after_save # Perform an action after saving a tab self.templates # Define File Templates under File > New...

Slide 13

Slide 13 text

@kattrali Composing a Plugin module Redcar class TaskManager # ... class Controller include HtmlController # mix in core models to add functionality def title # override default method implementations "Tasks" end def index render :index end end end end

Slide 14

Slide 14 text

@kattrali My Redcar plugins • help • web_bookmarks • tab_pane • line_tools • miniview • templates • groovy support • code-package-view • runnable • terminal • vimly • hotswap • inline documentation • storytracker • clipboard viewer • web bookmarks • grails integration • highlight-line • rubymotion

Slide 15

Slide 15 text

iOS Development

Slide 16

Slide 16 text

Xcode

Slide 17

Slide 17 text

Xcode

Slide 18

Slide 18 text

@kattrali Redcar and RubyMotion together at last

Slide 19

Slide 19 text

Develop Ruby Apps in a Ruby editor written in Ruby

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

@kattrali Developing RubyMotion features for Redcar • Only 1,000 lines of code • Makes use of AppleScript for iOS Simulator manipulation • Uses SWT bindings for autocompletion http://cloc.sourceforge.net v 1.56 T=0.5 s (32.0 files/s, 2640.0 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Ruby 16 151 76 1093 ------------------------------------------------------------------------------- SUM: 16 151 76 1093 -------------------------------------------------------------------------------

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

@kattrali Redcar RubyMotion Features • Build, Run and Test Projects • Inline syntax checking for MacRuby • Inline documentation lookup • View RubyMotion and iOS reference centers • Send support tickets • Save and install custom templates • View documentation for focused or selected text • Resource Manager pane for adding, removing and viewing project resources • Autocompletion of classes, method names, disturbingly long constants • Deploy and manage beta builds with TestFlight

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

Resource Management

Slide 26

Slide 26 text

Autocompletion

Slide 27

Slide 27 text

Documentation Reference (with ClamShell)

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

@kattrali Installation and upgrade • Download and drop into ~/.redcar/plugins • git checkout alternate branches for experimental features • Restart Redcar

Slide 30

Slide 30 text

Future Plans for Redcar+RubyMotion 1.0+ • Stable integrated debugger • Commands for attaching profiling tools to a running application (e.g. Instruments) • Smarter autocompletion • Static analysis for Ruby • Better snippets and templates • More testing support

Slide 31

Slide 31 text

Real World Applications?

Slide 32

Slide 32 text

KanaGo, now in the App Store

Slide 33

Slide 33 text

KanjiGo, also in the App Store

Slide 34

Slide 34 text

@kattrali Questions?