Crafting iOS Dev Tools in Redcar, the Ruby Editor

Crafting iOS Dev Tools in Redcar, the Ruby Editor

Redcar is a really fun text editor, written in Ruby and fully customizable. Let's see how we can make iOS development better by building better tools in an expressive language. We don't have to do things all the same way. :-)

B5ff8c85fb809e9966436593b40f1063?s=128

Delisa Mason

March 28, 2013
Tweet

Transcript

  1. @kattrali Crafting iOS Dev Tools in Redcar, the Ruby Editor

    Delisa Mason
  2. @kattrali

  3. (Obligatory Adorable Animal)

  4. A journey to find better editors for Ruby

  5. @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
  6. @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
  7. @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! ΁(◕. ◕ ΁ʣ
  8. @kattrali Under the Hood • Runs on JRuby • Uses

    Standard Widget Toolkit for GUI bindings • Adds functionality by composition • Everything is a plugin
  9. None
  10. @kattrali Plugin Format

  11. @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
  12. @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...
  13. @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
  14. @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
  15. iOS Development

  16. Xcode

  17. Xcode

  18. @kattrali Redcar and RubyMotion together at last

  19. Develop Ruby Apps in a Ruby editor written in Ruby

  20. None
  21. @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 -------------------------------------------------------------------------------
  22. None
  23. @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
  24. None
  25. Resource Management

  26. Autocompletion

  27. Documentation Reference (with ClamShell)

  28. None
  29. @kattrali Installation and upgrade • Download and drop into ~/.redcar/plugins

    • git checkout alternate branches for experimental features • Restart Redcar
  30. 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
  31. Real World Applications?

  32. KanaGo, now in the App Store

  33. KanjiGo, also in the App Store

  34. @kattrali Questions?