unresponsys 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/lib/unresponsys/client.rb +6 -0
- data/lib/unresponsys/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: ea90b44c341a434f258b7f58d271bd0c9802dc3c
|
4
|
+
data.tar.gz: db2c3236c86d41bb76a57d0c8480166a34723ebe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e78e40cadf789df9030d86fcf00a1f1456acc1b02d4d1aaa5bc5bc84ccb37cbe0914ebc2444a4eee47974074e50d1509f4fc0077f8880b79172af31f7740224
|
7
|
+
data.tar.gz: c7dfca9ecc69801d14bd530cf0766c68d1cdedef2eca5014366b4c9961198155993c115df0789c896cccebd81f89d69b4bb4fa761611a1d89480c3e81f499f74
|
data/lib/unresponsys/client.rb
CHANGED
@@ -6,12 +6,16 @@ class Unresponsys
|
|
6
6
|
raise Unresponsys::ArgumentError unless options[:username] && options[:password]
|
7
7
|
@username = options[:username]
|
8
8
|
@password = options[:password]
|
9
|
+
@debug = options[:debug]
|
10
|
+
@logger = Logger.new(STDOUT) if @debug
|
11
|
+
@log_opts = { logger: @logger, log_level: :debug, log_format: :curl }
|
9
12
|
authenticate
|
10
13
|
end
|
11
14
|
|
12
15
|
def get(path, options = {}, &block)
|
13
16
|
path = "#{@base_uri}#{path}"
|
14
17
|
options = @options.merge(options)
|
18
|
+
options = options.merge(@log_opts) if @debug
|
15
19
|
response = HTTParty.get(path, options, &block)
|
16
20
|
handle_error(response)
|
17
21
|
end
|
@@ -19,6 +23,7 @@ class Unresponsys
|
|
19
23
|
def post(path, options = {}, &block)
|
20
24
|
path = "#{@base_uri}#{path}"
|
21
25
|
options = @options.merge(options)
|
26
|
+
options = options.merge(@log_opts) if @debug
|
22
27
|
response = HTTParty.post(path, options, &block)
|
23
28
|
handle_error(response)
|
24
29
|
end
|
@@ -26,6 +31,7 @@ class Unresponsys
|
|
26
31
|
def delete(path, options = {}, &block)
|
27
32
|
path = "#{@base_uri}#{path}"
|
28
33
|
options = @options.merge(options)
|
34
|
+
options = options.merge(@log_opts) if @debug
|
29
35
|
response = HTTParty.delete(path, options, &block)
|
30
36
|
handle_error(response)
|
31
37
|
end
|
data/lib/unresponsys/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unresponsys
|
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
|
- Kevin Kimball
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|