slugly 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/slugly/slugly_servlet.rb +11 -10
- metadata +4 -4
@@ -9,20 +9,21 @@ class SluglyServlet < WEBrick::HTTPServlet::AbstractServlet
|
|
9
9
|
|
10
10
|
def do_POST(request, response)
|
11
11
|
response['Content-Type'] = 'text/plain'
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
begin
|
12
|
+
begin
|
13
|
+
if not @providers.has_key?(request.path)
|
14
|
+
response.status = 404
|
15
|
+
response.body = "Unknown Route"
|
16
|
+
else
|
18
17
|
p = @providers[request.path]
|
19
18
|
response.body = @serializer.serialize(p)
|
20
19
|
response.status = 200
|
21
20
|
response['X-Wormly-Version'] = @serializer.version
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
21
|
+
end
|
22
|
+
rescue Exception => e
|
23
|
+
puts e.message
|
24
|
+
puts e.backtrace.inspect
|
25
|
+
response.body = "Internal Server Error"
|
26
|
+
response.status = 500
|
26
27
|
end
|
27
28
|
end
|
28
29
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slugly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alfred Rossi
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-04-
|
18
|
+
date: 2012-04-05 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|