Redcar+RubyMotion
RubyMotion workflow support in Redcar Editor
Features
- Build, Test, and Run app from Cocoa Menu
- Inline syntax checking for MacRuby
- Look up documentation for focussed text
- Send Support Tickets
- Generate classes from templates
- Save and Install custom templates
- View RubyMotion and iOS reference documentation
- Resource Manager pane for adding, removing, and viewing project resources
- CTags-based Autocompletion of class and method names -- Objective-C methods are automatically converted to Ruby!
- Release builds to beta testers using TestFlight
Requirements
- AppleScript, for terminal emulator interaction
- Redcar 0.12+
- RubyMotion 1.0+
- (Optional) ClamShell, Ingredients or Dash, for documentation lookup
Installation
Fresh Install
- Close Redcar
- Clone this repository into
~/.redcar/plugins/rubymotion
rm ~/.redcar/cache/textmate-bundles.cache
(only necessary if you do not already have a MacRuby bundle installed in ~/.redcar/Bundles)- Start Redcar
Upgrade
- Close Redcar
- Run
git fetch origin && git checkout 0.9.1
from~/.redcar/plugins/rubymotion
- Start Redcar
Usage
Installing this plugin will add a new 'Cocoa' submenu to the Redcar menu bar.
Syntax checking is performed on file save.
Primary Commands
-
Run (Cmd+R): Run default
rake
command; build app and launch simulator from a terminal window -
Run on Device (Shift+Cmd+R): Build app and launch in attached and configured iOS device
-
Test (Ctrl+Cmd+T): Run test suite
-
Quit iOS Simulator (Shift+Ctrl+Q): Close simulator
-
Create Archives: Create release (App Store) and development .ipa files
-
Open Resource Manager: Show project resources in a tree pane, organized by type
-
Show Configuration: Display
rake config
in a Web View -
Show Documentation (Shift+Cmd+Space): Open documentation for selected or focussed text in ClamShell, Ingredients, or Dash.
-
File Support Ticket: File a ticket with RubyMotion support
-
Reference Links: Open developer documentation in Web Views
-
Menu Autocompletion: Typed text is automatically completed from available class, constant, struct, and method names. Press
Return
while a menu item is highlighted to insert it.
Customization
Documentation Launcher
- The preferred app for searching documentation can be changed via the menu in
Cocoa > Documentation Launcher
. - To change the path to Ingredients, Dash, or ClamShell apps, change
{app}_path
inCocoa
preferences.
Terminal Emulator
- To change which terminal emulator to use, set the
preferred_command_line
property inproject_plugin
preferences. I've only ever tried this with iTerm2 and Terminal, both seem to work fine.
Build Options
- Saving Tabs Before Command Execution: Automatically saving tabs before running a command can be changed via the menu in
Cocoa > Build Options
. - Running Rake Commands with
--trace
: Running commands with full backtraces can be changed via the menu inCocoa > Build Options
.
Opening Links
- Reference Documentation can be opened in either the built-in Redcar browser or the external browser of choice by editing
use_external_browser_for_urls
inhtml_view
preferences.
Syntax Checking and Highlighting
- By default, Redcar+RubyMotion interprets all Ruby files in RubyMotion projects using MacRuby syntax. Set
force_macruby_grammar
inCocoa
preferences tofalse
to disable this option. - To change the path to the
ruby
implementation used for syntax checking, changemacruby_path
inCocoa
preferences.
File Templates
- Custom File Templates can be installed in
~/.redcar/RubyMotion/templates
. All files must end insnippet
and can optionally use TextMate snippet syntax for filling in fields. Any instances of__NAME__
will replaced with the selected class name upon activation.
Support
- Feel free to file an issue on github if you have a bug or suggestion. :)