send_sonar 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +11 -0
- data/RELEASE.md +4 -0
- data/lib/send_sonar.rb +8 -7
- data/lib/send_sonar/client.rb +5 -2
- data/lib/send_sonar/version.rb +1 -1
- data/send_sonar.gemspec +3 -2
- data/spec/integrations/simple_desk_spec.rb +1 -0
- metadata +112 -123
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0a992ed4a40afb9c3758650a5e7989113cdc0218
|
4
|
+
data.tar.gz: 92cc9c9113773985488b5739c30c0082a7c3aa86
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6b93de74f4e6bbb51e64ca1327e38ffca6a61028ac224ebd41995bd1a2782da403da1bddffb541287eb57f559704a41d7a7e5a27b64fd9d7898d2898641fd2cf
|
7
|
+
data.tar.gz: 1dea28fa9d30f7b136239aabbb4ea99a56a2b8f6d01768d05216f9733e5a407433b8e1929f245090d8b494bc01b74e4fc7e19d3c98e6d5f802750dbce8232f97
|
data/README.md
CHANGED
@@ -99,6 +99,17 @@ The response is a `SendSonar::Customer` object with the following accessors:
|
|
99
99
|
* subscribed (boolean)
|
100
100
|
* properties (hash)
|
101
101
|
|
102
|
+
## Errors
|
103
|
+
There are many reasons why requests can fail. There are custom error classes to help you figure out what went wrong.
|
104
|
+
|
105
|
+
Note, all request errors inherit from `SendSonar::RequestException`. Therefore you can rescue all request errors with `rescue SendSonar::RequestException`. The current supported error classes are:
|
106
|
+
|
107
|
+
* SendSonar::BadToken
|
108
|
+
* SendSonar::NoActiveSubscription
|
109
|
+
* SendSonar::ApiDisabledForCompany
|
110
|
+
* SendSonar::RequestTimeout
|
111
|
+
* SendSonar::ConnectionRefused
|
112
|
+
* SendSonar::UnknownRequestError (the server return an error response that your version of the gem does not recognize.)
|
102
113
|
|
103
114
|
## Support
|
104
115
|
Email api-help@sendsonar.com if you are having issues with the gem or service.
|
data/RELEASE.md
CHANGED
data/lib/send_sonar.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
1
|
+
require 'rubygems'
|
2
|
+
require 'send_sonar/version'
|
3
|
+
require 'send_sonar/configuration'
|
4
|
+
require 'send_sonar/exceptions'
|
5
|
+
require 'send_sonar/client'
|
6
|
+
require 'rest_client'
|
7
|
+
require 'ostruct'
|
8
|
+
require 'json'
|
8
9
|
|
9
10
|
module SendSonar
|
10
11
|
extend self
|
data/lib/send_sonar/client.rb
CHANGED
@@ -15,8 +15,11 @@ module SendSonar
|
|
15
15
|
else
|
16
16
|
response = e.response && JSON.parse(e.response) || {}
|
17
17
|
error = response["error"]
|
18
|
-
exception_class = Exceptions::EXCEPTIONS_MAP[error]
|
19
|
-
|
18
|
+
if exception_class = Exceptions::EXCEPTIONS_MAP[error]
|
19
|
+
raise exception_class.new(e)
|
20
|
+
else
|
21
|
+
raise "SONAR ERROR: #{e.response} - #{e.message}"
|
22
|
+
end
|
20
23
|
end
|
21
24
|
end
|
22
25
|
end
|
data/lib/send_sonar/version.rb
CHANGED
data/send_sonar.gemspec
CHANGED
@@ -6,8 +6,8 @@ require 'send_sonar/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "send_sonar"
|
8
8
|
spec.version = SendSonar::VERSION
|
9
|
-
spec.authors = ["
|
10
|
-
spec.email = ["
|
9
|
+
spec.authors = ["Matthew Berman"]
|
10
|
+
spec.email = ["matt@sendsonar.com"]
|
11
11
|
spec.summary = %q{Provides a clean and simple gem to connect to Sonar}
|
12
12
|
spec.description = ""
|
13
13
|
spec.homepage = "http://github.com/sendsonar/send_sonar_gem"
|
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_development_dependency "rspec", "~> 3.0"
|
24
24
|
spec.add_development_dependency "vcr", "~> 2.6"
|
25
25
|
spec.add_development_dependency "webmock", "~> 1.1"
|
26
|
+
spec.add_development_dependency "json"
|
26
27
|
|
27
28
|
spec.add_runtime_dependency "rest-client", '~> 1.6'
|
28
29
|
end
|
metadata
CHANGED
@@ -1,124 +1,122 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: send_sonar
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 8
|
10
|
-
version: 1.0.8
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.9
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
13
|
-
-
|
6
|
+
authors:
|
7
|
+
- Matthew Berman
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2015-10-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
21
14
|
name: bundler
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 9
|
29
|
-
segments:
|
30
|
-
- 1
|
31
|
-
- 3
|
32
|
-
version: "1.3"
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
33
20
|
type: :development
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: rake
|
37
21
|
prerelease: false
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
48
34
|
type: :development
|
49
|
-
version_requirements: *id002
|
50
|
-
- !ruby/object:Gem::Dependency
|
51
|
-
name: rspec
|
52
35
|
prerelease: false
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
63
48
|
type: :development
|
64
|
-
version_requirements: *id003
|
65
|
-
- !ruby/object:Gem::Dependency
|
66
|
-
name: vcr
|
67
49
|
prerelease: false
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: vcr
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.6'
|
78
62
|
type: :development
|
79
|
-
|
80
|
-
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.6'
|
69
|
+
- !ruby/object:Gem::Dependency
|
81
70
|
name: webmock
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.1'
|
76
|
+
type: :development
|
82
77
|
prerelease: false
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.1'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: json
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
93
90
|
type: :development
|
94
|
-
version_requirements: *id005
|
95
|
-
- !ruby/object:Gem::Dependency
|
96
|
-
name: rest-client
|
97
91
|
prerelease: false
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rest-client
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.6'
|
108
104
|
type: :runtime
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
-
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.6'
|
111
|
+
description: ''
|
112
|
+
email:
|
113
|
+
- matt@sendsonar.com
|
113
114
|
executables: []
|
114
|
-
|
115
115
|
extensions: []
|
116
|
-
|
117
116
|
extra_rdoc_files: []
|
118
|
-
|
119
|
-
|
120
|
-
- .
|
121
|
-
- .travis.yml
|
117
|
+
files:
|
118
|
+
- ".gitignore"
|
119
|
+
- ".travis.yml"
|
122
120
|
- Gemfile
|
123
121
|
- Gemfile.ruby-18
|
124
122
|
- LICENSE.txt
|
@@ -145,39 +143,30 @@ files:
|
|
145
143
|
- spec/vcr_cassettes/message_customer_bad_token.yml
|
146
144
|
- spec/vcr_cassettes/message_customer_no_subscription.yml
|
147
145
|
homepage: http://github.com/sendsonar/send_sonar_gem
|
148
|
-
licenses:
|
146
|
+
licenses:
|
149
147
|
- MIT
|
148
|
+
metadata: {}
|
150
149
|
post_install_message:
|
151
150
|
rdoc_options: []
|
152
|
-
|
153
|
-
require_paths:
|
151
|
+
require_paths:
|
154
152
|
- lib
|
155
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
156
|
-
|
157
|
-
requirements:
|
153
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
154
|
+
requirements:
|
158
155
|
- - ">="
|
159
|
-
- !ruby/object:Gem::Version
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
version: "0"
|
164
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
|
-
none: false
|
166
|
-
requirements:
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
167
160
|
- - ">="
|
168
|
-
- !ruby/object:Gem::Version
|
169
|
-
|
170
|
-
segments:
|
171
|
-
- 0
|
172
|
-
version: "0"
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: '0'
|
173
163
|
requirements: []
|
174
|
-
|
175
164
|
rubyforge_project:
|
176
|
-
rubygems_version:
|
165
|
+
rubygems_version: 2.4.6
|
177
166
|
signing_key:
|
178
|
-
specification_version:
|
167
|
+
specification_version: 4
|
179
168
|
summary: Provides a clean and simple gem to connect to Sonar
|
180
|
-
test_files:
|
169
|
+
test_files:
|
181
170
|
- spec/integrations/simple_desk_spec.rb
|
182
171
|
- spec/spec_helper.rb
|
183
172
|
- spec/vcr_cassettes/add_customer.yml
|