lhc 7.0.0 → 7.0.1
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/lib/lhc/endpoint.rb +2 -2
- data/lib/lhc/version.rb +1 -1
- data/spec/endpoint/match_spec.rb +3 -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: b9e147beaadc8fe3e310a38644dccd8b35f4054c
|
4
|
+
data.tar.gz: d84dacb1f0997890b2c82d8b74d09b374c14ff28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b41ec31a4305805cc15f3847dc32a1bcd2bc57aceba386947fe0b94c974237f9634bed91cf64edeec2ae486e1283b9883c6e49828b66af781ee0b91b50ca8937
|
7
|
+
data.tar.gz: 145f320dee707973d2ee7f675f51a5c7592f818b02cb942dcbfa1ea648fcd67d92a77bf9b64d0c96c52e0e7f2dd5022cbea566524fa321535437fa185ddde42a
|
data/lib/lhc/endpoint.rb
CHANGED
@@ -61,10 +61,10 @@ class LHC::Endpoint
|
|
61
61
|
|
62
62
|
# eliminate false positives in form:
|
63
63
|
# http://host/feedbacks matches {+service}/{entry_id}/feedbacks (service: http:/, entry_id: host)
|
64
|
-
first
|
64
|
+
first&.match(%{https?:/$}).nil? &&
|
65
65
|
# eliminates false positives in form:
|
66
66
|
# http://host/entries/123.json matches {+service}/entries/{id} (service: http://host, id: 123.json)
|
67
|
-
(url_format.blank? || !last
|
67
|
+
(url_format.blank? || !last&.ends_with?(url_format))
|
68
68
|
end
|
69
69
|
|
70
70
|
# Extracts the values from url and
|
data/lib/lhc/version.rb
CHANGED
data/spec/endpoint/match_spec.rb
CHANGED
@@ -11,7 +11,9 @@ describe LHC::Endpoint do
|
|
11
11
|
'http://local.ch/addresses/{id}' => 'http://local.ch/addresses/123',
|
12
12
|
'{+datastore}/customers/{id}/addresses' => 'http://local.ch:80/server/rest/v1/customers/123/addresses',
|
13
13
|
'{+datastore}/entries/{id}.json' => 'http://local.ch/entries/123.json',
|
14
|
-
'{+datastore}/places/{place_id}/feedbacks' => 'http://local.ch/places/1/feedbacks?limit=10&offset=0'
|
14
|
+
'{+datastore}/places/{place_id}/feedbacks' => 'http://local.ch/places/1/feedbacks?limit=10&offset=0',
|
15
|
+
'http://local.ch/places/1/feedbacks' => 'http://local.ch/places/1/feedbacks?lang=en',
|
16
|
+
'http://local.ch/places/1/feedbacks.json' => 'http://local.ch/places/1/feedbacks.json?lang=en'
|
15
17
|
}.each do |template, url|
|
16
18
|
it "#{url} matches #{template}" do
|
17
19
|
expect(LHC::Endpoint.match?(url, template)).to be
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lhc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- https://github.com/local-ch/lhc/contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|