lhc 5.0.2 → 5.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca22edb3d907f1f5eea91ae7d046f6853d8d44e6
4
- data.tar.gz: 8384401b348e2be3abe4be92a613087002af0153
3
+ metadata.gz: b254c12c9236f595f73e159d35b7f13c9e501e3c
4
+ data.tar.gz: e8ccff4d8334e8e4b87bee5171f2c27ea44a8508
5
5
  SHA512:
6
- metadata.gz: 3172e1a788c94cd7f1b04a0f22812abdf5e9373a0094bdec244d72af460c888aa073ce64958363a1ebc4506a88068d811ad4a65859519b64ff010158ce0ad16a
7
- data.tar.gz: a5413bab8b96564f62a2c1c2c9af3ce861cdb5a419bef0f286223e286d86a7859ba5c0993cad1b91131f6e1da33fd542ecca5990012b0cf06a43778544924e77
6
+ metadata.gz: f7e34e0029c58dc0f766a949f21bb771cecc0cd92a5ae8a91e429342c45c7c03df42e3d3df2a164ff08a76321d679c865d25ed12f7eb203093539b7720d36364
7
+ data.tar.gz: b17640979f7bb7257b94bfc4dfe1b7f5e1f64356772f069d192420ed097c59c5e0b9d0e3bed54fc425dd66f587b8ebda134738f1b9bd94eeee5e46cad79f6945
data/lib/lhc/endpoint.rb CHANGED
@@ -5,6 +5,7 @@ class LHC::Endpoint
5
5
 
6
6
  PLACEHOLDER ||= %r{:[^\/\.:;\d\&]+}
7
7
  ANYTHING_BUT_SINGLE_SLASH_AND_DOT ||= '([^\/\.]|\/\/)+'.freeze
8
+ URL_PARAMETERS ||= '(\\?.*)*'
8
9
 
9
10
  attr_accessor :url, :options
10
11
 
@@ -65,6 +66,7 @@ class LHC::Endpoint
65
66
  # Example: :datastore/contracts/:id == http://local.ch/contracts/1
66
67
  def self.match?(url, template)
67
68
  regexp = template.gsub PLACEHOLDER, ANYTHING_BUT_SINGLE_SLASH_AND_DOT
69
+ regexp += URL_PARAMETERS
68
70
  url.match "#{regexp}$"
69
71
  end
70
72
 
@@ -83,6 +85,7 @@ class LHC::Endpoint
83
85
  name = placeholder.gsub(":", '')
84
86
  regexp = regexp.gsub(placeholder, "(?<#{name}>.*)")
85
87
  end
88
+ regexp += URL_PARAMETERS
86
89
  matchdata = url.match(Regexp.new("^#{regexp}$"))
87
90
  LHC::Endpoint.placeholders(template).each do |placeholder|
88
91
  name = placeholder.gsub(':', '')
data/lib/lhc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module LHC
2
- VERSION ||= "5.0.2"
2
+ VERSION ||= "5.0.3"
3
3
  end
@@ -11,7 +11,8 @@ describe LHC::Endpoint do
11
11
  ':datastore/addresses/:id' => 'http://local.ch/addresses/123',
12
12
  'http://local.ch/addresses/:id' => 'http://local.ch/addresses/123',
13
13
  ':datastore/customers/:id/addresses' => 'http://local.ch:80/server/rest/v1/customers/123/addresses',
14
- ':datastore/entries/:id.json' => 'http://local.ch/entries/123.json'
14
+ ':datastore/entries/:id.json' => 'http://local.ch/entries/123.json',
15
+ ':datastore/places/:place_id/feedbacks' => 'http://local.ch/places/1/feedbacks?limit=10&offset=0'
15
16
  }.each do |template, url|
16
17
  expect(
17
18
  LHC::Endpoint.match?(url, template)
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: 5.0.2
4
+ version: 5.0.3
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: 2017-04-26 00:00:00.000000000 Z
11
+ date: 2017-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus