hal_api-rails 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/hal_api-rails.gemspec +2 -0
- data/lib/hal_api/controller/exceptions.rb +9 -1
- data/lib/hal_api/errors.rb +1 -0
- data/lib/hal_api/rails/version.rb +1 -1
- metadata +30 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd696857ed8bae4310e491e9b4bb96fb7cd1320d
|
4
|
+
data.tar.gz: 1587490e4eef333e4a29e971de0a10ccc97e90e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91b507e9cc2f09f7c2fb263d20548a3215f4476f7e39ec9cd40ec5058656d62a01d98422b31ab674ab48f851e15259497df33d55f1eca875d94476de2eaa0392
|
7
|
+
data.tar.gz: a2ff36909bfc38def9c12730ce4e965d39fefb5b98f7a1fd1a9ae2b7130ddee106289126108de313882762e0b85c168c4ccca67602cf14416773cdd3d3811cb1
|
data/.gitignore
CHANGED
data/hal_api-rails.gemspec
CHANGED
@@ -29,6 +29,8 @@ Gem::Specification.new do |spec|
|
|
29
29
|
|
30
30
|
spec.add_development_dependency "bundler"
|
31
31
|
spec.add_development_dependency "rake", "~> 10.0"
|
32
|
+
spec.add_development_dependency "rails", "~> 4.2.1"
|
33
|
+
spec.add_development_dependency "pry-byebug"
|
32
34
|
spec.add_development_dependency "minitest"
|
33
35
|
spec.add_development_dependency "kaminari"
|
34
36
|
end
|
@@ -8,10 +8,18 @@ module HalApi::Controller::Exceptions
|
|
8
8
|
wrapper = ::ActionDispatch::ExceptionWrapper.new(env, exception)
|
9
9
|
log_error(env, wrapper)
|
10
10
|
|
11
|
-
error = exception.is_a?(HalApi::Errors::ApiError)
|
11
|
+
error = if exception.is_a?(HalApi::Errors::ApiError)
|
12
|
+
exception
|
13
|
+
else
|
14
|
+
e = HalApi::Errors::ApiError.new(exception.message)
|
15
|
+
e.set_backtrace(exception.backtrace)
|
16
|
+
e
|
17
|
+
end
|
18
|
+
|
12
19
|
respond_with(
|
13
20
|
error,
|
14
21
|
status: error.status,
|
22
|
+
location: nil, # for POST requests
|
15
23
|
represent_with: HalApi::Errors::Representer
|
16
24
|
)
|
17
25
|
end
|
data/lib/hal_api/errors.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hal_api-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Rhoden
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-07-
|
12
|
+
date: 2016-07-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
@@ -137,6 +137,34 @@ dependencies:
|
|
137
137
|
- - "~>"
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: '10.0'
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
name: rails
|
142
|
+
requirement: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - "~>"
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: 4.2.1
|
147
|
+
type: :development
|
148
|
+
prerelease: false
|
149
|
+
version_requirements: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - "~>"
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: 4.2.1
|
154
|
+
- !ruby/object:Gem::Dependency
|
155
|
+
name: pry-byebug
|
156
|
+
requirement: !ruby/object:Gem::Requirement
|
157
|
+
requirements:
|
158
|
+
- - ">="
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '0'
|
161
|
+
type: :development
|
162
|
+
prerelease: false
|
163
|
+
version_requirements: !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
165
|
+
- - ">="
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: '0'
|
140
168
|
- !ruby/object:Gem::Dependency
|
141
169
|
name: minitest
|
142
170
|
requirement: !ruby/object:Gem::Requirement
|