Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 27 lines (18 sloc) 0.539 kb
0648367 @Sutto Add app code from live server
authored
1 require 'rubygems'
2 require 'sinatra'
3
4 COMPETITION_DOMAIN = "r09.railsrumble.com"
5
6 set :environment, ENV['RACK_ENV']
7
8 helpers do
9
10 def convert_query(path)
11 p = [*path].join("/").split("/")
12 URI.escape(p.map { |t| t.gsub(/[\+\-]+/, " ").gsub(/[\?\#\&]+/, ' ') }.join(" ").strip)
13 end
14
15 end
16
17 get '/g/:team_name' do
18 redirect "http://#{COMPETITION_DOMAIN}/teams/#{params[:team_name]}"
19 end
20
21 get '*' do
22 path = convert_query(params[:splat])
23 redirect "http://#{COMPETITION_DOMAIN}/teams/search?q=#{path}"
24 end
25
26 run Sinatra::Application
Something went wrong with that request. Please try again.