createsend 6.1.0 → 6.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +5 -0
- data/createsend.gemspec +2 -1
- data/lib/createsend/createsend.rb +4 -0
- data/lib/createsend/version.rb +1 -1
- data/test/createsend_test.rb +6 -5
- metadata +11 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f3f52a5b4e7e7f22990a722f419a720a832de253aa12e7df6bc0f108f9bd90c
|
4
|
+
data.tar.gz: 0e6977d50918dc9ecac114644fb30842603644c745eea1fe93ddb9237fe202d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb9f82623a9e5c3cea4ee80891e6bb4ab158c303a59c025eee8d8f349919ed420def2b98884ba59e17b33668119f5d642cfdf99039ea9fa4eba4e4ef79140c5c
|
7
|
+
data.tar.gz: d397f0724a5e5b6428482e717eb225738c6bc03bb9a987ddd58dc9c4ad58cefff95274c42ac12ff682433d8aefdee1bfecdad9d53c5dbc3f4f380421be3573d8
|
data/HISTORY.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# createsend-ruby history
|
2
2
|
|
3
|
+
## v6.1.1 - 20 Aug 2024
|
4
|
+
* Merged support for error code 429 (rate limiting on subscribers update)
|
5
|
+
* Merged gemspec required ruby version to `>= 2.0`
|
6
|
+
* Merged `hashie` dependency to `>= 3`, `< 6`
|
7
|
+
|
3
8
|
## v6.1.0 - 27 Oct 2023
|
4
9
|
* Added support for add/update subscribers specifying mobile_number and/or consent_to_send_sms (optional parameters)
|
5
10
|
* Subscriber.Add
|
data/createsend.gemspec
CHANGED
@@ -5,7 +5,7 @@ require File.expand_path('lib/createsend/version')
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.add_runtime_dependency 'json', '>= 1.0'
|
8
|
-
s.add_runtime_dependency 'hashie', '
|
8
|
+
s.add_runtime_dependency 'hashie', '>= 3.0', '< 6'
|
9
9
|
s.add_runtime_dependency 'httparty', '~> 0.14'
|
10
10
|
s.add_development_dependency 'rake', '~> 12.3.3'
|
11
11
|
s.add_development_dependency 'fakeweb', '~> 1.3'
|
@@ -27,5 +27,6 @@ Gem::Specification.new do |s|
|
|
27
27
|
s.version = CreateSend::VERSION
|
28
28
|
s.platform = Gem::Platform::RUBY
|
29
29
|
s.required_rubygems_version = Gem::Requirement.new('>= 1.3.6') if s.respond_to? :required_rubygems_version=
|
30
|
+
s.required_ruby_version = ">=2.0"
|
30
31
|
s.licenses = ['MIT']
|
31
32
|
end
|
@@ -30,6 +30,8 @@ module CreateSend
|
|
30
30
|
class Unauthorized < CreateSendError; end
|
31
31
|
# Raised for HTTP response code of 404
|
32
32
|
class NotFound < ClientError; end
|
33
|
+
# Raised for HTTP response code of 429
|
34
|
+
class TooManyRequests < ClientError; end
|
33
35
|
|
34
36
|
# Raised for HTTP response code of 401, specifically when an OAuth token
|
35
37
|
# in invalid (Code: 120, Message: 'Invalid OAuth Token')
|
@@ -279,6 +281,8 @@ module CreateSend
|
|
279
281
|
end
|
280
282
|
when 404
|
281
283
|
raise NotFound.new
|
284
|
+
when 429
|
285
|
+
raise TooManyRequests.new
|
282
286
|
when 400...500
|
283
287
|
raise ClientError.new
|
284
288
|
when 500...600
|
data/lib/createsend/version.rb
CHANGED
data/test/createsend_test.rb
CHANGED
@@ -278,11 +278,12 @@ class CreateSendTest < Test::Unit::TestCase
|
|
278
278
|
@template = CreateSend::Template.new @auth, '98y2e98y289dh89h938389'
|
279
279
|
end
|
280
280
|
|
281
|
-
{ ["400", "Bad Request"]
|
282
|
-
["401", "Unauthorized"]
|
283
|
-
["404", "Not Found"]
|
284
|
-
["418", "I'm a teapot"]
|
285
|
-
["
|
281
|
+
{ ["400", "Bad Request"] => CreateSend::BadRequest,
|
282
|
+
["401", "Unauthorized"] => CreateSend::Unauthorized,
|
283
|
+
["404", "Not Found"] => CreateSend::NotFound,
|
284
|
+
["418", "I'm a teapot"] => CreateSend::ClientError,
|
285
|
+
["429", "Too many requests"] => CreateSend::TooManyRequests,
|
286
|
+
["500", "Server Error"] => CreateSend::ServerError
|
286
287
|
}.each do |status, exception|
|
287
288
|
context "#{status.first}, a get" do
|
288
289
|
should "raise a #{exception.name} error" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: createsend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.1.
|
4
|
+
version: 6.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Dennes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -28,16 +28,22 @@ dependencies:
|
|
28
28
|
name: hashie
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '3.0'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '6'
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
38
|
-
- - "
|
41
|
+
- - ">="
|
39
42
|
- !ruby/object:Gem::Version
|
40
43
|
version: '3.0'
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '6'
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: httparty
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -306,7 +312,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
306
312
|
requirements:
|
307
313
|
- - ">="
|
308
314
|
- !ruby/object:Gem::Version
|
309
|
-
version: '0'
|
315
|
+
version: '2.0'
|
310
316
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
311
317
|
requirements:
|
312
318
|
- - ">="
|