service_contract_webmock 0.1.8 → 0.1.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e7ebbb5cf842f5d26df4c4c4ff1655e7b1e20e8
|
4
|
+
data.tar.gz: b9e05ddd192b85dce819a097cb746ee8222180c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94a3625f7da312b7ce27499188189f78a8b9da04ef982747d133733a9df2830eff8ee7b8f621b315a11b514df7a8bffe98019c242bb0767d015ca968b03bcac1
|
7
|
+
data.tar.gz: caaec48acb0deed3686c28e963532a3621dfda288a423838ce947e2d0e0edeb32beabe59b6743f9603c54fd1f3b09890155746585c8200f155523ec9ce8d10da
|
@@ -54,6 +54,12 @@ module ServiceContractWebmock
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def found(query)
|
57
|
+
records = do_search(query)
|
58
|
+
|
59
|
+
apply_pagination(records, query)
|
60
|
+
end
|
61
|
+
|
62
|
+
def do_search(query)
|
57
63
|
search = extract_request(query)
|
58
64
|
if search.empty?
|
59
65
|
resources
|
@@ -66,5 +72,14 @@ module ServiceContractWebmock
|
|
66
72
|
end
|
67
73
|
end
|
68
74
|
end
|
75
|
+
|
76
|
+
def apply_pagination(records, query)
|
77
|
+
params = CGI.parse(query)
|
78
|
+
if params["per_page"].present? && params["per_page"].first.present?
|
79
|
+
per_page = params["per_page"].first.to_i
|
80
|
+
records = records.take(per_page)
|
81
|
+
end
|
82
|
+
records
|
83
|
+
end
|
69
84
|
end
|
70
85
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: service_contract_webmock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Donald Plummer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avro
|
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
136
|
version: '0'
|
137
137
|
requirements: []
|
138
138
|
rubyforge_project:
|
139
|
-
rubygems_version: 2.5.1
|
139
|
+
rubygems_version: 2.4.5.1
|
140
140
|
signing_key:
|
141
141
|
specification_version: 4
|
142
142
|
summary: A library for generating webmock mocks with ServiceContract schemas
|