forked from scrooloose/vimfiles
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new version on fuzzyfinder_textmate, added support to run spec …
…files and show results in Firefox, added support to browse Ruby documentation from apidock.com/Ruby, added some new snippets, added plugin tComment
- Loading branch information
1 parent
5cc9fea
commit 85a3c87
Showing
11 changed files
with
896 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
spec_dir=File.dirname(ARGV[0]) | ||
rails_project_dir="#{spec_dir}/../.." | ||
|
||
report_file="#{rails_project_dir}/doc/rspec_report.html" | ||
|
||
rspec_rails_plugin = File.join(rails_project_dir,'vendor','plugins','rspec','lib') | ||
if File.directory?(rspec_rails_plugin) | ||
$LOAD_PATH.unshift(rspec_rails_plugin) | ||
else | ||
require 'rubygems' | ||
require 'spec' | ||
end | ||
require 'rubygems' | ||
require 'spec' | ||
require 'spec/runner/formatter/html_formatter' | ||
|
||
module Spec | ||
module Runner | ||
module Formatter | ||
class HtmlFormatter | ||
def backtrace_line(line) | ||
line.gsub(/([^:]*\.rb):(\d*)/) do | ||
"<a href=\"gedit://#{File.expand_path($1)}?#{$2}\">#{$1}:#{$2}</a> " | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
if File.exists? report_file | ||
File.delete report_file | ||
end | ||
|
||
argv = [ARGV[0]] | ||
argv << "--c" | ||
argv << "--format" | ||
argv << "html:#{report_file}" | ||
|
||
::Spec::Runner::CommandLine.run(::Spec::Runner::OptionParser.parse(argv, STDERR, STDOUT)) | ||
|
||
if File.exists? report_file | ||
`firefox #{report_file}` | ||
end |
Oops, something went wrong.