diff options
author | Jochen Topf <jochen@topf.org> | 2010-11-09 17:29:32 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2010-11-09 17:29:32 +0100 |
commit | c72f198879f6ca29ea1fe992fff6988900b1ed63 (patch) | |
tree | b7df96c8939eadee75e944a26b0e4f74a0ef1401 /web/taginfo.rb | |
parent | 9e5c1e0f8918b1c8a834bb45a55f879da17e24b2 (diff) | |
download | taginfo-c72f198879f6ca29ea1fe992fff6988900b1ed63.tar taginfo-c72f198879f6ca29ea1fe992fff6988900b1ed63.tar.gz |
cleanup, fixed bug where urls of the form '/keys/?key=foo' didn't work
Diffstat (limited to 'web/taginfo.rb')
-rwxr-xr-x | web/taginfo.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/web/taginfo.rb b/web/taginfo.rb index 8ddcfb6..67f5607 100755 --- a/web/taginfo.rb +++ b/web/taginfo.rb @@ -109,15 +109,15 @@ class Taginfo < Sinatra::Base erb :'sources/index' end - get! '/keys' do + get '/keys' do @title = 'Keys' @breadcrumbs << ['Keys'] erb :keys end - get %r{^/keys/(.*)} do + get %r{^/keys/(.*)} do |key| if params[:key].nil? - @key = params[:captures][0] + @key = key else @key = params[:key] end @@ -167,11 +167,11 @@ class Taginfo < Sinatra::Base erb :key end - get %r{^/tags/(.*)} do - if params[:captures].first.match(/=/) - kv = params[:captures].first.split('=', 2) + get %r{^/tags/(.*)} do |tag| + if tag.match(/=/) + kv = tag.split('=', 2) else - kv = [ params[:captures].first, '' ] + kv = [ tag, '' ] end if params[:key].nil? @key = kv[0] |