Avatar Edgar González

  • Random
  • Archive
  • RSS

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

    • #ruby
    • #sublimetext2
    • #sublimetext
  • 7 months ago
  • 2
  • Comments
  • Permalink
  • Share
    Tweet

2 Notes/ Hide

  1. betacar liked this
  2. edgar posted this

Recent comments

Blog comments powered by Disqus
← Previous • Next →

Portrait/Logo

About

When I'm not spending time with Jessica and my kids, I build web applications. Rails developer, believer of Agile Development and Lean startups. NoSQL enthusiast.
CTO and Lord of the API at Piictu

Me, Elsewhere

  • @edgar on Twitter
  • Facebook Profile
  • edgargonzaleznetve on Youtube
  • egg on Flickr
  • edgar on Foursquare
  • My Skype Info
  • Linkedin Profile
  • edgar on github

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr