smtpapi 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/lib/smtpapi.rb +7 -1
- data/lib/smtpapi/version.rb +1 -1
- data/test/test.rb +7 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71a8958dd5c28bc2af91f2f21107235577d61ce5
|
4
|
+
data.tar.gz: b034f0bb43972b72d8561b75edb032357b9ec328
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68a002184699f1c26f55bbc9b23fabc25fa12816dae4ae2a31b2224d363aaf2fa787a0aa3279c4c9117605c3e00e92fa6f6db61ca9837c17903433b69ca3a225
|
7
|
+
data.tar.gz: e70963b655d554da54c824651ae411ed0970c854fb40098c6729c2597218f8811d1f8ff97a89982e134f80fbbd644acf1017a4914ac6276e8d7692249172014e
|
data/README.md
CHANGED
@@ -161,6 +161,14 @@ header = Smtpapi::Header.new
|
|
161
161
|
header.set_asm_group(2)
|
162
162
|
```
|
163
163
|
|
164
|
+
### set_ip_pool
|
165
|
+
|
166
|
+
[Using IP Pools with the SMTP API Header](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_pools.html)
|
167
|
+
```ruby
|
168
|
+
header = Smtpapi::Header.new
|
169
|
+
header.set_ip_pool("test_pool")
|
170
|
+
```
|
171
|
+
|
164
172
|
## Contributing
|
165
173
|
|
166
174
|
1. Fork it ( http://github.com/sendgridjp/smtpapi-ruby/fork )
|
data/lib/smtpapi.rb
CHANGED
@@ -6,7 +6,7 @@ require "json"
|
|
6
6
|
module Smtpapi
|
7
7
|
class Header
|
8
8
|
|
9
|
-
attr_reader :to, :sub, :section, :category, :unique_args, :filters, :send_at, :send_each_at, :asm_group_id
|
9
|
+
attr_reader :to, :sub, :section, :category, :unique_args, :filters, :send_at, :send_each_at, :asm_group_id, :ip_pool
|
10
10
|
|
11
11
|
def initialize
|
12
12
|
@to = []
|
@@ -18,6 +18,7 @@ module Smtpapi
|
|
18
18
|
@send_at = nil
|
19
19
|
@send_each_at = []
|
20
20
|
@asm_group_id = nil
|
21
|
+
@ip_pool = nil
|
21
22
|
end
|
22
23
|
|
23
24
|
def add_to(address, name=nil)
|
@@ -100,6 +101,10 @@ module Smtpapi
|
|
100
101
|
@asm_group_id = group_id
|
101
102
|
end
|
102
103
|
|
104
|
+
def set_ip_pool(pool_name)
|
105
|
+
@ip_pool = pool_name
|
106
|
+
end
|
107
|
+
|
103
108
|
def to_array
|
104
109
|
data = {}
|
105
110
|
data["to"] = @to if @to.length > 0
|
@@ -110,6 +115,7 @@ module Smtpapi
|
|
110
115
|
data["filters"] = @filters if @filters.length > 0
|
111
116
|
data["send_at"] = @send_at.to_i if @send_at != nil
|
112
117
|
data["asm_group_id"] = @asm_group_id.to_i if @asm_group_id != nil
|
118
|
+
data["ip_pool"] = @ip_pool if @ip_pool != nil
|
113
119
|
str_each_at = []
|
114
120
|
@send_each_at.each {|val|
|
115
121
|
str_each_at.push(val.to_i)
|
data/lib/smtpapi/version.rb
CHANGED
data/test/test.rb
CHANGED
@@ -5,7 +5,7 @@ require "./lib/smtpapi"
|
|
5
5
|
class SmtpapiTest < Test::Unit::TestCase
|
6
6
|
|
7
7
|
def test_version
|
8
|
-
assert_equal("0.0.
|
8
|
+
assert_equal("0.0.10", Smtpapi::VERSION)
|
9
9
|
end
|
10
10
|
|
11
11
|
def test_empty
|
@@ -139,4 +139,10 @@ class SmtpapiTest < Test::Unit::TestCase
|
|
139
139
|
assert_equal("{\"asm_group_id\":2}", header.json_string)
|
140
140
|
end
|
141
141
|
|
142
|
+
def test_ip_pool
|
143
|
+
header = Smtpapi::Header.new
|
144
|
+
header.set_ip_pool("test_pool")
|
145
|
+
|
146
|
+
assert_equal("{\"ip_pool\":\"test_pool\"}", header.json_string)
|
147
|
+
end
|
142
148
|
end
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smtpapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wataru Sato
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.5'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
description: Smtpapi library for SendGrid.
|
@@ -45,8 +45,8 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
-
|
49
|
-
-
|
48
|
+
- .gitignore
|
49
|
+
- .travis.yml
|
50
50
|
- Gemfile
|
51
51
|
- LICENSE.txt
|
52
52
|
- README.md
|
@@ -65,17 +65,17 @@ require_paths:
|
|
65
65
|
- lib
|
66
66
|
required_ruby_version: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- -
|
68
|
+
- - '>='
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
requirements: []
|
77
77
|
rubyforge_project:
|
78
|
-
rubygems_version: 2.
|
78
|
+
rubygems_version: 2.2.2
|
79
79
|
signing_key:
|
80
80
|
specification_version: 4
|
81
81
|
summary: Smtpapi library for SendGrid.
|