agilibox 1.9.0 → 1.9.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/agilibox/engine.rb +4 -0
- data/lib/agilibox/errors_middleware.rb +37 -0
- data/lib/agilibox/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 13838c6239bbcb5c4638ea7ae6b0c941bb9f534f8d4d0a80d42e7032bc8101f8
|
|
4
|
+
data.tar.gz: 5a5574853314ad1f5eb4cb59da239dab07f42d65adc2226d344e1eacd1687cbb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d9f95ad166c9bb997141683ac6cdd34633d002bf0859e967b0ed2fe9eff090d8b3b994c3f21e5e72843b82cd0aa94ba5ae62a30535b17fa15a3f7f2620c93b65
|
|
7
|
+
data.tar.gz: 26df1371c8c6aa014790618229d63807bfc472662b0b955bcd68e579d17fac805e7668b8d2aac9cab5e58b38b62405582526d1615b96b6cf96d3e0c0525c3836
|
data/CHANGELOG.md
CHANGED
data/lib/agilibox/engine.rb
CHANGED
|
@@ -12,6 +12,10 @@ module Agilibox
|
|
|
12
12
|
Mime::Type.register "application/vnd.ms-excel", :xls
|
|
13
13
|
Mime::Type.register "application/vnd.ms-excel", :xlsx
|
|
14
14
|
end
|
|
15
|
+
|
|
16
|
+
# initializer "agilibox_errors_middleware" do
|
|
17
|
+
# require "agilibox/errors_middleware"
|
|
18
|
+
# end
|
|
15
19
|
end
|
|
16
20
|
end
|
|
17
21
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
class Agilibox::ErrorsMiddleware
|
|
2
|
+
MAINTENANCE_ERRORS = [
|
|
3
|
+
PG::ConnectionBad,
|
|
4
|
+
PG::UnableToSend,
|
|
5
|
+
]
|
|
6
|
+
|
|
7
|
+
NOT_ACCEPTABLE_ERRORS = [
|
|
8
|
+
ActionController::UnknownFormat,
|
|
9
|
+
ActionController::UnknownHttpMethod,
|
|
10
|
+
ActionView::MissingTemplate,
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
def initialize(app)
|
|
14
|
+
@app = app
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def call(env)
|
|
18
|
+
@app.call(env)
|
|
19
|
+
rescue *MAINTENANCE_ERRORS
|
|
20
|
+
respond_with 503, "Maintenance en cours."
|
|
21
|
+
rescue *NOT_ACCEPTABLE_ERRORS
|
|
22
|
+
respond_with 406, "Not acceptable."
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
private
|
|
26
|
+
|
|
27
|
+
def respond_with(status, body)
|
|
28
|
+
[status, {"Content-Type" => "text/plain; charset=UTF-8"}, [body]]
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
stack = Rails.configuration.middleware
|
|
33
|
+
mw = Agilibox::ErrorsMiddleware
|
|
34
|
+
stack.unshift(mw)
|
|
35
|
+
stack.insert_after(ActionDispatch::DebugExceptions, mw) if defined?(ActionDispatch::DebugExceptions)
|
|
36
|
+
stack.insert_after(Bugsnag::Rack, mw) if defined?(Bugsnag::Rack)
|
|
37
|
+
stack.use(mw)
|
data/lib/agilibox/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: agilibox
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.9.
|
|
4
|
+
version: 1.9.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- agilidée
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-11-
|
|
11
|
+
date: 2019-11-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails-i18n
|
|
@@ -217,6 +217,7 @@ files:
|
|
|
217
217
|
- lib/agilibox/cucumber_helpers/zonebie.rb
|
|
218
218
|
- lib/agilibox/engine.rb
|
|
219
219
|
- lib/agilibox/engine_file.rb
|
|
220
|
+
- lib/agilibox/errors_middleware.rb
|
|
220
221
|
- lib/agilibox/form_back_url.rb
|
|
221
222
|
- lib/agilibox/rspec.rb
|
|
222
223
|
- lib/agilibox/test_helpers.rb
|