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 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
@@ -1,3 +1,7 @@
1
+ v 1.0.9
2
+ -------
3
+ Temporary solution giving more information about why a request failed.
4
+
1
5
  v 1.0.0
2
6
  -------
3
7
  Configuration is now done through an initializer
data/lib/send_sonar.rb CHANGED
@@ -1,10 +1,11 @@
1
- require "send_sonar/version"
2
- require "send_sonar/configuration"
3
- require "send_sonar/exceptions"
4
- require "send_sonar/client"
5
- require "rest_client"
6
- require "ostruct"
7
- require "json"
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
@@ -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] || UnknownRequestError
19
- raise exception_class.new(e)
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
@@ -1,3 +1,3 @@
1
1
  module SendSonar
2
- VERSION = "1.0.8"
2
+ VERSION = "1.0.9"
3
3
  end
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 = ["John Gesimondo"]
10
- spec.email = ["john@jmondo.com"]
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
@@ -61,6 +61,7 @@ describe 'SendSonar' do
61
61
  end
62
62
  end
63
63
  end
64
+
64
65
  end
65
66
 
66
67
  describe '.add_customer' do
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
- hash: 7
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
- - John Gesimondo
6
+ authors:
7
+ - Matthew Berman
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2014-12-11 00:00:00 Z
19
- dependencies:
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
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
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
- requirement: &id002 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ~>
42
- - !ruby/object:Gem::Version
43
- hash: 35
44
- segments:
45
- - 10
46
- - 0
47
- version: "10.0"
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
- requirement: &id003 !ruby/object:Gem::Requirement
54
- none: false
55
- requirements:
56
- - - ~>
57
- - !ruby/object:Gem::Version
58
- hash: 7
59
- segments:
60
- - 3
61
- - 0
62
- version: "3.0"
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
- requirement: &id004 !ruby/object:Gem::Requirement
69
- none: false
70
- requirements:
71
- - - ~>
72
- - !ruby/object:Gem::Version
73
- hash: 15
74
- segments:
75
- - 2
76
- - 6
77
- version: "2.6"
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
- version_requirements: *id004
80
- - !ruby/object:Gem::Dependency
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
- requirement: &id005 !ruby/object:Gem::Requirement
84
- none: false
85
- requirements:
86
- - - ~>
87
- - !ruby/object:Gem::Version
88
- hash: 13
89
- segments:
90
- - 1
91
- - 1
92
- version: "1.1"
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
- requirement: &id006 !ruby/object:Gem::Requirement
99
- none: false
100
- requirements:
101
- - - ~>
102
- - !ruby/object:Gem::Version
103
- hash: 3
104
- segments:
105
- - 1
106
- - 6
107
- version: "1.6"
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
- version_requirements: *id006
110
- description: ""
111
- email:
112
- - john@jmondo.com
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
- files:
120
- - .gitignore
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
- none: false
157
- requirements:
153
+ required_ruby_version: !ruby/object:Gem::Requirement
154
+ requirements:
158
155
  - - ">="
159
- - !ruby/object:Gem::Version
160
- hash: 3
161
- segments:
162
- - 0
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
- hash: 3
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: 1.8.0
165
+ rubygems_version: 2.4.6
177
166
  signing_key:
178
- specification_version: 3
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