Permalink
Browse files

Cmd+S bound to 'Validate and Save' which uses Rubinus if 'rbx' is in …

…$PATH.
  • Loading branch information...
drnic committed Jun 1, 2010
1 parent 1cf7335 commit addf8e0a347451a719013a311104ed70794118cd
Showing with 35 additions and 0 deletions.
  1. +34 −0 Commands/Validate and Save.tmCommand
  2. +1 −0 info.plist
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>beforeRunningCommand</key>
+ <string>saveActiveFile</string>
+ <key>command</key>
+ <string>#!/usr/bin/env ruby
+
+require ENV['TM_SUPPORT_PATH'] + '/lib/textmate'
+
+compiler_ruby = `which rbx`.strip
+if compiler_ruby.length == 0
+ compiler_ruby = ENV['TM_RUBY'] || `which ruby`.strip
+end
+
+result = `#{compiler_ruby} -wc "$TM_FILEPATH" 2&gt;&amp;1`
+print result
+TextMate.go_to :line =&gt; $1 if result =~ /:(\d+):/
+</string>
+ <key>input</key>
+ <string>document</string>
+ <key>keyEquivalent</key>
+ <string>@s</string>
+ <key>name</key>
+ <string>Validate and Save</string>
+ <key>output</key>
+ <string>showAsTooltip</string>
+ <key>scope</key>
+ <string>source.ruby</string>
+ <key>uuid</key>
+ <string>E0E058FC-0DC3-4872-A1C2-0B1A322A0CF5</string>
+</dict>
+</plist>
View
@@ -449,6 +449,7 @@
<string>8646378E-91F5-4771-AC7C-43FC49A93576</string>
<string>EE5F19BA-6C02-11D9-92BA-0011242E4184</string>
<string>76FCF165-54CB-4213-BC55-BD60B9C6A3EC</string>
+ <string>E0E058FC-0DC3-4872-A1C2-0B1A322A0CF5</string>
<string>EE5F1FB2-6C02-11D9-92BA-0011242E4184</string>
<string>FBFC214F-B019-4967-95D2-028F374A3221</string>
<string>9FB64639-F776-499B-BA6F-BB45F86F80FD</string>

0 comments on commit addf8e0

Please sign in to comment.