| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| 3 |
<plist version="1.0"> |
| 4 |
<dict> |
| 5 |
<key>beforeRunningCommand</key> |
| 6 |
<string>nop</string> |
| 7 |
<key>bundleUUID</key> |
| 8 |
<string>5A9D4FC6-6CBE-11D9-A21B-000D93589AF6</string> |
| 9 |
<key>command</key> |
| 10 |
<string>#!/usr/bin/env ruby |
| 11 |
require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/grep_helpers.rb" |
| 12 |
|
| 13 |
grepper = GrepperMenu.new("Grep in Project") |
| 14 |
grepper.run { |
| 15 |
m = $stdin.read |
| 16 |
|
| 17 |
m = TextMate::UI.request_string(:title => "Grep for class", :prompt => "Enter a class you'd like to find:", :default => "" ).strip if m.empty? |
| 18 |
|
| 19 |
if m.nil? || m.empty? |
| 20 |
puts "Canceled" |
| 21 |
exit_show_tool_tip |
| 22 |
end |
| 23 |
|
| 24 |
if /^[a-z]/.match(m) |
| 25 |
require 'rubygems' |
| 26 |
require 'activesupport' |
| 27 |
m = m.classify |
| 28 |
end |
| 29 |
|
| 30 |
grepper.include_files << ["*.rb"] |
| 31 |
grepper.query = /((^|;) *(class|module) ([^<#]+::|)*#{m}\b([^:]|$))|(\b#{m} *=)/ |
| 32 |
grepper.query_highlight_regexp = Regexp.new(Regexp.escape(m)) |
| 33 |
grepper.title = "Searching for Class/Module #{ m }" |
| 34 |
} |
| 35 |
</string> |
| 36 |
<key>fallbackInput</key> |
| 37 |
<string>word</string> |
| 38 |
<key>input</key> |
| 39 |
<string>selection</string> |
| 40 |
<key>keyEquivalent</key> |
| 41 |
<string>~C</string> |
| 42 |
<key>name</key> |
| 43 |
<string>Grep for Class/Module</string> |
| 44 |
<key>output</key> |
| 45 |
<string>showAsTooltip</string> |
| 46 |
<key>uuid</key> |
| 47 |
<string>23D5F39E-73CA-43FC-90B3-18BDBEDDD56B</string> |
| 48 |
</dict> |
| 49 |
</plist> |