tarpaulin 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -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
- # a = eval("determine_context{}", block)
23
- # html_msg = "<!DOCTYPE html><html lang='en'><head><title>&#171; Uh oh &#187;</title><body><span class='error'>Site error (BEEP!) 403: Invalid Path: #{block.call}<br>#{a.inspect}</span></body>"
24
- html_msg = "<!DOCTYPE html><html lang='en'><head><title>&#171; Uh oh &#187;</title><body><span class='error'>Site error (BEEP!) 403: Invalid Path: #{block.call}<br></span></body>"
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>&#171; Uh oh &#187;</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
- # a = eval("determine_context{}", block)
32
- # html_msg = "<!DOCTYPE html><html lang='en'><head><title>&#171; Uh oh &#187;</title><body><span class='error'>Site error (BEEP!) 404: File not found: #{block.call}<br>#{a.inspect}</span></body>"
33
- html_msg = "<!DOCTYPE html><html lang='en'><head><title>&#171; Uh oh &#187;</title><body><span class='error'>Site error (BEEP!) 404: File not found: #{block.call}<br></span></body>"
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>&#171; Uh oh &#187;</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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "tarpaulin"
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Anthony Durity"]
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: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
9
+ - 2
10
+ version: 0.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Anthony Durity