grape-path-helpers 1.0.3 → 1.0.4
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b85249a82d094a43fb63d463cb9e5d4d70786255
|
4
|
+
data.tar.gz: 1d1045657453e0beb3065b0489b28db4005c672a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53cf4dff97fa1ab0d0578e28353bbc5ec8fa7d710a5a2d568a013ea7d9e681ff87855f33fd78baec99fe4c5877466a77f1af670cbd2c8069afe26897c637ce06
|
7
|
+
data.tar.gz: 0daa52606285e48aa7e89ca85f78a70d905430e49aca1964727a0e083d42b71f03bd8adf6dc8662c23bef7ab303119db5f1f763adbf400254858e6bc1445a745
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.0.4
|
4
|
+
|
5
|
+
* [Fix respond_to_missing? for included modules](https://gitlab.com/gitlab-org/grape-path-helpers/merge_requests/8)
|
6
|
+
|
3
7
|
## 1.0.3
|
4
8
|
|
5
9
|
* [Fix return value in method_missing? implementation](https://gitlab.com/gitlab-org/grape-path-helpers/merge_requests/7)
|
6
|
-
* [Fix broken
|
10
|
+
* [Fix broken respond_to_missing? implementation](https://gitlab.com/gitlab-org/grape-path-helpers/merge_requests/6)
|
7
11
|
|
8
12
|
## 1.0.2
|
9
13
|
|
@@ -20,11 +20,13 @@ module GrapePathHelpers
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def respond_to_missing?(method_name, _include_private = false)
|
23
|
+
return super unless method_name =~ /_path$/
|
24
|
+
|
23
25
|
Grape::API.decorated_routes.detect do |route|
|
24
26
|
return true if route.respond_to?(method_name)
|
25
27
|
end
|
26
28
|
|
27
|
-
|
29
|
+
super
|
28
30
|
end
|
29
31
|
|
30
32
|
def route_match?(route, method_name, segments)
|
@@ -146,6 +146,18 @@ describe GrapePathHelpers::NamedRouteMatcher do
|
|
146
146
|
end
|
147
147
|
|
148
148
|
describe '#respond_to_missing?' do
|
149
|
+
it 'returns super if the method doesb not end with path' do
|
150
|
+
expect(Grape::API).not_to receive(:decorated_routes)
|
151
|
+
|
152
|
+
expect(helper_class.send(:respond_to_missing?, :test)).to eq(false)
|
153
|
+
end
|
154
|
+
|
155
|
+
it 'search for the route if the method ends with path' do
|
156
|
+
expect(Grape::API).to receive(:decorated_routes).and_call_original
|
157
|
+
|
158
|
+
expect(helper_class.send(:respond_to_missing?, :test_path)).to eq(false)
|
159
|
+
end
|
160
|
+
|
149
161
|
context 'when method name with segments matches a Grape::Route path' do
|
150
162
|
let(:method_name) { :api_v1_cats_path }
|
151
163
|
|