SublimeText2 - Check ruby syntax after save
Edit the file: /path/to/SublimeText2/Packages/Ruby/Ruby.sublime-build to contain this:
{
"cmd": ["/path/to/ruby/bin/ruby", "-cw", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.ruby"
}
Then create the following file /path/to/SublimeText2/Packages/User/ruby_check.py:
import sublime, sublime_plugin
class rubyCheck(sublime_plugin.EventListener):
def on_post_save(self, view):
if view.file_name()[-3:] == '.rb':
view.window().run_command("build")
Now when you save your ruby file automatically the syntax will be checked
Here the gist