api-blocks 0.4.9 → 0.4.10

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
  SHA256:
3
- metadata.gz: 2dea3e596004c800c53442f9b661546e8dfb2f2af67a2cf805672f5ef9f81f43
4
- data.tar.gz: 5c95339dd088abedb4f3672ad3c7fc1910bc26b0157c24a7fdc9861b4388877c
3
+ metadata.gz: 843bea891fd702377450792011768058f8a43285f736e9cb0bad420c58045e09
4
+ data.tar.gz: cd35fa0fe8ccd051c56305104c93947197b398967d755d6272d55a060e053de5
5
5
  SHA512:
6
- metadata.gz: b9ce32a78de8adbc86a69b72c53798b557b212ed944aaf3e4ec317aa8dbaeca27b9eee8df496fc011590b737ef50893a934220bc81b5e917a2eb250009de94ee
7
- data.tar.gz: 04d1a032af42148f4d11901855aef1b4931cc960c47a9e4705e8bd6cd2fb454a07e7243d940b66077450aa69a732992b52e03704cfebfaaeeab5d987e9e174ca
6
+ metadata.gz: e292eb8cf9aa670003e623bcb92b23b210bd0b47278852a9bc8b515ba8bb9253da180c4f53ecaf9f36d3e3b9a0e9a4bfd7b3fe2ba69f15f0e75660e8597c871b
7
+ data.tar.gz: 7a448439cd7c1c9839fcd5b4cbd0206a313c76a0842363d0b23fdc6372d95bb2b0bd48eafba18054d477aa60f7d663eb8019850c24b22c4bc83b2156c1c0c13d
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'action_controller/responder'
4
- require 'responders'
5
- require 'dry/monads/result'
6
- require 'dry/validation/result'
3
+ require "action_controller/responder"
4
+ require "responders"
5
+ require "dry/monads/result"
6
+ require "dry/validation/result"
7
7
 
8
8
  # ApiBlocks::Responder provides a responder with better error handling and
9
9
  # `ApiBlocks::Interactor` through `Dry::Monads::Result` support.
@@ -20,6 +20,10 @@ class ApiBlocks::Responder < ActionController::Responder
20
20
  [{ errors: resource.errors.to_h }, :unprocessable_entity]
21
21
  when ActiveRecord::RecordInvalid
22
22
  [{ errors: resource.record.errors }, :unprocessable_entity]
23
+ when String
24
+ [{ detail: resource }, :internal_server_error]
25
+ when ProblemDetails::Document
26
+ [resource.to_h, resource.status]
23
27
  when StandardError
24
28
  # propagate the error so it can be handled through the standard rails
25
29
  # error handlers.
@@ -2,5 +2,5 @@
2
2
 
3
3
  module ApiBlocks
4
4
  # Current version of ApiBlocks
5
- VERSION = '0.4.9'
5
+ VERSION = "0.4.10"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api-blocks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.4.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul d'Hubert
@@ -212,14 +212,14 @@ dependencies:
212
212
  requirements:
213
213
  - - '='
214
214
  - !ruby/object:Gem::Version
215
- version: 0.76.0
215
+ version: 0.77.0
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - '='
221
221
  - !ruby/object:Gem::Version
222
- version: 0.76.0
222
+ version: 0.77.0
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: yard
225
225
  requirement: !ruby/object:Gem::Requirement