schlueter-rushmate 0.0.3 → 0.0.4
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 +5 -0
- data/Manifest.txt +1 -1
- data/README +32 -2
- data/lib/rushmate/command.rb +16 -5
- data/lib/rushmate/{exits.rb → exit.rb} +1 -1
- data/lib/rushmate.rb +1 -1
- data/rushmate.gemspec +2 -2
- metadata +2 -2
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/README
CHANGED
@@ -1,3 +1,33 @@
|
|
1
|
-
|
1
|
+
= Rushmate
|
2
2
|
|
3
|
-
|
3
|
+
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/).
|
4
|
+
|
5
|
+
== Dependencies
|
6
|
+
|
7
|
+
* Rush
|
8
|
+
|
9
|
+
== Install
|
10
|
+
|
11
|
+
gem sources -a http://gems.github.com
|
12
|
+
sudo gem install schlueter-rushmate
|
13
|
+
|
14
|
+
== Sample
|
15
|
+
|
16
|
+
After installing rushmate. You would make a command in Textmate with the following text.
|
17
|
+
|
18
|
+
#!/usr/bin/env ruby
|
19
|
+
require 'rubygems'
|
20
|
+
require 'rushmate'
|
21
|
+
Rushmate::Command.new {
|
22
|
+
# find ruby files with the current word in textmate
|
23
|
+
found_files = tm_project_directory["**/#{tm_current_word.downcase}.rb"]
|
24
|
+
if found_files.empty?
|
25
|
+
# if you can't find any files show a tool tip
|
26
|
+
exit.show_tool_tip("can't find #{tm_current_word.downcase}.rb in project")
|
27
|
+
else
|
28
|
+
# go ahead and switch to the found file(s)
|
29
|
+
found_files.mate
|
30
|
+
end
|
31
|
+
}
|
32
|
+
|
33
|
+
For more information on creating Textmate commands read http://manual.macromates.com/en/commands#commands.
|
data/lib/rushmate/command.rb
CHANGED
@@ -1,12 +1,10 @@
|
|
1
1
|
module Rushmate
|
2
|
+
# The Command Class is the main class in Rushmate.
|
2
3
|
class Command
|
3
4
|
include TextmateHelper
|
4
5
|
attr_accessor :shell
|
5
|
-
def initialize()
|
6
|
-
|
7
|
-
end
|
8
|
-
|
9
|
-
def run(&block)
|
6
|
+
def initialize(&block)
|
7
|
+
setup_shell
|
10
8
|
self.instance_eval(&block)
|
11
9
|
end
|
12
10
|
|
@@ -19,5 +17,18 @@ module Rushmate
|
|
19
17
|
execute sym.to_s
|
20
18
|
end
|
21
19
|
|
20
|
+
def exit
|
21
|
+
Rushmate::Exit.new
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
def setup_shell
|
26
|
+
self.shell = Rush::Shell.new
|
27
|
+
shell.class.class_eval do
|
28
|
+
def print_result(res)
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
22
33
|
end
|
23
34
|
end
|
data/lib/rushmate.rb
CHANGED
data/rushmate.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "rushmate"
|
3
|
-
s.version = "0.0.
|
3
|
+
s.version = "0.0.4"
|
4
4
|
s.email = "schlueter@gmail.com"
|
5
5
|
s.homepage = "http://github.com/schlueter/rushmate"
|
6
6
|
s.description = "Textmate to Rush bridge"
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
"rushmate.gemspec",
|
18
18
|
"lib/rushmate.rb",
|
19
19
|
"lib/rushmate/command.rb",
|
20
|
-
"lib/rushmate/
|
20
|
+
"lib/rushmate/exit.rb",
|
21
21
|
"lib/rushmate/textmate_helper.rb"
|
22
22
|
]
|
23
23
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schlueter-rushmate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Schlueter
|
@@ -38,7 +38,7 @@ files:
|
|
38
38
|
- rushmate.gemspec
|
39
39
|
- lib/rushmate.rb
|
40
40
|
- lib/rushmate/command.rb
|
41
|
-
- lib/rushmate/
|
41
|
+
- lib/rushmate/exit.rb
|
42
42
|
- lib/rushmate/textmate_helper.rb
|
43
43
|
has_rdoc: true
|
44
44
|
homepage: http://github.com/schlueter/rushmate
|