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 CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.0.4 / 2008-08-13
2
+ * added reasonable README
3
+ * cleaned up api
4
+ * suppressed rush output
5
+
1
6
  == 0.0.3 / 2008-08-13
2
7
  * renamed from textmate_rush -> rushmate
3
8
 
data/Manifest.txt CHANGED
@@ -4,5 +4,5 @@ README
4
4
  rushmate.gemspec
5
5
  lib/rushmate.rb
6
6
  lib/rushmate/command.rb
7
- lib/rushmate/exits.rb
7
+ lib/rushmate/exit.rb
8
8
  lib/rushmate/textmate_helper.rb
data/README CHANGED
@@ -1,3 +1,33 @@
1
- This is going to be a textmate http://macromates.com to rush http://rush.heroku.com/ bridge.
1
+ = Rushmate
2
2
 
3
- I am going to create a bunch of helpers to access things that would normally be in TM_* variables along with a few other nifty things I have in mind.
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.
@@ -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
- self.shell = Rush::Shell.new
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
@@ -1,5 +1,5 @@
1
1
  module Rushmate
2
- module Exit
2
+ class Exit
3
3
  def discard
4
4
  exit 200
5
5
  end
data/lib/rushmate.rb CHANGED
@@ -3,4 +3,4 @@ require 'rush'
3
3
  require 'rush/shell'
4
4
  require 'rushmate/textmate_helper'
5
5
  require 'rushmate/command'
6
- require 'rushmate/exits'
6
+ require 'rushmate/exit'
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"
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/exits.rb",
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.3
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/exits.rb
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