rack-json_schema 1.1.6 → 1.1.7

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: ed0069997aafd754ac22502c6821479b8b8fdc2d
4
- data.tar.gz: 9b85a306718476fe5578bd8c8dc00365047a91df
3
+ metadata.gz: 76058664ded518126a7217cd15be28a7819f7da4
4
+ data.tar.gz: 47486bee72899be258e35f91fcea32f242c7e690
5
5
  SHA512:
6
- metadata.gz: a53a19778c8406e0d7e33b32d10fc71f69d336df648c99371e5ba691f17dfe06773253bceb349ba24a6887006357ab787d4c4c14452490dfce7f822815cf4b21
7
- data.tar.gz: 1d0177a90def3bd715b1ec662b7508c672432d0f99a9989bc6cdf652d2ce6588d614d5f621b9e8c3c7db46841fc4e5bbc0cb710228f79b4308b4da2fc56506f4
6
+ metadata.gz: d984a9d64ba309d9022f58d29461b5c51934edbe45b86f086120143140daa490d33de4e233f53f99ea89de7be47e418bd2ad668ce867430acebbd94518a20e7d
7
+ data.tar.gz: 54f749aad28fd61b48fef1f642773e102fec1918a716ca906b69f2c39aa7970dbb43f33554a0de333e01f5fc8e01e886e23c12c2c332a02366a8f6116a663a9d
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 1.1.7
2
+ * Skip response validation on 3xx response
3
+
1
4
  ## 1.1.6
2
5
  * Add :strict option to ignore undefined link
3
6
 
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Rack::JsonSchema
1
+ # Rack::JsonSchema [![Build Status](https://travis-ci.org/r7kamura/rack-json_schema.svg?branch=master)](https://travis-ci.org/r7kamura/rack-json_schema)
2
2
  [JSON Schema](http://json-schema.org/) based Rack middlewares.
3
3
 
4
4
  * [Rack::JsonSchema::RequestValidation](#rackjsonschemarequestvalidation)
data/Rakefile CHANGED
@@ -1 +1,5 @@
1
1
  require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new("spec")
5
+ task :default => :spec
@@ -31,7 +31,7 @@ module Rack
31
31
  # Raises an error if any error detected, skipping validation for non-defined link
32
32
  # @raise [Rack::JsonSchema::ResponseValidation::InvalidResponse]
33
33
  def call
34
- if !has_error_status? && has_link_for_current_action? && has_link_of_media_type_json?
34
+ if !has_redirection_or_error_status? && has_link_for_current_action? && has_link_of_media_type_json?
35
35
  case
36
36
  when !has_json_content_type?
37
37
  raise InvalidResponseContentType
@@ -93,10 +93,10 @@ module Rack
93
93
  @response[0]
94
94
  end
95
95
 
96
- # Skips validation if status code is equal to or larger than 400
97
- # @return [Fixnum]
98
- def has_error_status?
99
- response_status >= 400
96
+ # Skips validation if status code is equal to or larger than 300
97
+ # @return [true, false]
98
+ def has_redirection_or_error_status?
99
+ response_status >= 300
100
100
  end
101
101
 
102
102
  # @return [String, nil] Response MIME Type specified in Content-Type header field
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module JsonSchema
3
- VERSION = "1.1.6"
3
+ VERSION = "1.1.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-json_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-30 00:00:00.000000000 Z
11
+ date: 2014-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: erubis
@@ -187,6 +187,7 @@ extensions: []
187
187
  extra_rdoc_files: []
188
188
  files:
189
189
  - ".gitignore"
190
+ - ".travis.yml"
190
191
  - CHANGELOG.md
191
192
  - Gemfile
192
193
  - LICENSE.txt