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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ba23a7dca25e6bc1c79568d2dd9935c841a2a96
4
- data.tar.gz: 61666e9db53764e450c17028bb672ebaec8dffae
3
+ metadata.gz: fd696857ed8bae4310e491e9b4bb96fb7cd1320d
4
+ data.tar.gz: 1587490e4eef333e4a29e971de0a10ccc97e90e9
5
5
  SHA512:
6
- metadata.gz: 17d96a913fc93f009c4aaae34a07ef05275f449e292a40dee65a4ec04865b062b717f031e36a6b67fd0e33c7947e7111b770e8102d07e6344701e1352116d7e1
7
- data.tar.gz: 12a4029934ea4e05aef6b5ac57771239d2ffba886776298fbbdcb51f2576563eaddc9fab71b987dc96183987bb146dac26a65559468ab044eed8357c196244aa
6
+ metadata.gz: 91b507e9cc2f09f7c2fb263d20548a3215f4476f7e39ec9cd40ec5058656d62a01d98422b31ab674ab48f851e15259497df33d55f1eca875d94476de2eaa0392
7
+ data.tar.gz: a2ff36909bfc38def9c12730ce4e965d39fefb5b98f7a1fd1a9ae2b7130ddee106289126108de313882762e0b85c168c4ccca67602cf14416773cdd3d3811cb1
data/.gitignore CHANGED
@@ -8,3 +8,5 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  .DS_Store
11
+ /bundle/
12
+ /log/
@@ -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) ? exception : HalApi::Errors::ApiError.new
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
@@ -28,5 +28,6 @@ module HalApi::Errors
28
28
 
29
29
  property :status
30
30
  property :message
31
+ property :backtrace, if: -> (*) { Rails.configuration.try(:consider_all_requests_local) }
31
32
  end
32
33
  end
@@ -1,5 +1,5 @@
1
1
  module HalApi
2
2
  module Rails
3
- VERSION = "0.2.7"
3
+ VERSION = "0.2.8"
4
4
  end
5
5
  end
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.7
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-11 00:00:00.000000000 Z
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