public
Fork of bmizerany/sinatra
Description: Classy web-development dressed in a DSL
Homepage: http://sinatrarb.com
Clone URL: git://github.com/JackDanger/sinatra.git
merge in env to test methods
Blake Mizerany (author)
Mon Mar 31 18:03:49 -0700 2008
commit  1bcd28fa1340283ae8a4c884a40831b87281f362
tree    890b03fdbd44f2b223ffb63386b33066851d02e8
parent  ed0638480dc5d17d78ea20cf1a9cbe130975f6c1
...
213
214
215
 
 
216
217
218
...
919
920
921
 
 
 
 
922
923
924
...
213
214
215
216
217
218
219
220
...
921
922
923
924
925
926
927
928
929
930
0
@@ -213,6 +213,8 @@ module Sinatra
0
       :buffer_size => 4096
0
     }.freeze
0
 
0
+ class MissingFile < RuntimeError; end
0
+
0
     class FileStreamer
0
       
0
       attr_reader :path, :options
0
@@ -919,6 +921,10 @@ def configures(*envs, &b)
0
 end
0
 alias :configure :configures
0
 
0
+def set_options(opts)
0
+ Sinatra.application.default_options.merge!(opts)
0
+end
0
+
0
 def mime(ext, type)
0
   Rack::File::MIME_TYPES[ext.to_s] = type
0
 end
...
14
15
16
17
 
18
19
20
 
21
22
23
 
24
25
26
 
27
28
29
 
30
31
32
 
33
34
35
 
36
37
38
 
39
40
41
 
42
43
44
 
45
46
47
...
14
15
16
 
17
18
19
 
20
21
22
 
23
24
25
 
26
27
28
 
29
30
31
 
32
33
34
 
35
36
37
 
38
39
40
 
41
42
43
 
44
45
46
47
0
@@ -14,34 +14,34 @@ module Sinatra
0
     
0
     module Methods
0
   
0
- def get_it(path, params = {})
0
+ def get_it(path, params = {}, options = {})
0
         agent = params.delete(:agent)
0
         @request = Rack::MockRequest.new(Sinatra.application)
0
- @response = @request.get(path, :input => params.to_params, :agent => agent)
0
+ @response = @request.get(path, options.merge(:input => params.to_params, :agent => agent))
0
       end
0
 
0
- def head_it(path, params = {})
0
+ def head_it(path, params = {}, options = {})
0
         agent = params.delete(:agent)
0
         @request = Rack::MockRequest.new(Sinatra.application)
0
- @response = @request.request('HEAD', path, :input => params.to_params, :agent => agent)
0
+ @response = @request.request('HEAD', path, options.merge(:input => params.to_params, :agent => agent))
0
       end
0
 
0
- def post_it(path, params = {})
0
+ def post_it(path, params = {}, options = {})
0
         agent = params.delete(:agent)
0
         @request = Rack::MockRequest.new(Sinatra.application)
0
- @response = @request.post(path, :input => params.to_params, :agent => agent)
0
+ @response = @request.post(path, options.merge(:input => params.to_params, :agent => agent))
0
       end
0
 
0
- def put_it(path, params = {})
0
+ def put_it(path, params = {}, options = {})
0
         agent = params.delete(:agent)
0
         @request = Rack::MockRequest.new(Sinatra.application)
0
- @response = @request.put(path, :input => params.to_params, :agent => agent)
0
+ @response = @request.put(path, options.merge(:input => params.to_params, :agent => agent))
0
       end
0
 
0
- def delete_it(path, params = {})
0
+ def delete_it(path, params = {}, options = {})
0
         agent = params.delete(:agent)
0
         @request = Rack::MockRequest.new(Sinatra.application)
0
- @response = @request.delete(path, :input => params.to_params, :agent => agent)
0
+ @response = @request.delete(path, options.merge(:input => params.to_params, :agent => agent))
0
       end
0
       
0
       def follow!

Comments

    No one has commented yet.