coaster 1.3.26 → 1.3.27

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: '0508a1aac1a7bd5b88db6d62d5a928a870f5a34763fcf6e578390fd0b8b2a0e9'
4
- data.tar.gz: ede4991485b4ca7e1df33b31087ece02ba6aa614e36d007f6c7331b31d91c166
3
+ metadata.gz: 2f6845ad78b984bcd3b7e731c99f301cbb9cf988d2252450b0e961af3de2f630
4
+ data.tar.gz: 00be20732649e4a1176873079b6d23a25bc0e2ead9b204fb7cc2da4ca2862219
5
5
  SHA512:
6
- metadata.gz: fa917d7790fa7beda1a4d7a70d188a606af266bdd26c72703af5e598a50cf74db8498835d5c4c9fc8b1f574f9ec5a2af3bdd98ee5553efa63b8b078442503091
7
- data.tar.gz: 7e694dda54a52511f5e1c83b61d7396b33b89bfdb144799ef04dc07d4a0dd7b6c22003baaafd237800f5246a17578f8a58403db3fa6c1880008e0d2cadaa3c2a
6
+ metadata.gz: bc1393903d6481ec4037b3cc71281fbb0d7ae998517065004d281c836effc2e9694e749d8bfe14aea8742e59c92b100002d6c3144cc8926f065d0f6149f13110
7
+ data.tar.gz: 8ed7983c0ffde2f9b0817367187d8b719978adf433f29c7584a2d838176813f204deee4406417f9d5d40f5f05b985230f3e4c60eb05c633accc1ac3055cd07d6
@@ -1,3 +1,3 @@
1
1
  module Coaster
2
- VERSION = '1.3.26'
2
+ VERSION = '1.3.27'
3
3
  end
data/lib/coaster.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'oj'
1
2
  require 'active_support/core_ext/hash/indifferent_access'
2
3
  require 'active_support/core_ext/module/attribute_accessors'
3
4
  require 'active_support/core_ext/class/attribute_accessors'
@@ -316,7 +316,7 @@ LOG
316
316
  assert_equal 'NameError', e.to_hash['type']
317
317
  assert_equal 999999, e.to_hash['status']
318
318
  assert_equal 500, e.to_hash['http_status']
319
- assert_equal "standard error translation (37c30e #{bt})", e.user_message
319
+ assert_equal "standard error translation (bc1746 #{bt})", e.user_message
320
320
  assert_match(/undefined local variable or method `aa'/, e.to_hash['message'])
321
321
  end
322
322
 
@@ -327,6 +327,13 @@ LOG
327
327
  assert_equal 1, e.descriptions['a']
328
328
  end
329
329
 
330
+ def test_to_json
331
+ raise SampleError
332
+ rescue => e
333
+ json = ::JSON.dump({error: e})
334
+ assert_equal "{\"error\":{\"type\":\"Coaster::TestStandardError::SampleError\",\"status\":10,\"http_status\":500,\"message\":\"Coaster::TestStandardError::SampleError\"}}", json
335
+ end
336
+
330
337
  class SampleErrorSub < SampleError; end
331
338
  class SampleErrorSubSub < SampleErrorSub
332
339
  def it_might_happen?; true end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coaster
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.26
4
+ version: 1.3.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - buzz jung
@@ -10,6 +10,20 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2023-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: oj
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: i18n
15
29
  requirement: !ruby/object:Gem::Requirement