Tweaking TextMate Ruby Bundle Run Command - No Fluff Just Stuff

Tweaking TextMate Ruby Bundle Run Command

Posted by: Venkat Subramaniam on February 5, 2008

I blogged here about tweaking TextMate bundle for Groovy so the output appears in a tooltip.

You can do the same thing for Ruby as well. I am teaching a Ruby on Rails course this week and to my pleasant surprise some of the attendees are on Mac. So, we're sharing some Mac tricks as well. One of first things they wanted to know was how I display the output in in TextMate.

I hate for a separate window to popup for output. The tooltip style is convenient to quickly show output right after you type code. It is real simple to set this up.

In TextMate, go to Bundles | Bundle Editor | Show Bundle Editor. Go to Ruby -> Run to Edit command for Run. Modify as shown below:

Here's the code I have in Commands:

if [ -e "${TM_FILEPATH}" ]; then
"ruby" "${TM_FILEPATH}"
else
puts "File not found or not saved. Please save first or try 'Run script' on a selection of text"
fi

Now, write Ruby code in a .rb file and simply press Command + R to see the output in a tooltip, as shown below:

While some of the attendees are using Mac, the rest of the attendees are using Windows. They wanted TextMate on Windows! So, I asked them to give E Text Edit a try, and they seem to like it so far.

Venkat Subramaniam

About Venkat Subramaniam

Dr. Venkat Subramaniam is an award-winning author, founder of Agile Developer, Inc., creator of agilelearner.com, and an instructional professor at the University of Houston.

He has trained and mentored thousands of software developers in the US, Canada, Europe, and Asia, and is a regularly-invited speaker at several international conferences. Venkat helps his clients effectively apply and succeed with sustainable agile practices on their software projects.

Venkat is a (co)author of multiple technical books, including the 2007 Jolt Productivity award winning book Practices of an Agile Developer. You can find a list of his books at agiledeveloper.com. You can reach him by email at venkats@agiledeveloper.com or on twitter at @venkat_s.

Why Attend the NFJS Tour?

  • » Cutting-Edge Technologies
  • » Agile Practices
  • » Peer Exchange

Current Topics:

  • Languages on the JVM: Scala, Groovy, Clojure
  • Enterprise Java
  • Core Java, Java 8
  • Agility
  • Testing: Geb, Spock, Easyb
  • REST
  • NoSQL: MongoDB, Cassandra
  • Hadoop
  • Spring 4
  • Cloud
  • Automation Tools: Gradle, Git, Jenkins, Sonar
  • HTML5, CSS3, AngularJS, jQuery, Usability
  • Mobile Apps - iPhone and Android
  • More...
Learn More »