mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-01-12 22:51:50 +08:00
Updated to Sinatra 1.4.0 HEAD to pick up fixes for setting status code when
using send_file and logging output.
This commit is contained in:
4
Gemfile
4
Gemfile
@@ -2,5 +2,5 @@ source "http://rubygems.org"
|
||||
|
||||
gem "rake", "~> 0.9.0"
|
||||
gem "bundler", "~> 1.1.0"
|
||||
gem "sinatra", "~> 1.3.0"
|
||||
gem "thin", "~> 1.3.0"
|
||||
gem "sinatra", :git => "git://github.com/sinatra/sinatra.git"
|
||||
gem "thin", "~> 1.3.1"
|
||||
|
||||
17
Gemfile.lock
17
Gemfile.lock
@@ -1,3 +1,12 @@
|
||||
GIT
|
||||
remote: git://github.com/sinatra/sinatra.git
|
||||
revision: 0bf6b92cedd86df89068b3c0b1b0f58ad28287eb
|
||||
specs:
|
||||
sinatra (1.4.0)
|
||||
rack (~> 1.3, >= 1.3.6)
|
||||
rack-protection (~> 1.2)
|
||||
tilt (~> 1.3, >= 1.3.3)
|
||||
|
||||
GEM
|
||||
remote: http://rubygems.org/
|
||||
specs:
|
||||
@@ -7,10 +16,6 @@ GEM
|
||||
rack-protection (1.2.0)
|
||||
rack
|
||||
rake (0.9.2.2)
|
||||
sinatra (1.3.2)
|
||||
rack (~> 1.3, >= 1.3.6)
|
||||
rack-protection (~> 1.2)
|
||||
tilt (~> 1.3, >= 1.3.3)
|
||||
thin (1.3.1)
|
||||
daemons (>= 1.0.9)
|
||||
eventmachine (>= 0.12.6)
|
||||
@@ -23,5 +28,5 @@ PLATFORMS
|
||||
DEPENDENCIES
|
||||
bundler (~> 1.1.0)
|
||||
rake (~> 0.9.0)
|
||||
sinatra (~> 1.3.0)
|
||||
thin (~> 1.3.0)
|
||||
sinatra!
|
||||
thin (~> 1.3.1)
|
||||
|
||||
@@ -35,12 +35,15 @@ class RestKitTestServer < Sinatra::Base
|
||||
use RestKit::CoreData::Cache
|
||||
|
||||
configure do
|
||||
set :logging, true
|
||||
set :dump_errors, true
|
||||
enable :logging, :dump_errors
|
||||
set :public_folder, Proc.new { File.expand_path(File.join(root, '../Fixtures')) }
|
||||
set :uploads_path, Proc.new { File.expand_path(File.join(root, '../Fixtures/Uploads')) }
|
||||
end
|
||||
|
||||
def render_fixture(path, options = {})
|
||||
send_file File.join(settings.public_folder, path), options
|
||||
end
|
||||
|
||||
get '/' do
|
||||
content_type 'application/json'
|
||||
{'status' => 'ok'}.to_json
|
||||
@@ -52,9 +55,8 @@ class RestKitTestServer < Sinatra::Base
|
||||
end
|
||||
|
||||
get '/errors.json' do
|
||||
status 400
|
||||
content_type 'application/json'
|
||||
send_file settings.public_folder + '/JSON/errors.json'
|
||||
render_fixture('/JSON/errors.json', :status => 400)
|
||||
end
|
||||
|
||||
post '/humans' do
|
||||
@@ -65,9 +67,8 @@ class RestKitTestServer < Sinatra::Base
|
||||
end
|
||||
|
||||
post '/humans/fail' do
|
||||
status 500
|
||||
content_type 'application/json'
|
||||
send_file settings.public_folder + '/JSON/errors.json'
|
||||
render_fixture('/JSON/errors.json', :status => 500)
|
||||
end
|
||||
|
||||
get '/humans/1' do
|
||||
@@ -175,9 +176,8 @@ class RestKitTestServer < Sinatra::Base
|
||||
end
|
||||
|
||||
get '/fail' do
|
||||
status 500
|
||||
content_type 'application/json'
|
||||
send_file settings.public_folder + '/JSON/errors.json'
|
||||
render_fixture('/JSON/errors.json', :status => 500)
|
||||
end
|
||||
|
||||
# Expects an uploaded 'file' param
|
||||
|
||||
Reference in New Issue
Block a user