clientele 0.3.12 → 0.3.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/clientele/api.rb +3 -1
- data/lib/clientele/configuration.rb +7 -6
- data/lib/clientele/request.rb +2 -1
- data/lib/clientele/utils.rb +1 -1
- data/lib/clientele/version.rb +1 -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: dc552f54b5318617ee7a3ef13a17a6d77c9b2522
|
4
|
+
data.tar.gz: d4dbabbce83092be75b00ae04a74ae992887fb09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbada55602e3bc8ac17c88715403a8b36f37571f7ae23288f1c8210eb94382fc91744d0760914f92075922c7100eca2b742b8abce16336926567cec27b9d4ef6
|
7
|
+
data.tar.gz: 43b09d58a722ea64b61a15d69764325e0c9b3ca09d944eb52a48ffa988a60d72a0b653cf7cb84a845b313565f15a5d19e703d742e4db322d09021be06a978256
|
data/lib/clientele/api.rb
CHANGED
@@ -16,7 +16,9 @@ module Clientele
|
|
16
16
|
configure_with Configuration
|
17
17
|
|
18
18
|
extend SingleForwardable
|
19
|
-
|
19
|
+
extend Forwardable
|
20
|
+
def_single_delegator :configuration, :logger
|
21
|
+
def_instance_delegator self, :has_resource?
|
20
22
|
|
21
23
|
class_attribute :resources, instance_predicate: false
|
22
24
|
self.resources = Hashie::Rash.new
|
@@ -8,12 +8,13 @@ module Clientele
|
|
8
8
|
attr_accessor :logger, :adapter, :headers, :hashify_content_type, :root_url, :follow_redirects, :redirect_limit
|
9
9
|
|
10
10
|
def initialize
|
11
|
-
self.logger
|
12
|
-
self.adapter
|
13
|
-
self.headers
|
14
|
-
self.hashify_content_type
|
15
|
-
self.follow_redirects
|
16
|
-
self.redirect_limit
|
11
|
+
self.logger = Logger.new($stdout)
|
12
|
+
self.adapter = Faraday.default_adapter
|
13
|
+
self.headers = {}
|
14
|
+
self.hashify_content_type = /\bjson$/
|
15
|
+
self.follow_redirects = true
|
16
|
+
self.redirect_limit = 5
|
17
|
+
self.ensure_trailing_slash = true
|
17
18
|
end
|
18
19
|
|
19
20
|
end
|
data/lib/clientele/request.rb
CHANGED
@@ -81,7 +81,8 @@ module Clientele
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def response
|
84
|
-
|
84
|
+
request_path = options[:ensure_trailing_slash] ? ensure_trailing_slash(path) : path
|
85
|
+
@response ||= faraday_client.send(verb, request_path) do |request|
|
85
86
|
request.headers = options.fetch(:headers, {}).merge(headers)
|
86
87
|
request.params = deep_camelize_keys(query)
|
87
88
|
request.body = JSON.dump(deep_camelize_keys(body))
|
data/lib/clientele/utils.rb
CHANGED
data/lib/clientele/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clientele
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Keele
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|