stub_requests 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -2
  3. data/.reek.yml +1 -0
  4. data/.rubocop.yml +33 -35
  5. data/.simplecov +14 -8
  6. data/.yardopts +1 -1
  7. data/CHANGELOG.md +4 -1
  8. data/README.md +19 -11
  9. data/Rakefile +1 -3
  10. data/bin/update_docs.sh +16 -0
  11. data/gemfiles/webmock_2.3.gemfile.lock +1 -1
  12. data/gemfiles/webmock_3.5.gemfile.lock +1 -1
  13. data/gemfiles/webmock_develop.gemfile.lock +1 -1
  14. data/lib/rspec/subject_as_lambda.rb +138 -0
  15. data/lib/stub_requests/api.rb +42 -8
  16. data/lib/stub_requests/argument_validation.rb +17 -6
  17. data/lib/stub_requests/configuration.rb +21 -0
  18. data/lib/stub_requests/core_ext/all.rb +4 -0
  19. data/lib/stub_requests/core_ext/array/extract_options.rb +32 -0
  20. data/lib/stub_requests/core_ext/class/attribute.rb +61 -0
  21. data/lib/stub_requests/core_ext/kernel/singleton_class.rb +12 -0
  22. data/lib/stub_requests/core_ext/module/redefine_method.rb +44 -0
  23. data/lib/stub_requests/core_ext/object/blank.rb +99 -155
  24. data/lib/stub_requests/endpoint.rb +28 -30
  25. data/lib/stub_requests/endpoint_registry.rb +18 -16
  26. data/lib/stub_requests/exceptions.rb +84 -0
  27. data/lib/stub_requests/hash_util.rb +2 -0
  28. data/lib/stub_requests/metrics/endpoint_stat.rb +97 -0
  29. data/lib/stub_requests/metrics/registry.rb +132 -0
  30. data/lib/stub_requests/metrics/stub_stat.rb +80 -0
  31. data/lib/stub_requests/metrics.rb +32 -0
  32. data/lib/stub_requests/property/validator.rb +136 -0
  33. data/lib/stub_requests/property.rb +99 -0
  34. data/lib/stub_requests/service.rb +12 -53
  35. data/lib/stub_requests/service_registry.rb +8 -9
  36. data/lib/stub_requests/stub_requests.rb +23 -51
  37. data/lib/stub_requests/uri/builder.rb +5 -1
  38. data/lib/stub_requests/uri/scheme.rb +3 -1
  39. data/lib/stub_requests/uri/suffix.rb +5 -0
  40. data/lib/stub_requests/uri/validator.rb +3 -1
  41. data/lib/stub_requests/uri.rb +34 -0
  42. data/lib/stub_requests/version.rb +1 -1
  43. data/lib/stub_requests/webmock/builder.rb +116 -0
  44. data/lib/stub_requests/webmock/stub_registry_extension.rb +46 -0
  45. data/lib/stub_requests.rb +21 -3
  46. metadata +19 -49
  47. data/docs/.gitkeep +0 -0
  48. data/docs/Array.html +0 -137
  49. data/docs/FalseClass.html +0 -232
  50. data/docs/Hash.html +0 -137
  51. data/docs/NilClass.html +0 -232
  52. data/docs/Numeric.html +0 -233
  53. data/docs/Object.html +0 -396
  54. data/docs/String.html +0 -298
  55. data/docs/StubRequests/API.html +0 -651
  56. data/docs/StubRequests/ArgumentValidation.html +0 -309
  57. data/docs/StubRequests/Endpoint.html +0 -1187
  58. data/docs/StubRequests/EndpointNotFound.html +0 -157
  59. data/docs/StubRequests/EndpointRegistry.html +0 -1527
  60. data/docs/StubRequests/Error.html +0 -153
  61. data/docs/StubRequests/HashUtil.html +0 -304
  62. data/docs/StubRequests/InvalidType.html +0 -252
  63. data/docs/StubRequests/InvalidUri.html +0 -252
  64. data/docs/StubRequests/Service.html +0 -1307
  65. data/docs/StubRequests/ServiceHaveEndpoints.html +0 -244
  66. data/docs/StubRequests/ServiceNotFound.html +0 -252
  67. data/docs/StubRequests/ServiceRegistry.html +0 -1031
  68. data/docs/StubRequests/URI/Builder.html +0 -1194
  69. data/docs/StubRequests/URI/Scheme.html +0 -315
  70. data/docs/StubRequests/URI/Suffix.html +0 -315
  71. data/docs/StubRequests/URI/Validator.html +0 -770
  72. data/docs/StubRequests/URI.html +0 -144
  73. data/docs/StubRequests/UriSegmentMismatch.html +0 -157
  74. data/docs/StubRequests/WebMockBuilder.html +0 -887
  75. data/docs/StubRequests.html +0 -452
  76. data/docs/Time.html +0 -232
  77. data/docs/TrueClass.html +0 -232
  78. data/docs/_config.yml +0 -1
  79. data/docs/_index.html +0 -391
  80. data/docs/class_list.html +0 -51
  81. data/docs/css/common.css +0 -1
  82. data/docs/css/full_list.css +0 -58
  83. data/docs/css/style.css +0 -496
  84. data/docs/file.README.html +0 -225
  85. data/docs/file_list.html +0 -56
  86. data/docs/frames.html +0 -17
  87. data/docs/index.html +0 -225
  88. data/docs/js/app.js +0 -292
  89. data/docs/js/full_list.js +0 -216
  90. data/docs/js/jquery.js +0 -4
  91. data/docs/method_list.html +0 -707
  92. data/docs/top-level-namespace.html +0 -112
  93. data/lib/stub_requests/webmock_builder.rb +0 -108
data/docs/NilClass.html DELETED
@@ -1,232 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>
7
- Class: NilClass
8
-
9
- &mdash; Documentation by YARD 0.9.18
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- pathId = "NilClass";
19
- relpath = '';
20
- </script>
21
-
22
-
23
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
-
25
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
-
27
-
28
- </head>
29
- <body>
30
- <div class="nav_wrap">
31
- <iframe id="nav" src="class_list.html?1"></iframe>
32
- <div id="resizer"></div>
33
- </div>
34
-
35
- <div id="main" tabindex="-1">
36
- <div id="header">
37
- <div id="menu">
38
-
39
- <a href="_index.html">Index (N)</a> &raquo;
40
-
41
-
42
- <span class="title">NilClass</span>
43
-
44
- </div>
45
-
46
- <div id="search">
47
-
48
- <a class="full_list_link" id="class_list_link"
49
- href="class_list.html">
50
-
51
- <svg width="24" height="24">
52
- <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
- <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
- <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
- </svg>
56
- </a>
57
-
58
- </div>
59
- <div class="clear"></div>
60
- </div>
61
-
62
- <div id="content"><h1>Class: NilClass
63
-
64
-
65
-
66
- </h1>
67
- <div class="box_info">
68
-
69
- <dl>
70
- <dt>Inherits:</dt>
71
- <dd>
72
- <span class="inheritName"><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></span>
73
-
74
- <ul class="fullTree">
75
- <li><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></li>
76
-
77
- <li class="next">NilClass</li>
78
-
79
- </ul>
80
- <a href="#" class="inheritanceTree">show all</a>
81
-
82
- </dd>
83
- </dl>
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
- <dl>
96
- <dt>Defined in:</dt>
97
- <dd>lib/stub_requests/core_ext/object/blank.rb</dd>
98
- </dl>
99
-
100
- </div>
101
-
102
- <h2>Overview</h2><div class="docstring">
103
- <div class="discussion">
104
-
105
-
106
- </div>
107
- </div>
108
- <div class="tags">
109
-
110
-
111
- <p class="tag_title">See Also:</p>
112
- <ul class="see">
113
-
114
- <li><span class='object_link'><a href="" title="NilClass (class)">NilClass</a></span></li>
115
-
116
- </ul>
117
-
118
- </div>
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
- <h2>
127
- Instance Method Summary
128
- <small><a href="#" class="summary_toggle">collapse</a></small>
129
- </h2>
130
-
131
- <ul class="summary">
132
-
133
- <li class="public ">
134
- <span class="summary_signature">
135
-
136
- <a href="#blank%3F-instance_method" title="#blank? (instance method)">#<strong>blank?</strong> &#x21d2; true </a>
137
-
138
-
139
-
140
- </span>
141
-
142
-
143
-
144
-
145
-
146
-
147
-
148
-
149
-
150
- <span class="summary_desc"><div class='inline'><p>+nil+ is blank:.</p>
151
- </div></span>
152
-
153
- </li>
154
-
155
-
156
- </ul>
157
-
158
-
159
-
160
-
161
- <div id="instance_method_details" class="method_details_list">
162
- <h2>Instance Method Details</h2>
163
-
164
-
165
- <div class="method_details first">
166
- <h3 class="signature first" id="blank?-instance_method">
167
-
168
- #<strong>blank?</strong> &#x21d2; <tt>true</tt>
169
-
170
-
171
-
172
-
173
-
174
- </h3><div class="docstring">
175
- <div class="discussion">
176
- <p>+nil+ is blank:</p>
177
-
178
- <p>nil.blank? # =&gt; true</p>
179
-
180
-
181
- </div>
182
- </div>
183
- <div class="tags">
184
-
185
- <p class="tag_title">Returns:</p>
186
- <ul class="return">
187
-
188
- <li>
189
-
190
-
191
- <span class='type'>(<tt>true</tt>)</span>
192
-
193
-
194
-
195
- </li>
196
-
197
- </ul>
198
-
199
- </div><table class="source_code">
200
- <tr>
201
- <td>
202
- <pre class="lines">
203
-
204
-
205
- 63
206
- 64
207
- 65</pre>
208
- </td>
209
- <td>
210
- <pre class="code"><span class="info file"># File 'lib/stub_requests/core_ext/object/blank.rb', line 63</span>
211
-
212
- <span class='kw'>def</span> <span class='id identifier rubyid_blank?'>blank?</span>
213
- <span class='kw'>true</span>
214
- <span class='kw'>end</span></pre>
215
- </td>
216
- </tr>
217
- </table>
218
- </div>
219
-
220
- </div>
221
-
222
- </div>
223
-
224
- <div id="footer">
225
- Generated on Fri Feb 1 19:57:30 2019 by
226
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
227
- 0.9.18 (ruby-2.5.3).
228
- </div>
229
-
230
- </div>
231
- </body>
232
- </html>
data/docs/Numeric.html DELETED
@@ -1,233 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>
7
- Class: Numeric
8
-
9
- &mdash; Documentation by YARD 0.9.18
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- pathId = "Numeric";
19
- relpath = '';
20
- </script>
21
-
22
-
23
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
-
25
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
-
27
-
28
- </head>
29
- <body>
30
- <div class="nav_wrap">
31
- <iframe id="nav" src="class_list.html?1"></iframe>
32
- <div id="resizer"></div>
33
- </div>
34
-
35
- <div id="main" tabindex="-1">
36
- <div id="header">
37
- <div id="menu">
38
-
39
- <a href="_index.html">Index (N)</a> &raquo;
40
-
41
-
42
- <span class="title">Numeric</span>
43
-
44
- </div>
45
-
46
- <div id="search">
47
-
48
- <a class="full_list_link" id="class_list_link"
49
- href="class_list.html">
50
-
51
- <svg width="24" height="24">
52
- <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
- <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
- <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
- </svg>
56
- </a>
57
-
58
- </div>
59
- <div class="clear"></div>
60
- </div>
61
-
62
- <div id="content"><h1>Class: Numeric
63
-
64
-
65
-
66
- </h1>
67
- <div class="box_info">
68
-
69
- <dl>
70
- <dt>Inherits:</dt>
71
- <dd>
72
- <span class="inheritName"><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></span>
73
-
74
- <ul class="fullTree">
75
- <li><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></li>
76
-
77
- <li class="next">Numeric</li>
78
-
79
- </ul>
80
- <a href="#" class="inheritanceTree">show all</a>
81
-
82
- </dd>
83
- </dl>
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
- <dl>
96
- <dt>Defined in:</dt>
97
- <dd>lib/stub_requests/core_ext/object/blank.rb</dd>
98
- </dl>
99
-
100
- </div>
101
-
102
- <h2>Overview</h2><div class="docstring">
103
- <div class="discussion">
104
-
105
-
106
- </div>
107
- </div>
108
- <div class="tags">
109
-
110
-
111
- <p class="tag_title">See Also:</p>
112
- <ul class="see">
113
-
114
- <li><span class='object_link'><a href="" title="Numeric (class)">Numeric</a></span></li>
115
-
116
- </ul>
117
-
118
- </div>
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
- <h2>
127
- Instance Method Summary
128
- <small><a href="#" class="summary_toggle">collapse</a></small>
129
- </h2>
130
-
131
- <ul class="summary">
132
-
133
- <li class="public ">
134
- <span class="summary_signature">
135
-
136
- <a href="#blank%3F-instance_method" title="#blank? (instance method)">#<strong>blank?</strong> &#x21d2; false </a>
137
-
138
-
139
-
140
- </span>
141
-
142
-
143
-
144
-
145
-
146
-
147
-
148
-
149
-
150
- <span class="summary_desc"><div class='inline'><p>No number is blank:.</p>
151
- </div></span>
152
-
153
- </li>
154
-
155
-
156
- </ul>
157
-
158
-
159
-
160
-
161
- <div id="instance_method_details" class="method_details_list">
162
- <h2>Instance Method Details</h2>
163
-
164
-
165
- <div class="method_details first">
166
- <h3 class="signature first" id="blank?-instance_method">
167
-
168
- #<strong>blank?</strong> &#x21d2; <tt>false</tt>
169
-
170
-
171
-
172
-
173
-
174
- </h3><div class="docstring">
175
- <div class="discussion">
176
- <p>No number is blank:</p>
177
-
178
- <p>1.blank? # =&gt; false
179
- 0.blank? # =&gt; false</p>
180
-
181
-
182
- </div>
183
- </div>
184
- <div class="tags">
185
-
186
- <p class="tag_title">Returns:</p>
187
- <ul class="return">
188
-
189
- <li>
190
-
191
-
192
- <span class='type'>(<tt>false</tt>)</span>
193
-
194
-
195
-
196
- </li>
197
-
198
- </ul>
199
-
200
- </div><table class="source_code">
201
- <tr>
202
- <td>
203
- <pre class="lines">
204
-
205
-
206
- 156
207
- 157
208
- 158</pre>
209
- </td>
210
- <td>
211
- <pre class="code"><span class="info file"># File 'lib/stub_requests/core_ext/object/blank.rb', line 156</span>
212
-
213
- <span class='kw'>def</span> <span class='id identifier rubyid_blank?'>blank?</span>
214
- <span class='kw'>false</span>
215
- <span class='kw'>end</span></pre>
216
- </td>
217
- </tr>
218
- </table>
219
- </div>
220
-
221
- </div>
222
-
223
- </div>
224
-
225
- <div id="footer">
226
- Generated on Fri Feb 1 19:57:30 2019 by
227
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
228
- 0.9.18 (ruby-2.5.3).
229
- </div>
230
-
231
- </div>
232
- </body>
233
- </html>