Skip to content

Instantly share code, notes, and snippets.

@mixflame
Created October 28, 2012 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mixflame/3968012 to your computer and use it in GitHub Desktop.
Save mixflame/3968012 to your computer and use it in GitHub Desktop.
Sublime Text 2 Format Any Ruby File on Save Plugin by jsilver
# place in Packages/User/
# recommend with trim trailing whitespace and sublimelinter
import sublime_plugin, re
class rubyCheck(sublime_plugin.EventListener):
def on_pre_save(self, view):
if re.search("Ruby", view.settings().get('syntax')):
view.window().run_command("ruby_format")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment