Created
October 17, 2011 01:47
-
-
Save edgar/1291750 to your computer and use it in GitHub Desktop.
SublimeText2 - Check ruby syntax after save file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Edit file: /path/to/SublimeText2/Packages/Ruby/Ruby.sublime-build | |
{ | |
"cmd": ["/home/edgar/.rvm/rubies/ruby-1.9.2-p290/bin/ruby", "-cw", "$file"], | |
"file_regex": "^(...*?):([0-9]*):?([0-9]*)", | |
"selector": "source.ruby" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy this to: /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") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It was a missing comma after the "-cw" flag. It works beatiful now.
Thank's!