utopia 2.9.3 → 2.9.5
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/lib/utopia/controller/respond.rb +2 -2
- data/lib/utopia/exceptions/mailer.rb +15 -7
- data/lib/utopia/redirection.rb +1 -1
- data/lib/utopia/version.rb +1 -1
- data/spec/utopia/controller/respond_spec.rb +1 -0
- data/utopia.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96bc613a811559da9b85d83e9bf9465874582cf1bc6cb6bca7b8fe93d0768290
|
4
|
+
data.tar.gz: 3e9a80e381f58ee71c455999e1ff6d5600ce2c34c8c2d7cad1742fe9c6bd0f47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 948b833d0e28b70f133127ede3efe3eacde864b4fc8d56ade1aa11f308bce613d3cb7e5c2d4c303dcc06f7740cf39da4933c80758c7ea21029692e1524cb4f66
|
7
|
+
data.tar.gz: d74697bf496eecec19821b678a2aaf47cd886327006a8b5cad94bccdbfb4f62726228009a57d3acf8814234db8ccdcb0918956b22f2effd4499b42fa39a7da5c
|
@@ -64,7 +64,7 @@ module Utopia
|
|
64
64
|
|
65
65
|
# To accept incoming requests with content-type JSON (e.g. POST with JSON data), consider using `Rack::PostBodyContentTypeParser`.
|
66
66
|
module ToJSON
|
67
|
-
APPLICATION_JSON = HTTP::Accept::ContentType.new('application
|
67
|
+
APPLICATION_JSON = HTTP::Accept::ContentType.new('application', 'json', charset: 'utf-8').freeze
|
68
68
|
HEADERS = {HTTP::CONTENT_TYPE => APPLICATION_JSON.to_s}.freeze
|
69
69
|
|
70
70
|
def self.content_type
|
@@ -94,7 +94,7 @@ module Utopia
|
|
94
94
|
end
|
95
95
|
|
96
96
|
module Passthrough
|
97
|
-
WILDCARD = HTTP::Accept::MediaTypes::MediaRange.new('
|
97
|
+
WILDCARD = HTTP::Accept::MediaTypes::MediaRange.new('*', '*').freeze
|
98
98
|
|
99
99
|
def self.split(*args)
|
100
100
|
self.media_range.split(*args)
|
@@ -81,6 +81,20 @@ module Utopia
|
|
81
81
|
:user_agent,
|
82
82
|
]
|
83
83
|
|
84
|
+
def generate_backtrace(io, exception, prefix: "Exception")
|
85
|
+
io.puts "#{prefix} #{exception.class.name}: #{exception.to_s}"
|
86
|
+
|
87
|
+
if exception.respond_to?(:backtrace)
|
88
|
+
io.puts exception.backtrace
|
89
|
+
else
|
90
|
+
io.puts exception.to_s
|
91
|
+
end
|
92
|
+
|
93
|
+
if cause = exception.cause
|
94
|
+
generate_backtrace(io, cause, prefix: "Caused by")
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
84
98
|
def generate_body(exception, env)
|
85
99
|
io = StringIO.new
|
86
100
|
|
@@ -111,13 +125,7 @@ module Utopia
|
|
111
125
|
|
112
126
|
io.puts
|
113
127
|
|
114
|
-
io
|
115
|
-
|
116
|
-
if exception.respond_to?(:backtrace)
|
117
|
-
io.puts exception.backtrace
|
118
|
-
else
|
119
|
-
io.puts exception.to_s
|
120
|
-
end
|
128
|
+
generate_backtrace(io, exception)
|
121
129
|
|
122
130
|
return io.string
|
123
131
|
end
|
data/lib/utopia/redirection.rb
CHANGED
data/lib/utopia/version.rb
CHANGED
data/utopia.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: utopia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.9.
|
4
|
+
version: 2.9.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trenni
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '1
|
103
|
+
version: '2.1'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '1
|
110
|
+
version: '2.1'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: mail
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -792,7 +792,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
792
792
|
- !ruby/object:Gem::Version
|
793
793
|
version: '0'
|
794
794
|
requirements: []
|
795
|
-
rubygems_version: 3.0.
|
795
|
+
rubygems_version: 3.0.4
|
796
796
|
signing_key:
|
797
797
|
specification_version: 4
|
798
798
|
summary: Utopia is a framework for building dynamic content-driven websites.
|