stub_requests 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +11 -14
- data/Rakefile +3 -2
- data/lib/stub_requests/core_ext/object/blank.rb +10 -10
- data/lib/stub_requests/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d88ecaf83ef4567bf489d1f8eb680a819f477703d2590d1b18781a7367bd60e6
|
4
|
+
data.tar.gz: 2adf0a48a25b5507d044d83498b8847fad8fc1f37be3b5f954db7b6087d4fbd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 983ab88481db1918b42fd3bca46f5fdc07690f7e501548c1ef71e7702e094f0c57177f8a257043219f1310b31fb17b30ea9c657fbfdd6855ffe9946c80451135
|
7
|
+
data.tar.gz: 4bbad922db8034a7a533e2a98387c046d2b23495f163cba9eb63b7f46e606c7a1f02f723b0948e015734276d08590fc15ee94ff48598fcdb71a48510e38e578c
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v0.1.7](https://github.com/mhenrixon/stub_requests/tree/v0.1.7) (2019-02-07)
|
4
|
+
[Full Changelog](https://github.com/mhenrixon/stub_requests/compare/v0.1.6...v0.1.7)
|
5
|
+
|
6
|
+
**Fixed bugs:**
|
7
|
+
|
8
|
+
- Don't crash when service was registered [\#25](https://github.com/mhenrixon/stub_requests/pull/25) ([mhenrixon](https://github.com/mhenrixon))
|
9
|
+
|
10
|
+
**Merged pull requests:**
|
11
|
+
|
12
|
+
- Update Changelog [\#24](https://github.com/mhenrixon/stub_requests/pull/24) ([mhenrixon](https://github.com/mhenrixon))
|
13
|
+
|
3
14
|
## [v0.1.6](https://github.com/mhenrixon/stub_requests/tree/v0.1.6) (2019-02-06)
|
4
15
|
[Full Changelog](https://github.com/mhenrixon/stub_requests/compare/v0.1.5...v0.1.6)
|
5
16
|
|
data/README.md
CHANGED
@@ -154,16 +154,13 @@ StubRequests.register_service(:documents, "https://company.com/api/v1") do
|
|
154
154
|
post "documents", as: :documents_create
|
155
155
|
patch "documents/:id", as: :documents_update
|
156
156
|
put "documents/:id", as: :document_put
|
157
|
-
delete "documents/:id"
|
157
|
+
delete "documents/:id", as: :documents_destroy
|
158
158
|
end
|
159
159
|
|
160
160
|
#
|
161
161
|
# 2. Create a module where the methods should be defined
|
162
162
|
#
|
163
|
-
module Stubs
|
164
|
-
module Documents
|
165
|
-
end
|
166
|
-
end
|
163
|
+
module Stubs::Documents; end
|
167
164
|
|
168
165
|
#
|
169
166
|
# 3. Define the stubs for the registered endpoints
|
@@ -171,14 +168,14 @@ end
|
|
171
168
|
StubRequests::DSL.define_stubs(:documents, Stubs::Documents)
|
172
169
|
|
173
170
|
Documents.instance_methods #=>
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
171
|
+
[
|
172
|
+
:stub_documents_show,
|
173
|
+
:stub_documents_index,
|
174
|
+
:stub_documents_create,
|
175
|
+
:stub_documents_update,
|
176
|
+
:stub_document_put,
|
177
|
+
:stub_documents_destroy,
|
178
|
+
]
|
182
179
|
|
183
180
|
#
|
184
181
|
# 4. Use the module in our tests
|
@@ -229,7 +226,7 @@ end
|
|
229
226
|
#
|
230
227
|
# 2. Print the stub definitions to STDOUT
|
231
228
|
#
|
232
|
-
StubRequests.print_stubs(:documents)
|
229
|
+
StubRequests.print_stubs(:documents)
|
233
230
|
|
234
231
|
#
|
235
232
|
# 3. Copy the stubs into a module
|
data/Rakefile
CHANGED
@@ -26,7 +26,7 @@ class NilClass
|
|
26
26
|
# :nodoc:
|
27
27
|
def blank?
|
28
28
|
true
|
29
|
-
end
|
29
|
+
end unless method_defined?(:blank?)
|
30
30
|
end
|
31
31
|
|
32
32
|
# @see FalseClass
|
@@ -35,7 +35,7 @@ class FalseClass
|
|
35
35
|
# :nodoc:
|
36
36
|
def blank?
|
37
37
|
true
|
38
|
-
end
|
38
|
+
end unless method_defined?(:blank?)
|
39
39
|
end
|
40
40
|
|
41
41
|
# @see TrueClass
|
@@ -44,31 +44,31 @@ class TrueClass
|
|
44
44
|
# :nodoc:
|
45
45
|
def blank?
|
46
46
|
false
|
47
|
-
end
|
47
|
+
end unless method_defined?(:blank?)
|
48
48
|
end
|
49
49
|
|
50
50
|
# @see Array
|
51
51
|
# :nodoc:
|
52
52
|
class Array
|
53
53
|
# :nodoc:
|
54
|
-
alias blank? empty?
|
54
|
+
alias blank? empty? unless method_defined?(:blank?)
|
55
55
|
end
|
56
56
|
|
57
57
|
# @see Hash
|
58
58
|
# :nodoc:
|
59
59
|
class Hash
|
60
60
|
# :nodoc:
|
61
|
-
alias blank? empty?
|
61
|
+
alias blank? empty? unless method_defined?(:blank?)
|
62
62
|
end
|
63
63
|
|
64
64
|
# @see String
|
65
65
|
class String
|
66
66
|
# :nodoc:
|
67
67
|
# :nodoc:
|
68
|
-
BLANK_RE
|
68
|
+
BLANK_RE ||= /\A[[:space:]]*\z/.freeze
|
69
69
|
# :nodoc:
|
70
70
|
# :nodoc:
|
71
|
-
ENCODED_BLANKS
|
71
|
+
ENCODED_BLANKS ||= Concurrent::Map.new do |map, enc|
|
72
72
|
map[enc] = Regexp.new(BLANK_RE.source.encode(enc), BLANK_RE.options | Regexp::FIXEDENCODING)
|
73
73
|
end
|
74
74
|
|
@@ -91,7 +91,7 @@ class String
|
|
91
91
|
!!ENCODED_BLANKS[encoding].match(self)
|
92
92
|
end
|
93
93
|
end
|
94
|
-
end
|
94
|
+
end unless method_defined?(:blank?)
|
95
95
|
end
|
96
96
|
|
97
97
|
# @see Numeric
|
@@ -100,7 +100,7 @@ class Numeric
|
|
100
100
|
# :nodoc:
|
101
101
|
def blank?
|
102
102
|
false
|
103
|
-
end
|
103
|
+
end unless method_defined?(:blank?)
|
104
104
|
end
|
105
105
|
|
106
106
|
# @see Time
|
@@ -109,5 +109,5 @@ class Time
|
|
109
109
|
# :nodoc:
|
110
110
|
def blank?
|
111
111
|
false
|
112
|
-
end
|
112
|
+
end unless method_defined?(:blank?)
|
113
113
|
end
|