errship 2.1.3 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.rdoc +13 -0
  2. data/lib/errship.rb +5 -2
  3. metadata +13 -13
@@ -38,6 +38,16 @@ when you want useful debugging output again instead!
38
38
 
39
39
  Alternatively, simply point your browser to /error or /not_found to get a taste.
40
40
 
41
+ == Configuration
42
+
43
+ Errship renders all error pages with a HTTP status of 200 by default. This is
44
+ done to ensure that the error page is rendered if the web server is configured
45
+ to intercept errors (e.g. proxy_intercept_errors for nginx). If you want to
46
+ have the correct status codes for your errors, add the following to an
47
+ initializer:
48
+
49
+ Errship.status_code_success = false
50
+
41
51
  == I18n
42
52
 
43
53
  If you want to edit the text that is rendered, add the following to your config/locales/*.yml
@@ -91,6 +101,9 @@ If Airbrake is installed, every rescuer will report the exception, except for 40
91
101
 
92
102
  == Changelog
93
103
 
104
+ 2.2.0
105
+ - Preserve correct status codes by default (Rescuers no longer force a 200 status)
106
+
94
107
  2.1.3
95
108
  - Conditionally loading rescuers to check for specific loading ORM
96
109
 
@@ -8,6 +8,9 @@ module Errship
8
8
  paths['app/views'] << 'app/views'
9
9
  paths['config/locales'] << 'config/locales'
10
10
  end
11
+
12
+ mattr_accessor :status_code_success
13
+ @@status_code_success = true
11
14
 
12
15
  module Rescuers
13
16
  def self.included(base)
@@ -21,12 +24,12 @@ module Errship
21
24
  def render_error(exception, errship_scope = false)
22
25
  airbrake_class.send(:notify, exception) if airbrake_class
23
26
  render :template => '/errship/standard', :locals => {
24
- :status_code => 500, :errship_scope => errship_scope }
27
+ :status_code => 500, :errship_scope => errship_scope }, :status => (Errship.status_code_success ? 200 : 500)
25
28
  end
26
29
 
27
30
  def render_404_error(exception = nil, errship_scope = false)
28
31
  render :template => '/errship/standard', :locals => {
29
- :status_code => 404, :errship_scope => errship_scope }
32
+ :status_code => 404, :errship_scope => errship_scope }, :status => (Errship.status_code_success ? 200 : 404)
30
33
  end
31
34
 
32
35
  # A blank page with just the layout and flash message, which can be redirected to when
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: errship
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 2.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,12 +11,12 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2011-10-28 00:00:00.000000000 -04:00
14
+ date: 2011-11-02 00:00:00.000000000 -04:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rake
19
- requirement: &21940360 !ruby/object:Gem::Requirement
19
+ requirement: &15152220 !ruby/object:Gem::Requirement
20
20
  none: false
21
21
  requirements:
22
22
  - - ! '>='
@@ -24,10 +24,10 @@ dependencies:
24
24
  version: '0'
25
25
  type: :development
26
26
  prerelease: false
27
- version_requirements: *21940360
27
+ version_requirements: *15152220
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: shoulda
30
- requirement: &21939540 !ruby/object:Gem::Requirement
30
+ requirement: &15151620 !ruby/object:Gem::Requirement
31
31
  none: false
32
32
  requirements:
33
33
  - - ! '>='
@@ -35,10 +35,10 @@ dependencies:
35
35
  version: '0'
36
36
  type: :development
37
37
  prerelease: false
38
- version_requirements: *21939540
38
+ version_requirements: *15151620
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: bundler
41
- requirement: &21938540 !ruby/object:Gem::Requirement
41
+ requirement: &15146020 !ruby/object:Gem::Requirement
42
42
  none: false
43
43
  requirements:
44
44
  - - ~>
@@ -46,10 +46,10 @@ dependencies:
46
46
  version: 1.0.0
47
47
  type: :development
48
48
  prerelease: false
49
- version_requirements: *21938540
49
+ version_requirements: *15146020
50
50
  - !ruby/object:Gem::Dependency
51
51
  name: jeweler
52
- requirement: &21937760 !ruby/object:Gem::Requirement
52
+ requirement: &15145440 !ruby/object:Gem::Requirement
53
53
  none: false
54
54
  requirements:
55
55
  - - ~>
@@ -57,10 +57,10 @@ dependencies:
57
57
  version: 1.6.0
58
58
  type: :development
59
59
  prerelease: false
60
- version_requirements: *21937760
60
+ version_requirements: *15145440
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: rcov
63
- requirement: &21936680 !ruby/object:Gem::Requirement
63
+ requirement: &15144840 !ruby/object:Gem::Requirement
64
64
  none: false
65
65
  requirements:
66
66
  - - ! '>='
@@ -68,7 +68,7 @@ dependencies:
68
68
  version: '0'
69
69
  type: :development
70
70
  prerelease: false
71
- version_requirements: *21936680
71
+ version_requirements: *15144840
72
72
  description: Errship is a Rails 3.1 engine for rendering error pages inside your layout.
73
73
  It supports i18n, custom exceptions, and Airbrake (Hoptoad) error tracking.
74
74
  email:
@@ -108,7 +108,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  segments:
110
110
  - 0
111
- hash: -3781624677601233719
111
+ hash: -593668271471606510
112
112
  required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  none: false
114
114
  requirements: