Skip to content

Instantly share code, notes, and snippets.

@mwlang
Last active December 17, 2015 22:19
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 mwlang/5681232 to your computer and use it in GitHub Desktop.
Save mwlang/5681232 to your computer and use it in GitHub Desktop.
TextMate hook that will switch Textmate's ruby versions automatically when rvm switches ruby versions....see http://www.christopherirish.com/2010/06/28/how-to-setup-textmate-to-use-rvm/ for background -- this script simpy automates the rvm wrapper ${RUBY_VERSION} textmate call described in the blog post.
#!/usr/bin/env bash
#
# Automatically sets the wrappers for textmate's use
# Based on article posted: http://www.christopherirish.com/2010/06/28/how-to-setup-textmate-to-use-rvm/
# Set up the TM_RUBY shell variable as described and remove the Builder as described and restart TextMate
#
# Make this script executable and you should be good to go! TextMate will stay in sync with rvm, which
# generally means the last project folder you switched into from terminal shell.
#
if [[ $TM_WRAPPING != "1" ]]; then
export TM_WRAPPING="1"
rvm wrapper ${RUBY_VERSION} textmate
unset TM_WRAPPING
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment