This plugin provides some features that simplify RubyMotion developing in Sublime Text 2 and 3.
-
RubyMotion syntax
It will work with RubyMotion project related *.rb and Rakefile. Code completion and Build system don't work in pure Ruby editing.
-
Code completion
It is same as RubyMotionSublimeCompletions. The only difference is syntax scope.
-
Build system (only work with RubyMotion)
Provides build system for RubyMotion. Supports four commands,
Build
,Clean
,Run
andDeploy
.Run
kick Terminal.app automatically.
note: This step requires Package Control.
- Open the Command Palette using [
command
+shift
+p
] and enter "install package". - Select
Package Control: Install Package
from the popup menu and press [enter
/return
] - Enter "RubyMotionBuilder" and press [
enter
/return
]
Put this package into your Sublime Text 2 or 3 packages folder:
- Sublime Text 2
% git clone https://github.com/RubyMotionJP/SublimeRubyMotionBuilder.git ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/RubyMotionBuild
- Sublime Text 3
% git clone https://github.com/RubyMotionJP/SublimeRubyMotionBuilder.git ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/RubyMotionBuild
Functions | Key bind |
---|---|
Build | command + b |
Run | command + r |
Run Spec | command + option + r |
Deploy | command + option + b |
Show reference | control + option + d |
- Open *.rb or Rakefile in your RubyMotion project
- You can see the "RubyMotion" on status bar in right bottom corner. Otherwise, it's not working. If Sublime Text cache keep syntax as "Ruby", please close and open the file.
note: RubyMotion detection rule is projtect's Rakefile contains "Motion", or not.
- Inside your RubyMotion project just start typing the name of a method and the autocomplete window will pop up.
- Press
enter
/return
to trigger the completion.
- Verify that Tools -> Build System is set to Automatic.
- Open *.rb or Rakefile in your RubyMotion project and press [
command
+b
]. - Wait for the console to notify you the message "[Finished]".
- If you get a error, you can jump to it with press [
F4
]
note: Default target is Simulator. If you want to change the target, please edit "RubyMotion.sublime-build".
- Open the Command Palette using [
command
+shift
+p
] and press "clean". - Select
RubyMotionBuilder: Clean
from the popup menu and press [enter
/return
]. - Wait for the console to notify you the message "[Finished]".
- Open *.rb or Rakefile in your RubyMotion project and press [
command
+r
]. If you want to enable retina, please press [shift
+command
+r
]. - Wait for the Terminal.app will kick Simulator.
- If you want to modify code and to try again, just re-press [
command
+r
]. Then, automatically post "quit" to Terminal.app and re-execute "rake".
note: Goto symbol
was assigned to [control
+ r
]
- Open *.rb or Rakefile in your RubyMotion project and press [
command
+option
+r
]. - Wait for the Terminal.app will kick Simulator.
- If you want to modify code and to try again, just re-press [
command
+option
+r
]. Then, automatically post "quit" to Terminal.app and re-execute "rake spec".
- Open *.rb or Rakefile in your RubyMotion project and press [
command
+option
+b
]. - Wait for the console to notify you the message "[Finished]".
- Open *.rb or Rakefile in your RubyMotion project.
- Select a word (like method) and press [
control
+option
+d
].
These two commands also supported in Command Pallet.
RubyMotionBuilder: Generate syntax
will generate syntax and snippets from Ruby syntax.RubyMotionBuilder: Generate completions
will generate completions from BridgeSupport files of RubyMotion.
- Open *.rb or Rakefile in your RubyMotion project
- Open [Sublime Text]->[Preferences]->[Settings - More]->[Syntax Specific - User] in Sublime Text menu.
- Configure "terminal" setting to switch terminal application to build app. The following settings switch terminal to "iTerm" (By default, "Terminal").
{
"terminal": "iTerm"
}
- Open *.rb or Rakefile in your RubyMotion project
- Open [Sublime Text]->[Preferences]->[Settings - More]->[Syntax Specific - User] in Sublime Text menu.
- Configure "activate_terminal" setting to disable terminal activation. The following settings disable terminal activation (By default, true).
{
"activate_terminal": false
}
When you would run app through this plugin, the plugin will save changed files. You could disable this feature.
- Open *.rb or Rakefile in your RubyMotion project
- Open [Sublime Text]->[Preferences]->[Settings - More]->[Syntax Specific - User] in Sublime Text menu.
- Configure "auto_save" setting to disable auto-save feature (By default, true).
{
"auto_save": false
}