- loading...
Validate and Save your Ruby in TextMate – with secret Rubinus superpowers
In some TextMate bundles, if you save a file it will also validate the file and show any syntax errors in a tooltip. This is awesome. (e.g. JavaScript and CoffeeScript)
So I added the same thing to my Ruby.tmbundle. Install this, save a dodgy Ruby file and you’ll now see something like:

Rubinius superpowers
Do you think the following syntax error tooltip is more useful?

Yes it lovely, and the new Ruby.tmbundle will automatically do this if it can find rbx in your TextMate’s $PATH. Yeah yeah.
If you have Homebrew installed:
brew install rubinius
Then in TextMate, add your homebrew bin folder to the $PATH.
- Go to TextMate’s Preferences (Cmd+,)
- Go to “Advanced”, then “Shell Variables”
- Edit the
PATHvariable, and add “:/path/to/homebrew/bin”
For example, if you have homebrew installed in ~/.homebrew then you might add :/Users/drnic/.homebrew/bin
. My complete $PATH in TextMate is:
/usr/bin:/bin:/usr/sbin:/sbin:/opt/local/bin:/usr/local/bin/:/Users/drnic/.homebrew/bin
Save a dodgy Ruby file and see the beautifully helpful syntax message.
Install Ruby.tmbundle
To install via Git:
mkdir -p ~/Library/Application\ Support/TextMate/Bundles
cd ~/Library/Application\ Support/TextMate/Bundles
git clone git://github.com/drnic/ruby-tmbundle.git "Ruby.tmbundle"
osascript -e 'tell app "TextMate" to reload bundles'
Related posts:
- Packaging TextMate bundles in OS X DMGs Last week Engine Yard released a CLI for their Engine...
- Future proofing your Ruby code. Ruby 1.9.1 is coming. Bugger. I’m a Ruby monogamist. I use the Ruby...
- TextMate easter egg: find bundle commands by key combo I’ve dreamed of the ability to ask TextMate “what frigging...
- My attempt at sake task management I’ve used sake intermittently in my workflow. It competes...
- Unit Testing iPhone apps with Ruby: rbiphonetest Everything to love about Ruby: the concise, powerful language;...
[...] This post was mentioned on Twitter by Dr Nic, Łukasz Strzałkowski. Łukasz Strzałkowski said: RT @drnic: Ruby.tmbundle will now automatically "Validate & Save" on Cmd+S and uses Rubinius superpowers if installed http://bit.ly/ceocfr [...]
Nic,
Is there a way to turn this off? I’ve updated to the latest bundles and it shows errors on a lot of our partials. A simple test case is test_case = 1 inside ERB escape strings.
George
@George – critical bug now fixed. Sorry about that.
Dr.Nic thanks a lot for fixing bug. I didn’t want to write when Mr. George post about bug.
One thing that would be super awesome: Make it work with rvm out of the box (symlinking sucks, as you have to keep track what and where the current version is).