lhc 7.0.0.beta1 → 7.0.0

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: dfdf5514e679a637e9e800e71d64394e922494ab
4
- data.tar.gz: '09f38587235d31394bc9100cba4dde8e292592b8'
3
+ metadata.gz: bbf8c19f3a1808c9ee8ae502cc835ec24a6b75ac
4
+ data.tar.gz: 3d12a0c83e3498c49cd8b498b26c4bf6fab05789
5
5
  SHA512:
6
- metadata.gz: 74a8a94d300802292148f4c590a924197f94f2e93e3909510f70537da5c740f6e5d10de3da5473b84f25b102822434f6709ec696986e46107789643cfc5fd2cf
7
- data.tar.gz: 4dd2d4d39e7d9907366f6c132b676aca4167d219df0e2e7820f1e515a9c3bf79442016a547d16a5fe4d6fe8997234ffc50bffce821d6cbdb51c1c5999154568c
6
+ metadata.gz: 75b261d1b95a04a77ca8eb5913b5285d3e6e3780562ff9a3f37e985dca9f4c52dd1dc97bec71e5eec97e15406d645ea908c7802ac9e2b9834611ae81d5510f65
7
+ data.tar.gz: 6e95f8c8754241b62f91d37e46f02eb823aef6b14a6fdd8ef1b5d2c3aba7da4c92ae2312018be9733567c07e60a5a088c3bdb60b5a552214458c87016af50093
@@ -55,7 +55,16 @@ class LHC::Endpoint
55
55
  match_data = match_data(url)
56
56
  return false if match_data.nil?
57
57
 
58
- match_data.values.all? { |value| valid_value?(value) }
58
+ first = match_data.values.first
59
+ last = match_data.values.last
60
+ url_format = File.extname(url)
61
+
62
+ # eliminate false positives in form:
63
+ # http://host/feedbacks matches {+service}/{entry_id}/feedbacks (service: http:/, entry_id: host)
64
+ first.match(%{https?:/$}).nil? &&
65
+ # eliminates false positives in form:
66
+ # http://host/entries/123.json matches {+service}/entries/{id} (service: http://host, id: 123.json)
67
+ (url_format.blank? || !last.ends_with?(url_format))
59
68
  end
60
69
 
61
70
  # Extracts the values from url and
@@ -96,12 +105,6 @@ class LHC::Endpoint
96
105
 
97
106
  private
98
107
 
99
- # Ensure there are no false positives in the template matching
100
- def valid_value?(value)
101
- value.match(%{https?:/$}).nil? &&
102
- value.match(/.*\.json/).nil?
103
- end
104
-
105
108
  def match_data(url)
106
109
  parsed = URI.parse(url)
107
110
  parsed.query = parsed.fragment = nil
@@ -1,3 +1,3 @@
1
1
  module LHC
2
- VERSION ||= '7.0.0.beta1'
2
+ VERSION ||= '7.0.0'
3
3
  end
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.0.beta1
4
+ version: 7.0.0
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-15 00:00:00.000000000 Z
11
+ date: 2018-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -353,9 +353,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
353
353
  version: 2.0.0
354
354
  required_rubygems_version: !ruby/object:Gem::Requirement
355
355
  requirements:
356
- - - ">"
356
+ - - ">="
357
357
  - !ruby/object:Gem::Version
358
- version: 1.3.1
358
+ version: '0'
359
359
  requirements:
360
360
  - Ruby >= 2.0.0
361
361
  rubyforge_project: