served 0.1.8 → 0.1.9

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: 466e2def975e298806ecdef050c3c735823a3a95
4
- data.tar.gz: 5ee4e6779cd2ec8f28c6121bb8e7b4a0a3e11f4d
3
+ metadata.gz: 0f60cc4816f9f700e5482733b0be0c1bc9ff2a60
4
+ data.tar.gz: d297cddb3b2d302f3cb95ccdc7a1198301e7d4f8
5
5
  SHA512:
6
- metadata.gz: 1ee891ea98ac7805ed1b5b39bb689131fd7c2fd46c693725f9eb8b2a43803d0df72e62b379be8293bf4a0291198fff1b1f7a8a4e3a48ba077a4074b18f345771
7
- data.tar.gz: 78c97fc01bceaf808b868afee6a26bfc2206481c84e4d52457f97a8bfd2352a2bd8577e749c76a1bc87bf6079c48abcd5d9627caa73d90b441f76735280c7cab
6
+ metadata.gz: 7bfdae6756227d4ee49828765ac51f5a9ea54bdedc9e6ccdac4bc540164fbbc371f099f361fecf76842ba700986e9aff4c5f3cc45c9be251f3db38db979cdcd4
7
+ data.tar.gz: 2062eaf3b848fb0ad2bf96427b13bfbf135af5a85c3018cdf77d9b25be5ad56a35f768781de733985aee21ce251924a3bdbcb12f3f84924d9caa7889a733003a
@@ -3,12 +3,10 @@ module Served
3
3
  # Provides an interface between HTTParty and the models. Most of the crap in here is self explanatory
4
4
  class HTTPClient
5
5
  HEADERS = { 'Content-type' => 'application/json', 'Accept' => 'application/json' }
6
- DEFAULT_TEMPLATE = '{resource}{/id}.json{?query*}'
6
+ DEFAULT_TEMPLATE = '{/resource*}{/id}.json{?query*}'
7
7
 
8
8
  def initialize(host)
9
- unless host =~ /{.+}/
10
- host = "#{host}/#{DEFAULT_TEMPLATE}"
11
- end
9
+ host += DEFAULT_TEMPLATE unless host =~ /{.+}/
12
10
  @template = Addressable::Template.new(host)
13
11
  end
14
12
 
@@ -35,4 +33,4 @@ module Served
35
33
  )
36
34
  end
37
35
  end
38
- end
36
+ end
@@ -10,9 +10,11 @@ module Served
10
10
 
11
11
  # raised when the connection receives a response from a service that does not constitute a 200
12
12
  class ServiceError < StandardError
13
+ attr_reader :response
14
+
13
15
  def initialize(response)
14
- @code = response.code
15
- super "An error occurred making the request: #{@code}"
16
+ @response = response
17
+ super "An error occurred making the request: #{@response.code}"
16
18
  end
17
19
  end
18
20
 
@@ -162,4 +164,4 @@ module Served
162
164
  end
163
165
  end
164
166
  end
165
- end
167
+ end
@@ -1,3 +1,3 @@
1
1
  module Served
2
- VERSION = '0.1.8'
2
+ VERSION = '0.1.9'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: served
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jarod Reid
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-17 00:00:00.000000000 Z
11
+ date: 2016-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty