connect_wise_rest 0.2.0 → 0.3.0

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: 24937bfeea58ac87b8073419cf78d9e42bf69086
4
- data.tar.gz: 3d8de6155555724053ec0bbd236358adf3dce4d5
3
+ metadata.gz: 92c3f8a3959e75abf08881226e4d4c2a38ff8958
4
+ data.tar.gz: 75b82e684a3eaad75b3622dbe2bec4bfac9f5197
5
5
  SHA512:
6
- metadata.gz: 91e1fdddcbc7cdef732b7ff7d895a07d05f00f7e4fb025674e670d137ff07e427b82c38c568269a3400a413397d001552d14117b72f2e0c5c6415e20b73d28f6
7
- data.tar.gz: 7bad6c2a194e07ac0f22bd180aabbd11fc891778f178f7ab6772ca3fdc2218f9f13c0715e21ac0ff41f6a0dbb446c32013a6c3c72a3af0bfe728cbf2e310b848
6
+ metadata.gz: 811e3746a8c179e3008616fc7e2cb975f0a854c73e8a28003211e7c2fe8a03e5324703232a7c9c808d2e47bc8b36270a4d298e89cc3fbec023525ae653fd37a5
7
+ data.tar.gz: c5c02793f8a4a77fab42d8885582624d6fc312d629149b3bede83e9ed32400e6d02b7f5af7f8ddeea4e0ffa13fccfc359f89f4709364183c1615ed82b0ba5240
data/.gitignore CHANGED
File without changes
data/.travis.yml CHANGED
File without changes
data/CODE_OF_CONDUCT.md CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
File without changes
File without changes
@@ -34,8 +34,11 @@ module ConnectWiseRest
34
34
  end
35
35
 
36
36
  def response
37
- @response ||= HTTParty.get(
38
- url,
37
+ @response ||= HTTParty.get(url, request_options)
38
+ end
39
+
40
+ def request_options
41
+ request_options = {
39
42
  headers: { 'Accept' => 'application/json' },
40
43
  query: self.options[:query],
41
44
  timeout: options[:timeout],
@@ -43,7 +46,11 @@ module ConnectWiseRest
43
46
  username: "#{options[:company_id]}+#{options[:public_key]}",
44
47
  password: options[:private_key]
45
48
  }
46
- )
49
+ }
50
+
51
+ request_options[:debug_output] = options[:logger] if options[:debug] && options[:logger]
52
+
53
+ request_options
47
54
  end
48
55
 
49
56
  def url
@@ -13,10 +13,12 @@ module ConnectWiseRest
13
13
  end
14
14
 
15
15
  class Configuration
16
- attr_accessor :company_id, :private_key, :public_key, :url_prefix, :version
16
+ attr_accessor :company_id, :private_key, :public_key, :url_prefix, :version, :debug, :logger
17
17
 
18
18
  def initialize
19
19
  @version = '3.0'
20
+ @debug = false
21
+ @logger = $stdout
20
22
  end
21
23
 
22
24
  def set(options = {})
File without changes
@@ -1,3 +1,3 @@
1
1
  module ConnectWiseRest
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: connect_wise_rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Pheasey
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-23 00:00:00.000000000 Z
11
+ date: 2016-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler