public
Fork of timcharper/rubyamp
Description: TextMate bundle - Amplified Mate Productivity
Homepage: http://code.leadmediapartners.com/tools/rubyamp
Clone URL: git://github.com/drnic/rubyamp.git
updated borrowed RSpec bundle components (for spec debugger) to latest
timcharper (author)
Wed Mar 19 10:08:29 -0700 2008
commit  c49fdff04c223a6145e4901896ff043222176081
tree    9909a5ca86b98a613eff2ff54aa48ca8d3f58b05
parent  aa782479280d07f1fc87c384ec5514362a9014a2
...
6
7
8
9
 
 
 
10
11
12
13
14
15
16
 
17
...
6
7
8
 
9
10
11
12
13
14
15
16
17
 
18
19
0
@@ -6,12 +6,14 @@ if File.directory?(rspec_rails_plugin)
0
   $LOAD_PATH.unshift(rspec_rails_plugin)
0
 elsif ENV['TM_RSPEC_HOME']
0
   rspec_lib = File.join(ENV['TM_RSPEC_HOME'], 'lib')
0
- raise "TM_RSPEC_HOME points to a bad location: #{ENV['TM_RSPEC_HOME']}" unless File.directory?(rspec_lib)
0
+ unless File.directory?(rspec_lib)
0
+ raise "TM_RSPEC_HOME points to a bad location: #{ENV['TM_RSPEC_HOME']}"
0
+ end
0
   $LOAD_PATH.unshift(rspec_lib)
0
 end
0
 require 'spec'
0
 
0
 $LOAD_PATH.unshift(File.dirname(__FILE__) + '/..')
0
 require 'spec/mate/runner'
0
-# require 'spec/mate/switch_command'
0
+require 'spec/mate/switch_command'
0
 #require 'spec/mate/text_mate_formatter'
...
1
2
3
4
5
6
7
 
 
 
8
9
10
...
19
20
21
22
23
24
25
26
27
28
...
32
33
34
35
 
36
37
38
 
 
 
 
 
 
 
 
 
39
40
41
...
 
 
1
2
3
4
 
5
6
7
8
9
10
...
19
20
21
 
 
 
 
22
23
24
...
28
29
30
 
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
0
@@ -1,10 +1,10 @@
0
-# From rspec-bundle (multiple contributors, see http://rspec.info/community/)
0
-
0
 module Spec
0
   module Mate
0
     class Runner
0
       def run_files(stdout, options={})
0
- files = ENV['TM_SELECTED_FILES'].split(" ").map{|p| p[1..-2]}
0
+ files = ENV['TM_SELECTED_FILES'].split(" ").map do |path|
0
+ File.expand_path(path[1..-2])
0
+ end
0
         options.merge!({:files => files})
0
         run(stdout, options)
0
       end
0
@@ -19,10 +19,6 @@ module Spec
0
         run(stdout, options)
0
       end
0
 
0
- def single_file
0
- ENV['TM_FILEPATH'][ENV['TM_PROJECT_DIRECTORY'].length+1..-1]
0
- end
0
-
0
       def run(stdout, options)
0
         argv = options[:files].dup
0
         argv << '--format'
0
@@ -32,10 +28,19 @@ module Spec
0
           argv << options[:line]
0
         end
0
         argv += ENV['TM_RSPEC_OPTS'].split(" ") if ENV['TM_RSPEC_OPTS']
0
- Dir.chdir(ENV['TM_PROJECT_DIRECTORY']) do
0
+ Dir.chdir(project_directory) do
0
           ::Spec::Runner::CommandLine.run(::Spec::Runner::OptionParser.parse(argv, STDERR, stdout))
0
         end
0
       end
0
+
0
+ protected
0
+ def single_file
0
+ File.expand_path(ENV['TM_FILEPATH'])
0
+ end
0
+
0
+ def project_directory
0
+ File.expand_path(ENV['TM_PROJECT_DIRECTORY'])
0
+ end
0
     end
0
   end
0
 end

Comments

    No one has commented yet.