rambulance 2.3.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 +0 -14
- data/Appraisals +6 -0
- data/CHANGELOG.md +22 -2
- data/gemfiles/rails_71.gemfile +9 -0
- 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
@@ -14,8 +14,6 @@ jobs:
|
|
14
14
|
- '2.7'
|
15
15
|
- '2.6'
|
16
16
|
- '2.5'
|
17
|
-
- '2.4'
|
18
|
-
- '2.3'
|
19
17
|
- 'jruby-9.3'
|
20
18
|
- 'jruby-9.4'
|
21
19
|
gemfile:
|
@@ -73,18 +71,6 @@ jobs:
|
|
73
71
|
gemfile: gemfiles/rails_42.gemfile
|
74
72
|
- ruby_version: '2.5'
|
75
73
|
gemfile: gemfiles/rails_70.gemfile
|
76
|
-
- ruby_version: '2.4'
|
77
|
-
gemfile: gemfiles/rails_70.gemfile
|
78
|
-
- ruby_version: '2.4'
|
79
|
-
gemfile: gemfiles/rails_61.gemfile
|
80
|
-
- ruby_version: '2.4'
|
81
|
-
gemfile: gemfiles/rails_60.gemfile
|
82
|
-
- ruby_version: '2.3'
|
83
|
-
gemfile: gemfiles/rails_70.gemfile
|
84
|
-
- ruby_version: '2.3'
|
85
|
-
gemfile: gemfiles/rails_61.gemfile
|
86
|
-
- ruby_version: '2.3'
|
87
|
-
gemfile: gemfiles/rails_60.gemfile
|
88
74
|
- ruby_version: 'jruby-9.3'
|
89
75
|
gemfile: gemfiles/rails_70.gemfile
|
90
76
|
- ruby_version: 'jruby-9.3'
|
data/Appraisals
CHANGED
@@ -43,6 +43,12 @@ 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
53
|
git 'https://github.com/rails/rails.git' do
|
48
54
|
gem "activesupport", require: 'active_support'
|
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
|
|
@@ -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: 2023-
|
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
|