| 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 for Method") |
| 14 |
grepper.run { |
| 15 |
m = $stdin.read.strip |
| 16 |
|
| 17 |
m = TextMate::UI.request_string(:title => "Grep for method", :prompt => "Enter a method 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 |
grepper.include_files << ["*.rb"] |
| 25 |
|
| 26 |
grepper.query = /(^|;) *((def +(self\.|)#{m}\b)|(def_delegators[\( ][^,]+,.*\b#{m}\b)|(c?attr_(reader|writer|accessor).*\b#{m}\b)|((belongs_to|belongs_to_reciprocated|has_many|has_and_belongs_to_many)[\(: ]+#{m}\b)|(# #{m} +:)|(alias :{0,1}#{m}\b))/ |
| 27 |
grepper.query_highlight_regexp = Regexp.new(Regexp.escape(m)) |
| 28 |
grepper.title = "Searching for method #{ m }" |
| 29 |
}</string> |
| 30 |
<key>fallbackInput</key> |
| 31 |
<string>word</string> |
| 32 |
<key>input</key> |
| 33 |
<string>selection</string> |
| 34 |
<key>keyEquivalent</key> |
| 35 |
<string>@M</string> |
| 36 |
<key>name</key> |
| 37 |
<string>Grep for Method</string> |
| 38 |
<key>output</key> |
| 39 |
<string>showAsTooltip</string> |
| 40 |
<key>uuid</key> |
| 41 |
<string>17830567-BC2D-4B99-B20F-F68903DA83A2</string> |
| 42 |
</dict> |
| 43 |
</plist> |