Browse files

use splat in routes

  • Loading branch information...
1 parent 6d82cac commit c7e8bb39163a767645d0e98182905dbdc3359c2b @jnewland committed Feb 8, 2009
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/rack_rubygems.rb
View
8 lib/rack_rubygems.rb
@@ -66,14 +66,14 @@ class RackRubygems < Sinatra::Base
Gem.deflate(source_index.latest_specs.map { |spec| spec.full_name }.sort.join("\n"))
end
- get "/quick/:selector.gemspec.rz" do
+ get "/quick/*.gemspec.rz" do
content_type 'application/x-deflate'
- Gem.deflate(quick(params[:selector]).to_yaml)
+ Gem.deflate(quick(params[:splat].first).to_yaml)
end
- get "/quick/Marshal.#{Gem.marshal_version}/:selector.gemspec.rz" do
+ get "/quick/Marshal.#{Gem.marshal_version}/*.gemspec.rz" do
content_type 'application/x-deflate'
- Gem.deflate(marshal(quick(params[:selector])))
+ Gem.deflate(marshal(quick(params[:splat].first)))
end
def source_index

0 comments on commit c7e8bb3

Please sign in to comment.