schlueter-rushmate 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.0.6 / 2008-08-14
2
+ * beginning adding hooks for collecting user input
3
+
1
4
  == 0.0.5 / 2008-08-13
2
5
  * removed tm_ from most methods
3
6
 
data/Manifest.txt CHANGED
@@ -5,4 +5,5 @@ rushmate.gemspec
5
5
  lib/rushmate.rb
6
6
  lib/rushmate/command.rb
7
7
  lib/rushmate/exit.rb
8
- lib/rushmate/textmate_helper.rb
8
+ lib/rushmate/textmate_helper.rb
9
+ lib/rushmate/user_input.rb
data/README CHANGED
@@ -25,8 +25,15 @@ Rushmate::Command.new {
25
25
  # if you can't find any files show a tool tip
26
26
  exit.show_tool_tip("can't find #{current_word.downcase}.rb in project")
27
27
  else
28
- # go ahead and switch to the found file(s)
29
- found_files.mate
28
+ if found_files.size == 1
29
+ # if there is only 1 file go ahead and switch to that file
30
+ found_files.mate
31
+ else
32
+ # if there are multiple files prompt the user for which file they want to switch to
33
+ # then switch to their selection
34
+ menu_files = found_files.collect { |f| f.full_path.gsub(project_directory.full_path, "") }
35
+ project_directory[input.select_from_array(menu_files)].mate
36
+ end
30
37
  end
31
38
  }
32
39
 
@@ -18,7 +18,11 @@ module Rushmate
18
18
  end
19
19
 
20
20
  def exit
21
- Rushmate::Exit.new
21
+ Rushmate::Exit
22
+ end
23
+
24
+ def input
25
+ Rushmate::UserInput
22
26
  end
23
27
 
24
28
  private
@@ -26,7 +30,6 @@ module Rushmate
26
30
  self.shell = Rush::Shell.new
27
31
  shell.class.class_eval do
28
32
  def print_result(res)
29
-
30
33
  end
31
34
  end
32
35
  end
data/lib/rushmate/exit.rb CHANGED
@@ -1,42 +1,44 @@
1
1
  module Rushmate
2
- class Exit
3
- def discard
4
- exit 200
5
- end
2
+ module Exit
3
+ class << self
4
+ def discard
5
+ exit 200
6
+ end
6
7
 
7
- def replace_text(out = nil)
8
- print out if out
9
- exit 201
10
- end
8
+ def replace_text(out = nil)
9
+ print out if out
10
+ exit 201
11
+ end
11
12
 
12
- def replace_document(out = nil)
13
- print out if out
14
- exit 202
15
- end
13
+ def replace_document(out = nil)
14
+ print out if out
15
+ exit 202
16
+ end
16
17
 
17
- def insert_text(out = nil)
18
- print out if out
19
- exit 203
20
- end
18
+ def insert_text(out = nil)
19
+ print out if out
20
+ exit 203
21
+ end
21
22
 
22
- def insert_snippet(out = nil)
23
- print out if out
24
- exit 204
25
- end
23
+ def insert_snippet(out = nil)
24
+ print out if out
25
+ exit 204
26
+ end
26
27
 
27
- def show_html(out = nil)
28
- print out if out
29
- exit 205
30
- end
28
+ def show_html(out = nil)
29
+ print out if out
30
+ exit 205
31
+ end
31
32
 
32
- def show_tool_tip(out = nil)
33
- print out if out
34
- exit 206
35
- end
33
+ def show_tool_tip(out = nil)
34
+ print out if out
35
+ exit 206
36
+ end
36
37
 
37
- def create_new_document(out = nil)
38
- print out if out
39
- exit 207
38
+ def create_new_document(out = nil)
39
+ print out if out
40
+ exit 207
41
+ end
40
42
  end
41
43
  end
42
44
  end
@@ -0,0 +1,9 @@
1
+ module Rushmate
2
+ module UserInput
3
+ class << self
4
+ def select_from_array(strings)
5
+ strings[TextMate::UI.menu(strings)]
6
+ end
7
+ end
8
+ end
9
+ end
data/lib/rushmate.rb CHANGED
@@ -1,6 +1,12 @@
1
+ begin
2
+ require ENV['TM_SUPPORT_PATH'] + '/lib/textmate'
3
+ require ENV['TM_SUPPORT_PATH'] + '/lib/ui'
4
+ rescue
5
+ end
1
6
  require 'rubygems'
2
7
  require 'rush'
3
8
  require 'rush/shell'
4
9
  require 'rushmate/textmate_helper'
5
10
  require 'rushmate/command'
6
- require 'rushmate/exit'
11
+ require 'rushmate/exit'
12
+ require 'rushmate/user_input'
data/rushmate.gemspec CHANGED
@@ -1,11 +1,11 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "rushmate"
3
- s.version = "0.0.5"
3
+ s.version = "0.0.6"
4
4
  s.email = "schlueter@gmail.com"
5
5
  s.homepage = "http://github.com/schlueter/rushmate"
6
6
  s.description = "Textmate to Rush bridge"
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
- s.date = %q{2008-08-13}
8
+ s.date = %q{2008-08-14}
9
9
  s.require_paths = ["lib"]
10
10
  s.rubygems_version = %q{1.2.0}
11
11
  s.summary = "Textmate to Rush bridge"
@@ -18,7 +18,8 @@ Gem::Specification.new do |s|
18
18
  "lib/rushmate.rb",
19
19
  "lib/rushmate/command.rb",
20
20
  "lib/rushmate/exit.rb",
21
- "lib/rushmate/textmate_helper.rb"
21
+ "lib/rushmate/textmate_helper.rb",
22
+ "lib/rushmate/user_input.rb"
22
23
  ]
23
24
 
24
25
  s.has_rdoc = true
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.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Schlueter
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-08-13 00:00:00 -07:00
12
+ date: 2008-08-14 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -40,6 +40,7 @@ files:
40
40
  - lib/rushmate/command.rb
41
41
  - lib/rushmate/exit.rb
42
42
  - lib/rushmate/textmate_helper.rb
43
+ - lib/rushmate/user_input.rb
43
44
  has_rdoc: true
44
45
  homepage: http://github.com/schlueter/rushmate
45
46
  post_install_message: