require 'app/libraries'

module Gemphile
  class App < Sinatra::Base
    register Mustache::Sinatra

    dir = File.dirname(File.expand_path(__FILE__))

    set :public,   "#{dir}/public"
    set :root,     RACK_ROOT
    set :app_file, __FILE__
    set :static,   true

    set :views, "#{dir}/templates"

    set :mustache, {
      :namespace => Object,
      :views     => "#{dir}/views",
      :templates => "#{dir}/templates"
    }

    get '/' do
      mustache :index
    end

    get '/:gem' do
      @gem = params[:gem]
      mustache :gem_info
    end

    post '/push' do
      if repo = Repository.from_payload(params['payload'])
        status(200)
      else
        status(500)
      end
    end
  end
end

require 'app/libraries'

module Gemphile
  class App < Sinatra::Base
    register Mustache::Sinatra

    dir = File.dirname(File.expand_path(__FILE__))

    set :public,   "#{dir}/public"
    set :root,     RACK_ROOT
    set :app_file, __FILE__
    set :static,   true

    set :views, "#{dir}/templates"

    set :mustache, {
      :namespace => Object,
      :views     => "#{dir}/views",
      :templates => "#{dir}/templates"
    }

    get '/' do
      mustache :index
    end

    get '/gems/:gem' do
      @gem = params[:gem]
      mustache :gem_info
    end

    post '/push' do
      if repo = Repository.from_payload(params['payload'])
        status(200)
      else
        status(500)
      end
    end
  end
end

Move gem_info route to /gems/:gem
Move gem_info route to /gems/:gem

This mirrors the rubygems.org routes, and is less limiting with possible
routes in the future.