Skip to content

Commit

Permalink
server: remove use of deprecated sinatra stop command
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardochimal committed Feb 4, 2009
1 parent 6514589 commit 2213588
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/taps/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Server < Sinatra::Base

post '/sessions/:key/:table' do
session = DbSession.filter(:key => params[:key]).first
stop 404 unless session
halt 404 unless session

data = JSON.parse request.body.string

Expand All @@ -44,23 +44,23 @@ class Server < Sinatra::Base

get '/sessions/:key/schema' do
session = DbSession.filter(:key => params[:key]).first
stop 404 unless session
halt 404 unless session

schema_app = File.dirname(__FILE__) + '/../../bin/schema'
`#{schema_app} dump #{session.database_url}`
end

get '/sessions/:key/indexes' do
session = DbSession.filter(:key => params[:key]).first
stop 404 unless session
halt 404 unless session

schema_app = File.dirname(__FILE__) + '/../../bin/schema'
`#{schema_app} indexes #{session.database_url}`
end

get '/sessions/:key/tables' do
session = DbSession.filter(:key => params[:key]).first
stop 404 unless session
halt 404 unless session

db = session.connection
tables = db.tables
Expand All @@ -75,7 +75,7 @@ class Server < Sinatra::Base

get '/sessions/:key/:table/:chunk' do
session = DbSession.filter(:key => params[:key]).first
stop 404 unless session
halt 404 unless session

chunk = params[:chunk].to_i
chunk = 500 if chunk < 1
Expand All @@ -96,7 +96,7 @@ class Server < Sinatra::Base

delete '/sessions/:key' do
session = DbSession.filter(:key => params[:key]).first
stop 404 unless session
halt 404 unless session

session.disconnect
session.destroy
Expand Down

0 comments on commit 2213588

Please sign in to comment.