schlueter-rushmate 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +3 -0
- data/README +2 -2
- data/lib/rushmate/textmate_helper.rb +19 -4
- data/rushmate.gemspec +1 -1
- metadata +1 -1
data/History.txt
CHANGED
data/README
CHANGED
@@ -20,10 +20,10 @@ require 'rubygems'
|
|
20
20
|
require 'rushmate'
|
21
21
|
Rushmate::Command.new {
|
22
22
|
# find ruby files with the current word in textmate
|
23
|
-
found_files =
|
23
|
+
found_files = project_directory["**/#{current_word.downcase}.rb"]
|
24
24
|
if found_files.empty?
|
25
25
|
# if you can't find any files show a tool tip
|
26
|
-
exit.show_tool_tip("can't find #{
|
26
|
+
exit.show_tool_tip("can't find #{current_word.downcase}.rb in project")
|
27
27
|
else
|
28
28
|
# go ahead and switch to the found file(s)
|
29
29
|
found_files.mate
|
@@ -1,6 +1,10 @@
|
|
1
1
|
module Rushmate
|
2
2
|
module TextmateHelper
|
3
|
-
def
|
3
|
+
def current_line
|
4
|
+
ENV["TM_CURRENT_LINE"]
|
5
|
+
end
|
6
|
+
|
7
|
+
def current_word
|
4
8
|
ENV['TM_CURRENT_WORD']
|
5
9
|
end
|
6
10
|
|
@@ -16,12 +20,23 @@ module Rushmate
|
|
16
20
|
ENV["TM_FILENAME"]
|
17
21
|
end
|
18
22
|
|
19
|
-
def
|
23
|
+
def project_directory?
|
24
|
+
ENV['TM_PROJECT_DIRECTORY']
|
25
|
+
end
|
26
|
+
|
27
|
+
def project_directory
|
20
28
|
root[ENV['TM_PROJECT_DIRECTORY'] + "/"]
|
21
29
|
end
|
22
30
|
|
23
|
-
def
|
24
|
-
ENV["
|
31
|
+
def selected_text
|
32
|
+
ENV["TM_SELECTED_TEXT"]
|
25
33
|
end
|
34
|
+
|
35
|
+
|
36
|
+
alias :tm_current_line :current_line
|
37
|
+
alias :tm_current_word :current_word
|
38
|
+
alias :tm_project_directory? :project_directory?
|
39
|
+
alias :tm_project_directory :project_directory
|
40
|
+
alias :tm_selected_text :selected_text
|
26
41
|
end
|
27
42
|
end
|
data/rushmate.gemspec
CHANGED