public
Rubygem
Description: Creates a bridge between rush ruby shell + ssh and textmate your favorite text editor
Homepage: http://rails.simpltry.com/rushmate/index.html
Clone URL: git://github.com/schlueter/rushmate.git
name age message
file History.txt Mon Aug 18 18:04:01 -0700 2008 bumped version number [schlueter]
file MIT-LICENSE Loading commit data...
file Manifest.txt Thu Aug 14 21:03:57 -0700 2008 added tests and renamed a few methods - see His... [schlueter]
file README
file Rakefile Wed Aug 20 04:30:38 -0700 2008 added LICENSE to the rdoc [schlueter]
directory lib/ Mon Aug 18 17:23:59 -0700 2008 added rdocs [schlueter]
file rushmate.gemspec Wed Aug 20 04:30:38 -0700 2008 added LICENSE to the rdoc [schlueter]
directory test/ Thu Aug 14 21:03:57 -0700 2008 added tests and renamed a few methods - see His... [schlueter]
= Rushmate

Rushmate attempts to make Textmate (http://macromates.com) custom command writing in ruby 
cleaner and smaller.  It does this by leveraging rush (http://rush.heroku.com/).

== Dependencies

* Rush

== Install

gem sources -a http://gems.github.com

sudo gem install schlueter-rushmate

== Sample

After installing rushmate.  You would make a command in Textmate with the following text.

#!/usr/bin/env ruby
require 'rubygems'
require 'rushmate'
Rushmate::Command.new {
  # find ruby files with the current word in textmate
  found_files = project_directory["**/#{current_word.downcase}.rb"]
  if found_files.empty?
    # if you can't find any files show a tool tip
    exit.show_tool_tip("can't find #{current_word.downcase}.rb in project")
  else
    if found_files.size == 1
      # if there is only 1 file go ahead and switch to that file
      found_files.mate
    else
      # if there are multiple files prompt the user for which file they want to switch to 
      # then switch to their selection
      menu_files = found_files.collect { |f| f.full_path.gsub(project_directory.full_path, "") }
      project_directory[user_input.quick_menu_from_array(menu_files)].mate
    end
  end
}

For more information on creating Textmate commands read http://manual.macromates.com/en/commands#commands.