fitting 2.1.3 → 2.2.0

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: 5af440238406b0dfe9d6eae440ae929db8eb79d1
4
- data.tar.gz: 813c981148fb939deb1cf25e7b82b55b87046e5c
3
+ metadata.gz: e04b182de6052b1d8c395f48016e8b9f37d6b769
4
+ data.tar.gz: 392e75a0af97023f53585472e27a94cb83843406
5
5
  SHA512:
6
- metadata.gz: ff95010d53695f4e8f69dbade09e29a12b16591d66855b292054d6caafe91262066c9b20313fa2150cea5a43d3928e35861045448fd1bcb08ebfd74600e8eb3e
7
- data.tar.gz: 068205879508bd6d8b758e171a9ae353662557a6fe0ebcd329c8021f31e5347a5148f15e74f990ed05bd8f92a17e84cad2ee8c38951b4755eb9200c1df42cc40
6
+ metadata.gz: 639a9c1b2d78babd961fabc52464b962017e97904dc1b1c3b10cab94e14434880ec315eb8509ee6aa081a5af83b4ad494b1b16b8cf4f841634996d03c6cdfa4f
7
+ data.tar.gz: 4200b2c82e8ef7f8b4b1b893818859c8ac7f5ec2fb6bce148b93b782b644b0945c9a0393343930afd6905283b8901754ee766ce6a8c5ad54721a1c7207677d9c
data/README.md CHANGED
@@ -162,6 +162,16 @@ config.resource_white_list = {
162
162
 
163
163
  Empty array `[]` means all methods.
164
164
 
165
+ ### ignore_list
166
+
167
+ You can use ignore list for omit checks with matchers.
168
+
169
+ ```ruby
170
+ config.ignore_list = [%r{/api/v1/users/[1-9].}, %r{/api/v1/comments}]
171
+ ```
172
+
173
+ It's work only for match_schema (NOT FOR strictly_match_schema)
174
+
165
175
  ## Contributing
166
176
 
167
177
  Bug reports and pull requests are welcome on GitHub at https://github.com/funbox/fitting. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
@@ -5,11 +5,13 @@ module Fitting
5
5
  :strict,
6
6
  :prefix,
7
7
  :white_list,
8
- :resource_white_list
8
+ :resource_white_list,
9
+ :ignore_list
9
10
 
10
11
  def initialize
11
12
  @strict = false
12
13
  @prefix = ''
14
+ @ignore_list = []
13
15
  end
14
16
  end
15
17
  end
@@ -10,6 +10,7 @@ module Fitting
10
10
  response,
11
11
  Fitting::Storage::Documentation.tomogram
12
12
  )
13
+ return true if @response.ignored?(Fitting.configuration.ignore_list)
13
14
  if @response.within_prefix?(Fitting.configuration.prefix)
14
15
  @response.fully_validates.valid?
15
16
  else
@@ -29,5 +29,11 @@ module Fitting
29
29
  def within_prefix?(prefix)
30
30
  @path.start_with?(prefix)
31
31
  end
32
+
33
+ def ignored?(ignore_list)
34
+ ignore_list.any? do |regexp|
35
+ regexp.match(@path)
36
+ end
37
+ end
32
38
  end
33
39
  end
@@ -54,6 +54,10 @@ module Fitting
54
54
  end.join("\n\n")
55
55
  end
56
56
 
57
+ def ignored?(ignore_list)
58
+ @request.ignored?(ignore_list)
59
+ end
60
+
57
61
  private
58
62
 
59
63
  def index
@@ -1,3 +1,3 @@
1
1
  module Fitting
2
- VERSION = '2.1.3'.freeze
2
+ VERSION = '2.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fitting
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - d.efimov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-07 00:00:00.000000000 Z
11
+ date: 2017-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json-schema