tarpaulin 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/tarpaulin/camping.rb +16 -8
- data/tarpaulin.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
data/lib/tarpaulin/camping.rb
CHANGED
@@ -16,21 +16,29 @@ module Tarpaulin
|
|
16
16
|
@@link
|
17
17
|
end
|
18
18
|
|
19
|
-
def r403(&block)
|
19
|
+
def r403(f=nil, &block)
|
20
20
|
#$stderr.puts "in 403"
|
21
21
|
h = {'Content-Type' => 'text/html; charset=utf-8'}
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
a = eval("determine_context{}", block)
|
23
|
+
if f.nil?
|
24
|
+
f = block.call
|
25
|
+
end
|
26
|
+
html_msg = "<!DOCTYPE html><html lang='en'><head>"+
|
27
|
+
"<title>« Uh oh »</title><body><span class='error'>"+
|
28
|
+
"Site error (BEEP!) 403: Invalid Path: #{f}<br>#{a.inspect}</span></body>"
|
25
29
|
r(403, html_msg, h)
|
26
30
|
end
|
27
31
|
|
28
|
-
def r404(&block)
|
32
|
+
def r404(f=nil, &block) # compat with Camping
|
29
33
|
#$stderr.puts "in 404"
|
30
34
|
h = {'Content-Type' => 'text/html; charset=utf-8'}
|
31
|
-
|
32
|
-
|
33
|
-
|
35
|
+
a = eval("determine_context{}", block)
|
36
|
+
if f.nil?
|
37
|
+
f = block.call
|
38
|
+
end
|
39
|
+
html_msg = "<!DOCTYPE html><html lang='en'><head>"+
|
40
|
+
"<title>« Uh oh »</title><body><span class='error'>"+
|
41
|
+
"Site error (BEEP!) 404: File not found: #{f}<br>#{a.inspect}</span></body>"
|
34
42
|
r(404, html_msg, h)
|
35
43
|
end
|
36
44
|
|
data/tarpaulin.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tarpaulin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Anthony Durity
|