get_response 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/get_response/request.rb +5 -0
- data/lib/get_response/version.rb +1 -1
- data/lib/get_response.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: d7f7e3027c93e34d83b9558aa6f13acc2bc3cadf
|
4
|
+
data.tar.gz: 162eb858863593b8be888aa0c81c4980eaaf8d6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f97083f2f3f3aeee8de56acbd25487889878cc56015c26524ee3b5a9ab231955fe2ffc38685c7ede1722021ca37a67b576c4c5d748637646b1375fb9ca9c24ef
|
7
|
+
data.tar.gz: 1b9648c77ee5192c01f03f1dc7f1c4876212a963eb15e16bd8629385606046fede62aabded0e66337417b064c4e5fe3a4e66bac11e22db351fb976e516dc370f
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
Add this line to your application's Gemfile:
|
6
6
|
|
7
7
|
```ruby
|
8
|
-
gem '
|
8
|
+
gem 'get_response'
|
9
9
|
```
|
10
10
|
|
11
11
|
And then execute:
|
@@ -14,7 +14,7 @@ And then execute:
|
|
14
14
|
|
15
15
|
Or install it yourself as:
|
16
16
|
|
17
|
-
$ gem install
|
17
|
+
$ gem install get_response
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
data/lib/get_response/request.rb
CHANGED
@@ -27,9 +27,14 @@ module GetResponse
|
|
27
27
|
@connection ||= Faraday.new(url: api_endpoint) do |faraday|
|
28
28
|
faraday.request :url_encoded
|
29
29
|
faraday.adapter Faraday.default_adapter
|
30
|
+
faraday.response :logger, GetResponse.config.logger if verbose?
|
30
31
|
end
|
31
32
|
end
|
32
33
|
|
34
|
+
def verbose?
|
35
|
+
GetResponse.config.verbose
|
36
|
+
end
|
37
|
+
|
33
38
|
def api_endpoint
|
34
39
|
GetResponse.config.api_endpoint || DEFAULT_API_ENDPOINT
|
35
40
|
end
|
data/lib/get_response/version.rb
CHANGED
data/lib/get_response.rb
CHANGED
@@ -3,11 +3,13 @@ require "get_response/version"
|
|
3
3
|
require "get_response/request"
|
4
4
|
require "get_response/api"
|
5
5
|
require "get_response/response"
|
6
|
+
require 'logger'
|
6
7
|
|
7
8
|
module GetResponse
|
8
9
|
class << self
|
9
10
|
def configure
|
10
11
|
yield(configuration)
|
12
|
+
configuration.logger ||= Logger.new(STDOUT)
|
11
13
|
end
|
12
14
|
|
13
15
|
def configuration
|
@@ -17,6 +19,6 @@ module GetResponse
|
|
17
19
|
end
|
18
20
|
|
19
21
|
class Config
|
20
|
-
attr_accessor :api_key, :verbose, :api_endpoint, :domain_header, :api_version
|
22
|
+
attr_accessor :api_key, :verbose, :api_endpoint, :domain_header, :api_version, :logger
|
21
23
|
end
|
22
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: get_response
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Faizal Zakaria
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|