schneiderlein 2.0.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84a22865dddabc726bf48ea79e25f6607618c3851cfb8019287ef23b6d7f5800
4
- data.tar.gz: fe95f8c23fb039527e2d78fd68e9d93c288f90c2b5519a50d780198f0cba98f5
3
+ metadata.gz: 7b5e95d7cafb3643022c7cc317c4320d45365c7d231bee21c6cf6b5b93784afa
4
+ data.tar.gz: 4797c2da7ad4d53fe236783efd559c757bf2d0c0e52c4e28634743a12779d4ae
5
5
  SHA512:
6
- metadata.gz: 484e27b5c2b0e17e40ee76d0f3fc3d6dbd8f0a724b424c1318fcd295637469e8d1e88660987f76de4b6f7e5f9eb316dec62873549f311b54d653070afe72fcab
7
- data.tar.gz: 7bcefc35543ba07afcc8fa258f73ebc39758616a621fea089d2168d7ef4a9a4fa75495e85622740cddc73d7279bf7226ade36e685f8b0089dcf83d1b5a443d4b
6
+ metadata.gz: b493d3462991010d6f90259012d355c0c9496c8502bbae1ba61571d0ebede9cb949fbf6fd1db3319155ffe4e6215268cf2e2a1612d02409acab6319c2064bfc1
7
+ data.tar.gz: 9d7b0d23e58d03d4975c3661d1924ec2d1f7da700930764226e410ad8d587ebbeb54078dcb72cc699fd152898d1b2a753343a1ee918793d6607db0f9b36fa95d
data/README.md CHANGED
@@ -1,6 +1,5 @@
1
1
  # Schneiderlein
2
- [![Code Climate](https://codeclimate.com/github/Absolventa/schneiderlein/badges/gpa.svg)](https://codeclimate.com/github/Absolventa/schneiderlein)
3
- [![Build Status](https://travis-ci.org/Absolventa/schneiderlein.svg?branch=master)](https://travis-ci.org/Absolventa/schneiderlein)
2
+ ![Build Status](https://github.com/absolventa/schneiderlein/actions/workflows/ci.yml/badge.svg)
4
3
  [![Gem Version](https://badge.fury.io/rb/schneiderlein.svg)](http://badge.fury.io/rb/schneiderlein)
5
4
 
6
5
  **Schneiderlein** is a Rack middleware to catch parse errors coming from [ActionDispatch::ParamsParser](https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/middleware/params_parser.rb). Malformed XML presents a 500 Internal Server Error to your API consumer. It's hardly meaningful, should instead be in the 4xx range and most importantly: it's not helping.
@@ -33,6 +32,16 @@ The name **Schneiderlein** is derived from the fairytale »Das Tapfere Schneider
33
32
 
34
33
  ## Changelog
35
34
 
35
+ ### 4.0.0
36
+ * Drop support for Rails below 6.1
37
+ * Drop support for Ruby below 3.0
38
+ * Add support for Rails 7.+
39
+ * Switch from Travis CI to GitHub Actions
40
+
41
+ ### 3.0.0
42
+ * Drop support for Rails below 5.2
43
+ * Add support for Rails 6.+
44
+
36
45
  ### 2.0.0
37
46
  * Drop support for Rails below 5.0
38
47
  * Add support for Rails 5.1+
@@ -0,0 +1,3 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../javascripts .js
3
+ //= link_directory ../stylesheets .css
@@ -1,4 +1,3 @@
1
- # frozen_string_literal: true
2
1
  module Schneiderlein
3
2
  class Catch
4
3
  delegate :any?, :empty?, to: :errors
@@ -16,7 +15,7 @@ module Schneiderlein
16
15
  alias errors to_a
17
16
 
18
17
  def to_s
19
- to_a.map do |exc|
18
+ to_a.dup.map do |exc|
20
19
  ExtractREXMLErrorMessage.new(exc).to_s
21
20
  end.join(' ')
22
21
  end
@@ -1,19 +1,15 @@
1
- # frozen_string_literal: true
2
1
  module Schneiderlein
3
2
  class Engine < ::Rails::Engine
4
3
  isolate_namespace Schneiderlein
5
4
 
6
5
  initializer 'schneiderlein.middleware' do |app|
7
6
  if Rails::VERSION::MAJOR < 5
8
- app.config.middleware.insert_before \
9
- 'ActionDispatch::ParamsParser', 'Schneiderlein::FlyCatcher'
7
+ app.config.middleware.insert_before 'ActionDispatch::ParamsParser', 'Schneiderlein::FlyCatcher'
10
8
  else
11
9
  # ActionDispatch::ParamsParser is not included in the middleware
12
10
  # stack anymore in Rails 5.
13
- app.config.middleware.insert_after \
14
- ActionDispatch::Callbacks, Schneiderlein::FlyCatcher
11
+ app.config.middleware.insert_after ActionDispatch::Callbacks, Schneiderlein::FlyCatcher
15
12
  end
16
13
  end
17
14
  end
18
-
19
15
  end
@@ -1,4 +1,3 @@
1
- # frozen_string_literal: true
2
1
  module Schneiderlein
3
2
  class ExtractREXMLErrorMessage < Struct.new(:exception)
4
3
 
@@ -9,7 +8,10 @@ module Schneiderlein
9
8
  private
10
9
 
11
10
  def sanitizer(str)
12
- str.to_s.gsub!('#<REXML::ParseException: ', '').to_s[0..str.to_s.index('Last').to_i-2]
11
+ string = str.to_s.dup
12
+ string = string.gsub('#<REXML::ParseException: ', '')
13
+ string = string.to_s[0..string.to_s.index('Last').to_i-2]
14
+ string
13
15
  end
14
16
 
15
17
  end
@@ -1,4 +1,3 @@
1
- # frozen_string_literal: true
2
1
  module Schneiderlein
3
2
  class FlyCatcher < Struct.new(:app)
4
3
 
@@ -1,4 +1,3 @@
1
- # frozen_string_literal: true
2
1
  module Schneiderlein
3
- VERSION = '2.0.0'
2
+ VERSION = '4.0.0'
4
3
  end
data/lib/schneiderlein.rb CHANGED
@@ -1,4 +1,3 @@
1
- # frozen_string_literal: true
2
1
  require "schneiderlein/engine"
3
2
  require "schneiderlein/fly_catcher"
4
3
  require "schneiderlein/catch"
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schneiderlein
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Zimmermann
8
8
  - Robin Neumann
9
- autorequire:
9
+ - Daniel Schoppmann
10
+ autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2018-03-13 00:00:00.000000000 Z
13
+ date: 2022-09-23 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: rails
@@ -17,20 +18,20 @@ dependencies:
17
18
  requirements:
18
19
  - - ">="
19
20
  - !ruby/object:Gem::Version
20
- version: 5.0.0
21
+ version: 6.0.0
21
22
  - - "<"
22
23
  - !ruby/object:Gem::Version
23
- version: '6.0'
24
+ version: '8.0'
24
25
  type: :runtime
25
26
  prerelease: false
26
27
  version_requirements: !ruby/object:Gem::Requirement
27
28
  requirements:
28
29
  - - ">="
29
30
  - !ruby/object:Gem::Version
30
- version: 5.0.0
31
+ version: 6.0.0
31
32
  - - "<"
32
33
  - !ruby/object:Gem::Version
33
- version: '6.0'
34
+ version: '8.0'
34
35
  - !ruby/object:Gem::Dependency
35
36
  name: appraisal
36
37
  requirement: !ruby/object:Gem::Requirement
@@ -65,19 +66,20 @@ dependencies:
65
66
  requirements:
66
67
  - - "~>"
67
68
  - !ruby/object:Gem::Version
68
- version: 3.5.0
69
+ version: 5.1.2
69
70
  type: :development
70
71
  prerelease: false
71
72
  version_requirements: !ruby/object:Gem::Requirement
72
73
  requirements:
73
74
  - - "~>"
74
75
  - !ruby/object:Gem::Version
75
- version: 3.5.0
76
+ version: 5.1.2
76
77
  description: Rescues from ActionDispatch::ParamsParser and continues in middleware
77
78
  stack
78
79
  email:
79
80
  - cz@aegisnet.de
80
81
  - robin.neumann@absolventa.de
82
+ - daniel.schoppmann@gmail.com
81
83
  executables: []
82
84
  extensions: []
83
85
  extra_rdoc_files: []
@@ -85,6 +87,7 @@ files:
85
87
  - MIT-LICENSE
86
88
  - README.md
87
89
  - Rakefile
90
+ - app/assets/config/schneiderlein_manifest.js
88
91
  - app/assets/stylesheets/schneiderlein/application.css
89
92
  - app/controllers/schneiderlein/application_controller.rb
90
93
  - app/helpers/schneiderlein/application_helper.rb
@@ -100,7 +103,7 @@ homepage: https://github.com/Absolventa/schneiderlein
100
103
  licenses:
101
104
  - MIT
102
105
  metadata: {}
103
- post_install_message:
106
+ post_install_message:
104
107
  rdoc_options: []
105
108
  require_paths:
106
109
  - lib
@@ -108,16 +111,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
111
  requirements:
109
112
  - - ">="
110
113
  - !ruby/object:Gem::Version
111
- version: 2.2.2
114
+ version: 3.0.0
112
115
  required_rubygems_version: !ruby/object:Gem::Requirement
113
116
  requirements:
114
117
  - - ">="
115
118
  - !ruby/object:Gem::Version
116
119
  version: '0'
117
120
  requirements: []
118
- rubyforge_project:
119
- rubygems_version: 2.7.3
120
- signing_key:
121
+ rubygems_version: 3.3.7
122
+ signing_key:
121
123
  specification_version: 4
122
124
  summary: Rack middleware that rescues from ActionDispatch::ParamsParser
123
125
  test_files: []