aldous 1.1.2 → 1.1.3
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad59fe847c225edf9e77a544e8ae38cdfae05843
|
4
|
+
data.tar.gz: 9cdc0da0f0a9bfa0ad03e86ee6b978cc18c84ba9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fbcee0cfd3c357e45a27426c1e210857c7d8744b9dcdb196ea7465cc9954dca8412588456355f7de9f0a1390528c183ee283c4a70354c1e89d977184c019032
|
7
|
+
data.tar.gz: 63a7b7c8b97c949e3fe4a821011d411700bd719f066fca080c85c09052f67c5c5213c9f7590fead023c8c4e0f1e72d3e428d13751015e3d279b5fa14150cb079
|
data/lib/aldous/configuration.rb
CHANGED
@@ -6,11 +6,13 @@ module Aldous
|
|
6
6
|
class Configuration
|
7
7
|
attr_accessor :error_reporter,
|
8
8
|
:logger,
|
9
|
-
:controller_methods_exposed_to_action
|
9
|
+
:controller_methods_exposed_to_action,
|
10
|
+
:error_handler
|
10
11
|
|
11
12
|
def initialize
|
12
13
|
@error_reporter = ::Aldous::DummyErrorReporter
|
13
14
|
@logger = ::Aldous::StdoutLogger
|
15
|
+
@error_handler = nil
|
14
16
|
|
15
17
|
@controller_methods_exposed_to_action = [:params, :session, :cookies, :request, :response]
|
16
18
|
end
|
@@ -21,6 +21,21 @@ module Aldous
|
|
21
21
|
|
22
22
|
def perform
|
23
23
|
respondable.action(controller).execute
|
24
|
+
rescue => e
|
25
|
+
LoggingWrapper.log(e)
|
26
|
+
error_handler = ::Aldous.configuration.error_handler
|
27
|
+
|
28
|
+
if error_handler.kind_of?(Class) && error_handler.ancestors.include?(Aldous::Respondable::Base)
|
29
|
+
view_builder.build(error_handler, errors: [e]).action(controller).execute
|
30
|
+
else
|
31
|
+
controller.head :internal_server_error
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def view_builder
|
38
|
+
@view_builder ||= Aldous::ViewBuilder.new(controller.view_context, default_view_data)
|
24
39
|
end
|
25
40
|
end
|
26
41
|
end
|
data/lib/aldous/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aldous
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alan Skorkin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|