connect_wise_web_reports 1.0.0 → 1.1.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
- SHA1:
3
- metadata.gz: 13ea7142d366213995b743f65a300efe6d99712c
4
- data.tar.gz: 1e22a61dddb0717b009526911a16aee16e46ccd7
2
+ SHA256:
3
+ metadata.gz: 2f2710b8f788407ce32a3825fbf704ae6025a038bef227613f82e348c0827296
4
+ data.tar.gz: 901ae697e594a9f46820c29840a613a11a0df019c5bb17e53b9c2b52231c3e23
5
5
  SHA512:
6
- metadata.gz: 8213c3f09c25715e0298b36543b26141203df6484ed33755570310f242100b5f4808a39d39f64e8ac00c1953f06ea32dfc59e1cec5df79bc2971062e4e9d1e83
7
- data.tar.gz: 8904a9e474fb8289f7573e8513eb6769fc77df0f50e53eb7ab1a5d5c2b20327091a9458f8b7f4355046295a2e9c7cc78d700b5f252e67931153d9f2ef53c8a40
6
+ metadata.gz: efa31f3f7950eed21f0537c7962dabfe45a69bf9746bbdb363a2532311a5e9c0ac3a54f17aab74e8d96db9d2a0349bd8234ec24c9c11cac6c53e2d511d77f9d8
7
+ data.tar.gz: 546f3550489a3b8f6499c3469ed272c749ebdacb1e7677fdb19b50e885ad1e5dfb3f1fc1564f2b1c97e6028750ea1a20672c1cc7b481f2667b26daed325f6b11
@@ -3,6 +3,7 @@ require 'nokogiri'
3
3
 
4
4
  require 'connect_wise_web_reports/version'
5
5
  require 'connect_wise_web_reports/configuration'
6
+ require 'connect_wise_web_reports/error'
6
7
  require 'connect_wise_web_reports/report'
7
8
 
8
9
  module ConnectWiseWebReports
@@ -0,0 +1,3 @@
1
+ module ConnectWiseWebReports
2
+ class ConnectionError < StandardError; end
3
+ end
@@ -51,12 +51,17 @@ module ConnectWiseWebReports
51
51
 
52
52
  # @return [Array(Hash)]
53
53
  def fetch
54
- response = ConnectWiseWebReports.agent(options).get(url)
54
+ begin
55
+ response = ConnectWiseWebReports.agent(options).get(url)
56
+ rescue StandardError => e
57
+ raise ConnectionError.new(e.message)
58
+ end
59
+
55
60
  doc = Nokogiri::XML(response.content)
56
61
 
57
62
  # raise errors if we got them
58
63
  unless doc.xpath('//error/message').empty?
59
- raise doc.xpath('//error/message').first.children.first.text
64
+ raise ConnectionError.new(doc.xpath('//error/message').first.children.first.text)
60
65
  end
61
66
 
62
67
  self.parse_records doc.xpath('//results/row')
@@ -1,3 +1,3 @@
1
1
  module ConnectWiseWebReports
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.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.0.0
4
+ version: 1.1.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: 2017-02-07 00:00:00.000000000 Z
11
+ date: 2019-01-29 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'
48
45
  - - ">="
49
46
  - !ruby/object:Gem::Version
50
47
  version: 2.7.0
48
+ - - "~>"
49
+ - !ruby/object:Gem::Version
50
+ version: '2.7'
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'
58
55
  - - ">="
59
56
  - !ruby/object:Gem::Version
60
57
  version: 2.7.0
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '2.7'
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'
68
65
  - - ">="
69
66
  - !ruby/object:Gem::Version
70
67
  version: 1.6.0
68
+ - - "~>"
69
+ - !ruby/object:Gem::Version
70
+ version: '1.6'
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'
78
75
  - - ">="
79
76
  - !ruby/object:Gem::Version
80
77
  version: 1.6.0
78
+ - - "~>"
79
+ - !ruby/object:Gem::Version
80
+ version: '1.6'
81
81
  description: 'Full support Connect Wise Web Reports API, including custom queries,
82
82
  pagination, api info, and more. '
83
83
  email:
@@ -97,6 +97,7 @@ files:
97
97
  - connect_wise_web_reports.gemspec
98
98
  - lib/connect_wise_web_reports.rb
99
99
  - lib/connect_wise_web_reports/configuration.rb
100
+ - lib/connect_wise_web_reports/error.rb
100
101
  - lib/connect_wise_web_reports/report.rb
101
102
  - lib/connect_wise_web_reports/version.rb
102
103
  homepage: https://github.com/kpheasey/connect_wise_web_reports
@@ -119,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
120
  version: '0'
120
121
  requirements: []
121
122
  rubyforge_project:
122
- rubygems_version: 2.5.1
123
+ rubygems_version: 2.7.8
123
124
  signing_key:
124
125
  specification_version: 4
125
126
  summary: Connect Wise Web Reports API Wrapper