Skip to content

Instantly share code, notes, and snippets.

@NigelThorne
Created June 5, 2009 07:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NigelThorne/124120 to your computer and use it in GitHub Desktop.
Save NigelThorne/124120 to your computer and use it in GitHub Desktop.
#\ -w -p 8765
use Rack::Reloader, 0
use Rack::ContentLength
use Rack::ShowExceptions
map "/cuce" do |path|
run Proc.new{
command = "cucumber.bat features/nav.feature -f html"
out = `#{command} 2>&1`
[ 200, {'Content-Type' => out=~/\<html/ ? 'text/html' : 'text/plain'}, out ]
}
end
map "/spec" do
map "/html" do
@formatting = '-f h'
run Proc.new{
command = "spec.bat spec #{@formatting}"
out = `#{command} 2>&1`
[ 200, {'Content-Type' => out=~/\<html/ ? 'text/html' : 'text/plain'}, out ]
}
end
map "/textmate" do
@formatting = '--require "C:\\Documents and Settings\\nwt\\Application Data\\e\\InstalledBundles\\Ruby RSpec.tmbundle\\Support\\lib\\text_mate_formatter" -f Spec::Runner::Formatter::TextMateFormatter'
run Proc.new{
command = "spec.bat spec #{@formatting}"
out = `#{command} 2>&1`
[ 200, {'Content-Type' => out=~/\<html/ ? 'text/html' : 'text/plain'}, out ]
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment