tzispa 0.5.15 → 0.5.16

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a6cbf30132a749b8ea402e6014444760d27b601
4
- data.tar.gz: 0152e379d159fe327b203146a01a3c0967ceedb7
3
+ metadata.gz: a66c42c350fb07b86a732e2f6c3a392cf567f54c
4
+ data.tar.gz: 84f80906ff6210b0143bfa4814f4d1c0541428e3
5
5
  SHA512:
6
- metadata.gz: 43dac5fadb0ae5b05045f92f0c1661ffa55ff537dcbdaf1eb6b9ea56d273140362a1eeb3c9c5321630985ed67510d19586a0421bd05645b97c97f0be29c740c4
7
- data.tar.gz: 2c160e09980c39641db93aacbec229dd64cedb3b45188b46552f8a7cc88f600f142274274c74ede8e9502c45e18809d31ab5a42e086ae620d7f8488e69a9d53c
6
+ metadata.gz: 6a2ce3fa70593ab56c1a53cfb2998ffb7c55309f5aaaeef354a506f429c34e26d56911dbf082fd52a87e93cf6b5e38770b9031ebf827d3031a9e79d291d41e39
7
+ data.tar.gz: 05402a9069993d25422e91205a16f2b9b827980415c00ecbd6f0d38479c9295a8415da28ee015605fd944cb6a4b0c57f4f2398b0be0ff6cf43b5d8459d764cd6
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@ Tzispa
2
2
 
3
3
  General purpose web framework
4
4
 
5
+ ## v0.5.16
6
+ - controller/api: not populate body with the handler data if error? at json response
7
+ - api/handler: fix i18n key in api handler error message builder
8
+ - controller/api: add handler error status in the json response when error
9
+
5
10
  ## v0.5.15
6
11
  - add thor gem missing dependency in gemspec
7
12
 
@@ -60,7 +60,7 @@ module Tzispa
60
60
  end
61
61
 
62
62
  def message
63
- I18n.t("#{self.class.name.dottize}.#{status}ss", default: "#{status}") if status
63
+ I18n.t("#{self.class.name.dottize}.#{status}", default: "#{status}") if status
64
64
  end
65
65
 
66
66
  def run!(verb, predicate=nil)
@@ -51,8 +51,11 @@ module Tzispa
51
51
  def json(handler)
52
52
  content_type :json
53
53
  data = ::String === handler.data ? JSON.parse(handler.data) : handler.data.to_json
54
- response.body << data
55
- response.body << Hash[:__error, true, :__msg_error, handler.message].to_json if handler.error?
54
+ unless handler.error?
55
+ response.body << data
56
+ else
57
+ response.body << Hash[:__error, true, :__error_msg, handler.message, :__error_code, handler.status].to_json
58
+ end
56
59
  set_api_headers handler.status
57
60
  end
58
61
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tzispa
4
- VERSION = '0.5.15'
4
+ VERSION = '0.5.16'
5
5
  FRAMEWORK_NAME = 'Tzispa'
6
6
  GEM_NAME = 'tzispa'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tzispa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.15
4
+ version: 0.5.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Antonio Piñero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-23 00:00:00.000000000 Z
11
+ date: 2016-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack