fitting 2.1.1 → 2.1.2
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/fitting/response.rb +14 -4
- data/lib/fitting/route/coverage.rb +2 -2
- data/lib/fitting/storage/white_list.rb +28 -6
- data/lib/fitting/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62ddfc06500d352a19cef63869803d96acbd3a83
|
4
|
+
data.tar.gz: 683e48bcf26e0d24205e6392b894ffc161055d79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8c51d7fa1ae6fe147c00e042127cb4a2be013d7d045bc99cac28d0016474e33a31ee3f2db716ceaca9eb10ac0511e7a43b02913bf7cd275e301cc2735b6f667
|
7
|
+
data.tar.gz: fc314f02bfbd6b67c4d4fa6c266c3fad22b01cea82bc5302f8b6ddd54edc2e7be9e94bb15ce3bf96398389280ba758c1a329aff45e58cf34419de0f6eff4051d
|
data/CHANGELOG.md
CHANGED
data/lib/fitting/response.rb
CHANGED
@@ -29,11 +29,15 @@ module Fitting
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def route
|
32
|
-
|
32
|
+
index.map do |i|
|
33
|
+
"#{@request.route} #{@status} #{i}"
|
34
|
+
end
|
33
35
|
end
|
34
36
|
|
35
37
|
def strict_route
|
36
|
-
|
38
|
+
strict_index.map do |i|
|
39
|
+
"#{@request.route} #{@status} #{i}"
|
40
|
+
end
|
37
41
|
end
|
38
42
|
|
39
43
|
def real_request_with_status
|
@@ -53,15 +57,21 @@ module Fitting
|
|
53
57
|
private
|
54
58
|
|
55
59
|
def index
|
60
|
+
return @index_res if @index_res
|
61
|
+
@index_res = []
|
56
62
|
@schemas.size.times do |i|
|
57
|
-
|
63
|
+
@index_res.push(i) if fully_validates[i] == []
|
58
64
|
end
|
65
|
+
@index_res
|
59
66
|
end
|
60
67
|
|
61
68
|
def strict_index
|
69
|
+
return @strict_index_res if @strict_index_res
|
70
|
+
@strict_index_res = []
|
62
71
|
@schemas.size.times do |i|
|
63
|
-
|
72
|
+
@strict_index_res.push(i) if strict_fully_validates[i] == []
|
64
73
|
end
|
74
|
+
@strict_index_res
|
65
75
|
end
|
66
76
|
end
|
67
77
|
end
|
@@ -33,11 +33,11 @@ module Fitting
|
|
33
33
|
if @strict
|
34
34
|
@coverage_responses.map do |response|
|
35
35
|
response.strict_route if response.documented? && response.strict_fully_validates.valid?
|
36
|
-
end.compact.uniq
|
36
|
+
end.flatten.compact.uniq
|
37
37
|
else
|
38
38
|
@coverage_responses.map do |response|
|
39
39
|
response.route if response.documented? && response.fully_validates.valid?
|
40
|
-
end.compact.uniq
|
40
|
+
end.flatten.compact.uniq
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
@@ -7,6 +7,7 @@ module Fitting
|
|
7
7
|
@white_list = white_list
|
8
8
|
@resource_white_list = resource_white_list
|
9
9
|
@resources = resources
|
10
|
+
@warnings = []
|
10
11
|
end
|
11
12
|
|
12
13
|
def to_a
|
@@ -15,13 +16,34 @@ module Fitting
|
|
15
16
|
end
|
16
17
|
|
17
18
|
def without_group
|
18
|
-
@
|
19
|
-
|
20
|
-
|
21
|
-
else
|
22
|
-
requests(asd[1], all_requests)
|
23
|
-
end
|
19
|
+
return @without_group_list if @without_group_list
|
20
|
+
@without_group_list = @resource_white_list.inject([]) do |all_requests, resource|
|
21
|
+
resource_selection(resource, all_requests)
|
24
22
|
end.flatten.uniq
|
23
|
+
puts_warnings
|
24
|
+
@without_group_list
|
25
|
+
end
|
26
|
+
|
27
|
+
def resource_selection(resource, all_requests)
|
28
|
+
if resource[1] == []
|
29
|
+
find_warnings(resource[0])
|
30
|
+
requests(@resources[resource[0]], all_requests)
|
31
|
+
else
|
32
|
+
requests(resource[1], all_requests)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def find_warnings(resource)
|
37
|
+
return nil if @resources[resource]
|
38
|
+
@warnings.push(
|
39
|
+
"FITTING WARNING: In the documentation there isn't resource from the resource_white_list #{resource}"
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
def puts_warnings
|
44
|
+
return nil if @warnings == []
|
45
|
+
warnings_string = @warnings.join("\n")
|
46
|
+
puts "\n#{warnings_string}"
|
25
47
|
end
|
26
48
|
|
27
49
|
def requests(resource, all_requests)
|
data/lib/fitting/version.rb
CHANGED
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.
|
4
|
+
version: 2.1.2
|
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-
|
11
|
+
date: 2017-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json-schema
|