rambulance 2.2.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +43 -26
- data/Appraisals +7 -1
- data/CHANGELOG.md +22 -2
- data/gemfiles/rails_42.gemfile +0 -1
- data/gemfiles/rails_71.gemfile +9 -0
- data/gemfiles/rails_edge.gemfile +1 -1
- data/lib/rambulance/exceptions_app.rb +10 -6
- data/lib/rambulance/version.rb +1 -1
- data/test/exceptions_app_test.rb +0 -1
- data/test/fake_app/rails_app.rb +1 -0
- data/test/requests/error_json_test.rb +20 -14
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6572a6a2e77dbc135e1fb9bb830b6ef43af6e302b7ec0db304577f74a0cef088
|
4
|
+
data.tar.gz: 9f1fc8a6204ef86c00525f4cfb9e71a80285a89e2f7b1b4aa82e6c10b56496b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdd6de274dbe0607bba3a0c63bd24ca733bde12cc1cfde13f7eccc2cfa560d6dee2efca1ff444cd9e6445d9a15ba17234683c7a3ef7c7a957245fd40f80af8ed
|
7
|
+
data.tar.gz: 660ce18b77d8e10a3d042cc34768c802e4069633e966d32f7e240162eddb5a359d1a533e06d78cbaf28e288f92a8b5e2c88055da0b947fc9c4d6bbcf42c0a32a
|
data/.github/workflows/tests.yml
CHANGED
@@ -8,14 +8,14 @@ jobs:
|
|
8
8
|
strategy:
|
9
9
|
matrix:
|
10
10
|
ruby_version:
|
11
|
+
- '3.2'
|
11
12
|
- '3.1'
|
12
13
|
- '3.0'
|
13
14
|
- '2.7'
|
14
15
|
- '2.6'
|
15
16
|
- '2.5'
|
16
|
-
- '
|
17
|
-
- '
|
18
|
-
- 'jruby-9.3.3.0'
|
17
|
+
- 'jruby-9.3'
|
18
|
+
- 'jruby-9.4'
|
19
19
|
gemfile:
|
20
20
|
- gemfiles/rails_70.gemfile
|
21
21
|
- gemfiles/rails_61.gemfile
|
@@ -25,6 +25,18 @@ jobs:
|
|
25
25
|
- gemfiles/rails_50.gemfile
|
26
26
|
- gemfiles/rails_42.gemfile
|
27
27
|
exclude:
|
28
|
+
- ruby_version: '3.2'
|
29
|
+
gemfile: gemfiles/rails_61.gemfile
|
30
|
+
- ruby_version: '3.2'
|
31
|
+
gemfile: gemfiles/rails_60.gemfile
|
32
|
+
- ruby_version: '3.2'
|
33
|
+
gemfile: gemfiles/rails_52.gemfile
|
34
|
+
- ruby_version: '3.2'
|
35
|
+
gemfile: gemfiles/rails_51.gemfile
|
36
|
+
- ruby_version: '3.2'
|
37
|
+
gemfile: gemfiles/rails_50.gemfile
|
38
|
+
- ruby_version: '3.2'
|
39
|
+
gemfile: gemfiles/rails_42.gemfile
|
28
40
|
- ruby_version: '3.1'
|
29
41
|
gemfile: gemfiles/rails_60.gemfile
|
30
42
|
- ruby_version: '3.1'
|
@@ -59,31 +71,29 @@ jobs:
|
|
59
71
|
gemfile: gemfiles/rails_42.gemfile
|
60
72
|
- ruby_version: '2.5'
|
61
73
|
gemfile: gemfiles/rails_70.gemfile
|
62
|
-
- ruby_version: '
|
63
|
-
gemfile: gemfiles/rails_70.gemfile
|
64
|
-
- ruby_version: '2.4'
|
65
|
-
gemfile: gemfiles/rails_61.gemfile
|
66
|
-
- ruby_version: '2.4'
|
67
|
-
gemfile: gemfiles/rails_60.gemfile
|
68
|
-
- ruby_version: '2.3'
|
74
|
+
- ruby_version: 'jruby-9.3'
|
69
75
|
gemfile: gemfiles/rails_70.gemfile
|
70
|
-
- ruby_version: '
|
71
|
-
gemfile: gemfiles/
|
72
|
-
- ruby_version: '
|
76
|
+
- ruby_version: 'jruby-9.3'
|
77
|
+
gemfile: gemfiles/rails_51.gemfile
|
78
|
+
- ruby_version: 'jruby-9.3'
|
79
|
+
gemfile: gemfiles/rails_50.gemfile
|
80
|
+
- ruby_version: 'jruby-9.3'
|
81
|
+
gemfile: gemfiles/rails_42.gemfile
|
82
|
+
- ruby_version: 'jruby-9.4'
|
73
83
|
gemfile: gemfiles/rails_60.gemfile
|
74
|
-
- ruby_version: 'jruby-9.
|
75
|
-
gemfile: gemfiles/
|
76
|
-
- ruby_version: 'jruby-9.
|
84
|
+
- ruby_version: 'jruby-9.4'
|
85
|
+
gemfile: gemfiles/rails_52.gemfile
|
86
|
+
- ruby_version: 'jruby-9.4'
|
77
87
|
gemfile: gemfiles/rails_51.gemfile
|
78
|
-
- ruby_version: 'jruby-9.
|
88
|
+
- ruby_version: 'jruby-9.4'
|
79
89
|
gemfile: gemfiles/rails_50.gemfile
|
80
|
-
- ruby_version: 'jruby-9.
|
90
|
+
- ruby_version: 'jruby-9.4'
|
81
91
|
gemfile: gemfiles/rails_42.gemfile
|
82
|
-
runs-on: ubuntu-
|
92
|
+
runs-on: ubuntu-22.04
|
83
93
|
env:
|
84
94
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
85
95
|
steps:
|
86
|
-
- uses: actions/checkout@
|
96
|
+
- uses: actions/checkout@v3
|
87
97
|
- name: Set up Ruby
|
88
98
|
uses: ruby/setup-ruby@v1
|
89
99
|
with:
|
@@ -92,32 +102,39 @@ jobs:
|
|
92
102
|
- run: bundle exec rake
|
93
103
|
|
94
104
|
rails_edge:
|
95
|
-
|
105
|
+
needs:
|
106
|
+
- stable
|
107
|
+
runs-on: ubuntu-22.04
|
96
108
|
env:
|
97
109
|
BUNDLE_GEMFILE: gemfiles/rails_edge.gemfile
|
98
110
|
steps:
|
99
|
-
- uses: actions/checkout@
|
111
|
+
- uses: actions/checkout@v3
|
100
112
|
- name: Set up Ruby
|
101
113
|
uses: ruby/setup-ruby@v1
|
102
114
|
with:
|
103
|
-
ruby-version: 3.
|
115
|
+
ruby-version: 3.2
|
104
116
|
bundler-cache: true
|
105
117
|
- run: bundle exec rake
|
106
118
|
|
107
119
|
ruby_edge:
|
120
|
+
needs:
|
121
|
+
- stable
|
108
122
|
strategy:
|
109
123
|
matrix:
|
124
|
+
ruby_version:
|
125
|
+
- 'ruby-head'
|
126
|
+
- 'jruby-head'
|
110
127
|
gemfile:
|
111
128
|
- gemfiles/rails_edge.gemfile
|
112
129
|
- gemfiles/rails_70.gemfile
|
113
|
-
runs-on: ubuntu-
|
130
|
+
runs-on: ubuntu-22.04
|
114
131
|
env:
|
115
132
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
116
133
|
steps:
|
117
|
-
- uses: actions/checkout@
|
134
|
+
- uses: actions/checkout@v3
|
118
135
|
- name: Set up Ruby
|
119
136
|
uses: ruby/setup-ruby@v1
|
120
137
|
with:
|
121
|
-
ruby-version:
|
138
|
+
ruby-version: ${{ matrix.ruby_version }}
|
122
139
|
bundler-cache: true
|
123
140
|
- run: bundle exec rake || echo "Ruby edge test is done."
|
data/Appraisals
CHANGED
@@ -43,8 +43,14 @@ appraise "rails_70" do
|
|
43
43
|
gem "railties", "~> 7.0.0"
|
44
44
|
end
|
45
45
|
|
46
|
+
appraise "rails_71" do
|
47
|
+
gem "activesupport", "~> 7.1.0.beta1"
|
48
|
+
gem "actionpack", "~> 7.1.0.beta1"
|
49
|
+
gem "railties", "~> 7.1.0.beta1"
|
50
|
+
end
|
51
|
+
|
46
52
|
appraise "rails_edge" do
|
47
|
-
git '
|
53
|
+
git 'https://github.com/rails/rails.git' do
|
48
54
|
gem "activesupport", require: 'active_support'
|
49
55
|
gem "actionpack", require: 'action_pack'
|
50
56
|
gem "railties"
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,26 @@
|
|
1
|
-
##
|
1
|
+
## v3.0.0
|
2
2
|
|
3
|
-
|
3
|
+
#### New Features
|
4
|
+
|
5
|
+
- Add support for Rails 7.1 (`be6f129d`)
|
6
|
+
|
7
|
+
#### Breaking Changes
|
8
|
+
|
9
|
+
- Drop support for Ruby 2.3 and 2.4 (`c0d3439d`)
|
10
|
+
|
11
|
+
## [v2.3.0](https://github.com/yuki24/rambulance/tree/v2.3.0)
|
12
|
+
|
13
|
+
_<sup>released at 2023-01-05 05:33:36 UTC</sup>_
|
14
|
+
|
15
|
+
#### New Features
|
16
|
+
|
17
|
+
- Ruby 3.2 is now officially supported.
|
18
|
+
|
19
|
+
## [v2.2.0](https://github.com/yuki24/rambulance/tree/v2.2.0)
|
20
|
+
|
21
|
+
_<sup>released at 2022-02-13 07:56:32 UTC</sup>_
|
22
|
+
|
23
|
+
#### Features
|
4
24
|
|
5
25
|
- Add support for Ruby 3.1, Rails 7.0 and JRuby 9.3.3.0
|
6
26
|
|
data/gemfiles/rails_42.gemfile
CHANGED
data/gemfiles/rails_edge.gemfile
CHANGED
@@ -11,12 +11,12 @@ module Rambulance
|
|
11
11
|
|
12
12
|
BAD_REQUEST_ERRORS = [
|
13
13
|
ActionController::BadRequest,
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
# Rails >= 7.1.0
|
15
|
+
defined?(ActionDispatch::Http::MimeNegotiation::InvalidType) ? ActionDispatch::Http::MimeNegotiation::InvalidType : nil,
|
16
|
+
# Rails >= 5.2.0
|
17
|
+
defined?(ActionDispatch::Http::Parameters::ParseError) ? ActionDispatch::Http::Parameters::ParseError : nil,
|
18
|
+
# Rails < 5.2.0
|
19
|
+
defined?(ActionDispatch::ParamsParser::ParseError) ? ActionDispatch::ParamsParser::ParseError : nil
|
20
20
|
].compact.freeze
|
21
21
|
|
22
22
|
class ExceptionsApp < ActionController::Base
|
@@ -89,6 +89,10 @@ module Rambulance
|
|
89
89
|
request.env["MALFORMED_HTTP_ACCEPT"], request.env["HTTP_ACCEPT"] = request.env["HTTP_ACCEPT"], "*/*"
|
90
90
|
end
|
91
91
|
|
92
|
+
if defined?(Rack::RACK_REQUEST_FORM_ERROR) && request.env.include?(Rack::RACK_REQUEST_FORM_ERROR)
|
93
|
+
request.env.delete(Rack::RACK_REQUEST_FORM_ERROR)
|
94
|
+
end
|
95
|
+
|
92
96
|
# The #formats method needs to be called after the sanitization above.
|
93
97
|
request.formats << Mime::Type.lookup('text/plain')
|
94
98
|
|
data/lib/rambulance/version.rb
CHANGED
data/test/exceptions_app_test.rb
CHANGED
data/test/fake_app/rails_app.rb
CHANGED
@@ -4,6 +4,7 @@ require 'jbuilder'
|
|
4
4
|
class TestApp < Rails::Application
|
5
5
|
config.secret_token = '964ab2f0fbbb68bc36f3cc487ca296bb8555fac50627924024c245a1599e5265'
|
6
6
|
config.session_store :cookie_store, :key => '_myapp_session'
|
7
|
+
config.active_support.cache_format_version = 7.1 if Rails::VERSION::STRING >= "7.1"
|
7
8
|
config.active_support.deprecation = :log
|
8
9
|
config.eager_load = false
|
9
10
|
config.root = File.dirname(__FILE__)
|
@@ -2,28 +2,28 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
class ErrorJsonTest < ActionDispatch::IntegrationTest
|
4
4
|
test 'returns the 422 json for ActionController:InvalidAuthenticityToken but without its template' do
|
5
|
-
|
5
|
+
get_json '/users/new'
|
6
6
|
|
7
7
|
assert_equal 422, response.status
|
8
8
|
assert_equal "Something went wrong", json_response['message']
|
9
9
|
end
|
10
10
|
|
11
11
|
test 'returns the 500 json for RuntimeError' do
|
12
|
-
|
12
|
+
get_json '/users/1.json'
|
13
13
|
|
14
14
|
assert_equal 500, response.status
|
15
15
|
assert_equal "Something went wrong", json_response['message']
|
16
16
|
end
|
17
17
|
|
18
18
|
test 'returns the 404 json for CustomException' do
|
19
|
-
|
19
|
+
get_json '/users.json'
|
20
20
|
|
21
21
|
assert_equal 404, response.status
|
22
22
|
assert_equal "Page not found", json_response['message']
|
23
23
|
end
|
24
24
|
|
25
25
|
test 'returns the 404 json for ActinoController::RoutingError' do
|
26
|
-
|
26
|
+
get_json '/doesnt_exist.json'
|
27
27
|
|
28
28
|
assert_equal 404, response.status
|
29
29
|
assert_equal "Page not found", json_response['message']
|
@@ -92,21 +92,27 @@ class ErrorJsonTest < ActionDispatch::IntegrationTest
|
|
92
92
|
private
|
93
93
|
|
94
94
|
def without_layouts
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
95
|
+
if Rails::VERSION::STRING >= '7.1.0'
|
96
|
+
yield
|
97
|
+
else
|
98
|
+
begin
|
99
|
+
`mv test/fake_app/app/views/layouts/application.html.erb .`
|
100
|
+
`mv test/fake_app/app/views/layouts/error.html.erb .`
|
101
|
+
|
102
|
+
yield
|
103
|
+
ensure
|
104
|
+
`mv application.html.erb test/fake_app/app/views/layouts/`
|
105
|
+
`mv error.html.erb test/fake_app/app/views/layouts/`
|
106
|
+
end
|
107
|
+
end
|
102
108
|
end
|
103
109
|
|
104
|
-
def
|
110
|
+
def get_json(path, params: {}, headers: {})
|
105
111
|
without_layouts do
|
106
112
|
if Rails::VERSION::STRING >= '5.1.0'
|
107
|
-
|
113
|
+
get path, params: params, headers: { "CONTENT_TYPE" => "application/json", "HTTP_ACCEPT" => "application/json" }.merge(headers)
|
108
114
|
else
|
109
|
-
|
115
|
+
get path, params, { "CONTENT_TYPE" => "application/json", "HTTP_ACCEPT" => "application/json" }.merge(headers)
|
110
116
|
end
|
111
117
|
end
|
112
118
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rambulance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuki Nishijima
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-09-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -163,6 +163,7 @@ files:
|
|
163
163
|
- gemfiles/rails_60.gemfile
|
164
164
|
- gemfiles/rails_61.gemfile
|
165
165
|
- gemfiles/rails_70.gemfile
|
166
|
+
- gemfiles/rails_71.gemfile
|
166
167
|
- gemfiles/rails_edge.gemfile
|
167
168
|
- lib/generators/rambulance/exceptions_app_generator.rb
|
168
169
|
- lib/generators/rambulance/install_generator.rb
|
@@ -222,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
223
|
- !ruby/object:Gem::Version
|
223
224
|
version: '0'
|
224
225
|
requirements: []
|
225
|
-
rubygems_version: 3.
|
226
|
+
rubygems_version: 3.4.19
|
226
227
|
signing_key:
|
227
228
|
specification_version: 4
|
228
229
|
summary: Simple and safe way to dynamically generate error pages
|