oaf 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/oaf/http/handler.rb +6 -0
- data/lib/oaf/version.rb +1 -1
- data/spec/oaf/http_spec.rb +12 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDdjZDY1YTk1N2I0Yzg4MWRjMDU0NjQyYjRlOWRmZTlmZTgzNjI1ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjVlYTk0ZGJiYjc1NDQ3ZGI3ZWFiODQxMjhkYmQ1MjdmYjI0MmJjZA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZGE5YWRiYmIyZjllYTY5NWE1N2RiZjFkZDBmYjM5MmJmNjBiZWYzMjA5Zjc4
|
10
|
+
NzYyYThkNmUzMmI4OTJhYTY2NmMyYTMyMDZkYjY3MGMxNGFjYzc5ZDIxYTVh
|
11
|
+
ZTJlNTYzMTExNDY3YTk1MmVlMGE2MjdlOWU5NTZlNjg4ZWM1YzI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTk3YWQ0M2E0MzhlOTg2MDk0YWFjZDE1MTI0MjBlZGYwZmMzZDE2ZjdjZTli
|
14
|
+
YjE1NGNkMDY2MmRjMjBlNWQzNmQ0Mzg2YTA5ZGVhZmMzMGYzZjlkMjI5N2Jk
|
15
|
+
Yjg3MmEzNTQ1YjM5N2UxYjVhOWVkMDBiZWY2ZjhiMTIyNDIyMGQ=
|
data/lib/oaf/http/handler.rb
CHANGED
@@ -32,6 +32,12 @@ module Oaf::HTTP
|
|
32
32
|
# DELETE undoubtedly.
|
33
33
|
class Handler < WEBrick::HTTPServlet::AbstractServlet
|
34
34
|
|
35
|
+
# Remove the predefined WEBrick methods. WEBrick comes with some defaults
|
36
|
+
# for GET, POST, OPTIONS, and HEAD, but let's use our own instead.
|
37
|
+
instance_methods.each do |method|
|
38
|
+
undef_method method if method.to_s =~ /^do_[A-Z]+/
|
39
|
+
end
|
40
|
+
|
35
41
|
# Creates a new abstract server object and allows passing in the root
|
36
42
|
# path of the server via an argument.
|
37
43
|
#
|
data/lib/oaf/version.rb
CHANGED
data/spec/oaf/http_spec.rb
CHANGED
@@ -126,5 +126,17 @@ module Oaf
|
|
126
126
|
handler.respond_to?(:nonexistent).should be_false
|
127
127
|
handler.do_PUT(req, res)
|
128
128
|
end
|
129
|
+
|
130
|
+
it "should call our custom methods for built-ins" do
|
131
|
+
req = Oaf::FakeReq.new :path => @f1request
|
132
|
+
res = Oaf::FakeRes.new
|
133
|
+
Oaf::HTTP::Handler.any_instance.stub(:process_request).and_return(true)
|
134
|
+
handler = Oaf::HTTP::Handler.new Oaf::FakeServlet.new, @tempdir1
|
135
|
+
handler.should_receive(:process_request).with(req, res).exactly(4).times
|
136
|
+
handler.do_GET(req, res)
|
137
|
+
handler.do_POST(req, res)
|
138
|
+
handler.do_HEAD(req, res)
|
139
|
+
handler.do_OPTIONS(req, res)
|
140
|
+
end
|
129
141
|
end
|
130
142
|
end
|