connect_wise_web_reports 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 085d9e2b4bb5e954cbbae643bcd48ac26960bf46
4
- data.tar.gz: bb691e363fb58740afe1e51261826ae1a0ea0564
3
+ metadata.gz: fba094c3921d23c2f6e5f9cd4179d42f135e19d0
4
+ data.tar.gz: 6309d2836c13bbc40778e5743a7647ad486f0ab0
5
5
  SHA512:
6
- metadata.gz: 580b463eaf8b94478531f6ed35e3978a2a49fac60f71593209bd5fe221db46c330cb4e5b1ce94ae872b73ae478c91752eb495484e98e0bf728be23b54f3aa5ea
7
- data.tar.gz: 296e004f1ed0de8ace35864d78475517334bdfec1d5c24894457e49ca6b8d2cc86b2a39f1c8560e8efc3bc482dd8f4857d0c54116e54e060477d68a3568a048a
6
+ metadata.gz: 999039c30e92479ce1783067dfdd68541250487efeea5c56f1f569379e96de008a58418e0714c4fb1cfbf0845d4d6ae4fcf0abde27b3524de4496521d59647f2
7
+ data.tar.gz: aabb6ce71f94186eed91d981ccd2e6f5fbe85118889debdc0c30767d68d46134cc2903cc79d16c5cff163ce49e2573f2535c49d40e5482e138be2d5c6ca4d8d5
@@ -26,4 +26,14 @@ module ConnectWiseWebReports
26
26
 
27
27
  end
28
28
 
29
+ class << self
30
+ attr_writer :logger
31
+
32
+ def logger
33
+ @logger ||= Logger.new($stdout).tap do |log|
34
+ log.progname = self.name
35
+ end
36
+ end
37
+ end
38
+
29
39
  end
@@ -10,33 +10,35 @@ module ConnectWiseWebReports
10
10
  # @param options [Hash]
11
11
  # @return [String]
12
12
  def self.url(name, options = {})
13
- url = "https://#{options[:host]}/#{options[:version]}/webreport/"
14
-
15
13
  # Report
16
- url += "?r=#{name}"
14
+ params = "r=#{name}"
17
15
 
18
16
  # API credentials
19
- url += "&c=#{options[:company_id].to_s}"
20
- url += "&u=#{options[:integrator_id].to_s}"
21
- url += "&p=#{options[:integrator_password].to_s}"
17
+ params += "&c=#{options[:company_id].to_s}"
18
+ params += "&u=#{options[:integrator_id].to_s}"
19
+ params += "&p=#{options[:integrator_password].to_s}"
22
20
 
23
21
  #order
24
- url += "&o=#{options[:order_by].to_s}" unless options[:order_by].nil?
22
+ params += "&o=#{options[:order_by].to_s}" unless options[:order_by].nil?
25
23
 
26
24
  # pagination
27
- url += "&l=#{options[:limit].to_s}" unless options[:limit].nil?
28
- url += "&s=#{options[:skip].to_s}" unless options[:skip].nil?
25
+ params += "&l=#{options[:limit].to_s}" unless options[:limit].nil?
26
+ params += "&s=#{options[:skip].to_s}" unless options[:skip].nil?
29
27
 
30
28
  # timeout
31
- url += "&t=#{options[:timeout].to_s}" unless options[:timeout].nil?
29
+ params += "&t=#{options[:timeout].to_s}" unless options[:timeout].nil?
32
30
 
33
31
  # fields
34
- url += "&f=#{options[:fields].join('&f=')}" unless options[:fields].nil? || options[:fields].empty?
32
+ params += "&f=#{options[:fields].join('&f=')}" unless options[:fields].nil? || options[:fields].empty?
35
33
 
36
34
  # conditions
37
- url += "&q=#{options[:conditions]}" unless options[:conditions].blank?
35
+ params += "&q=#{CGI.escape(options[:conditions])}" unless options[:conditions].blank?
36
+
37
+ url = "https://#{options[:host]}/#{options[:version]}/webreport/?#{params}"
38
+
39
+ ConnectWiseWebReports.logger.info url
38
40
 
39
- return URI.escape(url)
41
+ return url
40
42
  end
41
43
 
42
44
  def initialize(name, options = {})
@@ -1,3 +1,3 @@
1
1
  module ConnectWiseWebReports
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: connect_wise_web_reports
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.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-04-26 00:00:00.000000000 Z
11
+ date: 2016-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  version: '0'
134
134
  requirements: []
135
135
  rubyforge_project:
136
- rubygems_version: 2.5.0
136
+ rubygems_version: 2.5.1
137
137
  signing_key:
138
138
  specification_version: 4
139
139
  summary: Connect Wise Web Reports API Wrapper