connect_wise_web_reports 1.1.0 → 1.2.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
  SHA256:
3
- metadata.gz: 2f2710b8f788407ce32a3825fbf704ae6025a038bef227613f82e348c0827296
4
- data.tar.gz: 901ae697e594a9f46820c29840a613a11a0df019c5bb17e53b9c2b52231c3e23
3
+ metadata.gz: d540da79a8a705ee50c08cf77d2be09da1b66982b9097d00813b7aa0bc3ba1e7
4
+ data.tar.gz: efbe93fc0de07f204be4b6e541f793f54b1fba2c26424a692469e4cc53e4517f
5
5
  SHA512:
6
- metadata.gz: efa31f3f7950eed21f0537c7962dabfe45a69bf9746bbdb363a2532311a5e9c0ac3a54f17aab74e8d96db9d2a0349bd8234ec24c9c11cac6c53e2d511d77f9d8
7
- data.tar.gz: 546f3550489a3b8f6499c3469ed272c749ebdacb1e7677fdb19b50e885ad1e5dfb3f1fc1564f2b1c97e6028750ea1a20672c1cc7b481f2667b26daed325f6b11
6
+ metadata.gz: 96dc9e0ac77beaea29649142df6989d00ef2b25e1fc1a62bc0304174197b8e040e31155be229fd461f8497dcfc5b7a33a8b13107673ee16de3cc498d6c8ad906
7
+ data.tar.gz: 19b4a2715ed9b961f4bfa1f4b78ae939f74a582c22bb6a6e9cf77fdb8b9e12cef05f41503959a9ef750c07ae0ebe00fc3f2ed45344a274d860747d15e678842b
data/.gitignore CHANGED
@@ -8,3 +8,4 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  .idea/
11
+ *.gem
File without changes
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
@@ -7,38 +7,35 @@ require 'connect_wise_web_reports/error'
7
7
  require 'connect_wise_web_reports/report'
8
8
 
9
9
  module ConnectWiseWebReports
10
-
11
10
  DEFAULT_OPTIONS = {
12
- conditions: nil,
13
- fields: [],
14
- limit: 100,
15
- order_by: nil,
16
- skip: nil,
17
- timeout: 5,
18
-
19
- # authentication
20
- host: ConnectWiseWebReports.configuration.host,
21
- company_id: ConnectWiseWebReports.configuration.company_id,
22
- integrator_id: ConnectWiseWebReports.configuration.integrator_id,
23
- integrator_password: ConnectWiseWebReports.configuration.integrator_password,
24
- version: ConnectWiseWebReports.configuration.version,
25
- proxy_host: ConnectWiseWebReports.configuration.proxy_host,
26
- proxy_port: ConnectWiseWebReports.configuration.proxy_port,
27
- proxy_user: ConnectWiseWebReports.configuration.proxy_user,
28
- proxy_pass: ConnectWiseWebReports.configuration.proxy_pass
29
- }
11
+ conditions: nil,
12
+ fields: [],
13
+ limit: 100,
14
+ order_by: nil,
15
+ skip: nil,
16
+ timeout: 5,
17
+
18
+ # authentication
19
+ host: ConnectWiseWebReports.configuration.host,
20
+ company_id: ConnectWiseWebReports.configuration.company_id,
21
+ integrator_id: ConnectWiseWebReports.configuration.integrator_id,
22
+ integrator_password: ConnectWiseWebReports.configuration.integrator_password,
23
+ version: ConnectWiseWebReports.configuration.version,
24
+ proxy_host: ConnectWiseWebReports.configuration.proxy_host,
25
+ proxy_port: ConnectWiseWebReports.configuration.proxy_port,
26
+ proxy_user: ConnectWiseWebReports.configuration.proxy_user,
27
+ proxy_pass: ConnectWiseWebReports.configuration.proxy_pass
28
+ }.freeze
30
29
 
31
30
  # Create a new Mechanize agent.
32
31
  #
33
32
  # @return [Mechanize]
34
33
  def self.agent(options)
35
34
  Mechanize.new do |agent|
36
- agent.set_proxy(
37
- options[:proxy_host],
38
- options[:proxy_port],
39
- options[:proxy_user],
40
- options[:proxy_pass]
41
- ) unless options[:proxy_host].nil?
35
+ if options[:proxy_host]
36
+ agent.set_proxy(options[:proxy_host], options[:proxy_port],
37
+ options[:proxy_user], options[:proxy_pass])
38
+ end
42
39
 
43
40
  agent.read_timeout = options[:timeout]
44
41
  agent.keep_alive = false
@@ -51,11 +48,11 @@ module ConnectWiseWebReports
51
48
  url = "https://#{options[:host]}/login/companyinfo/#{options[:company_id]}"
52
49
  response = agent(options).get(url)
53
50
 
54
- if response.content == 'null'
55
- return {}
56
- else
57
- return JSON.parse(response.content)
58
- end
51
+ return {} if response.content == 'null'
52
+
53
+ JSON.parse(response.content)
54
+ rescue StandardError => e
55
+ raise ConnectionError.new(e.message)
59
56
  end
60
57
 
61
58
  end
File without changes
File without changes
@@ -1,3 +1,3 @@
1
1
  module ConnectWiseWebReports
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.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: 1.1.0
4
+ version: 1.2.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: 2019-01-29 00:00:00.000000000 Z
11
+ date: 2019-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -42,42 +42,42 @@ dependencies:
42
42
  name: mechanize
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: 2.7.0
48
45
  - - "~>"
49
46
  - !ruby/object:Gem::Version
50
47
  version: '2.7'
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 2.7.0
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- version: 2.7.0
58
55
  - - "~>"
59
56
  - !ruby/object:Gem::Version
60
57
  version: '2.7'
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 2.7.0
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: nokogiri
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: 1.6.0
68
65
  - - "~>"
69
66
  - !ruby/object:Gem::Version
70
67
  version: '1.6'
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: 1.6.0
71
71
  type: :runtime
72
72
  prerelease: false
73
73
  version_requirements: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- version: 1.6.0
78
75
  - - "~>"
79
76
  - !ruby/object:Gem::Version
80
77
  version: '1.6'
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: 1.6.0
81
81
  description: 'Full support Connect Wise Web Reports API, including custom queries,
82
82
  pagination, api info, and more. '
83
83
  email:
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  version: '0'
121
121
  requirements: []
122
122
  rubyforge_project:
123
- rubygems_version: 2.7.8
123
+ rubygems_version: 2.7.6
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: Connect Wise Web Reports API Wrapper