mail-x_smtpapi 1.1.0 → 1.2.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
2
  SHA1:
3
- metadata.gz: 5d408edd7f988abd94b223dc828886644da7fda2
4
- data.tar.gz: b9db873259f110c46d2369c1e4d7f3b83b2f1366
3
+ metadata.gz: 0ad63c7dc51b015c77377b0a011860de65d25d89
4
+ data.tar.gz: ece9b680c52f0259141a3e35ef9abc2bdaaada78
5
5
  SHA512:
6
- metadata.gz: 03ae17f61ab25a1688b2a9962390aafc81bf3d0d30d66141d88cbf747905a73f31fec5b500443bf789618923cd7db5a270058b530c4672ca9aaeb50022f5ecd2
7
- data.tar.gz: a43fe148232eac0fdf5d52930f49a9e634e075e3cca3c6d55d9eb6c54eeb49385fa91f77e2be184de2bd9d2b7e2862a3fd2bcafe71242921b717c05186c5ada3
6
+ metadata.gz: b2dd23f27a36f54b3fb0d8ae26e125bea10b836493e05f48d79ade01410297327b51fabfc0895b28ca9c98bdd029ae16b0dfa78f13672aacdfffd27c184b64d2
7
+ data.tar.gz: 0c3990f7a944b913f76852354eb1aaade19022f4cd53852f2bf62f181eb4b7f5fec2d55ba36ad1fc19ad312e5fc3b28f77a7c5c1e6b2f6324d84c1909f796329
@@ -0,0 +1 @@
1
+ 2.3.1
@@ -0,0 +1,7 @@
1
+ appraise "mail-2.6" do
2
+ gem "mail", "~> 2.6.0"
3
+ end
4
+
5
+ appraise "mail-2.7" do
6
+ gem "mail", "~> 2.7.0"
7
+ end
@@ -0,0 +1,29 @@
1
+ # CHANGELOG
2
+
3
+ ## Version 1.2.0
4
+
5
+ ### Non-breaking changes
6
+
7
+ * fixes for compatibility with mail 2.7.0 (@cainlevy)
8
+
9
+ ## Version 1.1.0
10
+
11
+ ### Non-breaking changes
12
+
13
+ * add support for asm_group_id, PR #2 (@stevewilhelm)
14
+
15
+ ## Version 1.0.2
16
+
17
+ ### Non-breaking changes
18
+
19
+ * add minitest dependency
20
+ * declare dependency on ruby 2.3.1
21
+
22
+ ## Version 1.0.1
23
+
24
+ ### Non-breaking changes
25
+
26
+ * changed underlying key for sections() from 'sections' to 'section'
27
+
28
+ ## Version 1.0.0
29
+
data/circle.yml CHANGED
@@ -1,3 +1,10 @@
1
1
  machine:
2
2
  ruby:
3
3
  version: 2.3.1
4
+
5
+ dependencies:
6
+ post:
7
+ - bundle exec appraisal install
8
+ test:
9
+ override:
10
+ - bundle exec appraisal rake test
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "mail", "~> 2.6.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,35 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ mail-x_smtpapi (1.1.0)
5
+ mail (> 2.6.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ appraisal (2.2.0)
11
+ bundler
12
+ rake
13
+ thor (>= 0.14.0)
14
+ mail (2.6.6)
15
+ mime-types (>= 1.16, < 4)
16
+ mime-types (3.1)
17
+ mime-types-data (~> 3.2015)
18
+ mime-types-data (3.2016.0521)
19
+ minitest (5.10.3)
20
+ rake (10.5.0)
21
+ thor (0.20.0)
22
+
23
+ PLATFORMS
24
+ ruby
25
+
26
+ DEPENDENCIES
27
+ appraisal
28
+ bundler (~> 1.7)
29
+ mail (~> 2.6.0)
30
+ mail-x_smtpapi!
31
+ minitest
32
+ rake (~> 10.0)
33
+
34
+ BUNDLED WITH
35
+ 1.16.0
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "mail", "~> 2.7.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,33 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ mail-x_smtpapi (1.1.0)
5
+ mail (> 2.6.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ appraisal (2.2.0)
11
+ bundler
12
+ rake
13
+ thor (>= 0.14.0)
14
+ mail (2.7.0)
15
+ mini_mime (>= 0.1.1)
16
+ mini_mime (1.0.0)
17
+ minitest (5.10.3)
18
+ rake (10.5.0)
19
+ thor (0.20.0)
20
+
21
+ PLATFORMS
22
+ ruby
23
+
24
+ DEPENDENCIES
25
+ appraisal
26
+ bundler (~> 1.7)
27
+ mail (~> 2.7.0)
28
+ mail-x_smtpapi!
29
+ minitest
30
+ rake (~> 10.0)
31
+
32
+ BUNDLED WITH
33
+ 1.16.0
@@ -2,7 +2,7 @@ module MailXSMTPAPI
2
2
 
3
3
  module Recipients
4
4
  def to
5
- value['to'] ||= []
5
+ data['to'] ||= []
6
6
  end
7
7
 
8
8
  def to=(val)
@@ -13,7 +13,7 @@ module MailXSMTPAPI
13
13
 
14
14
  module Substitutions
15
15
  def substitutions
16
- value['sub'] ||= {}
16
+ data['sub'] ||= {}
17
17
  end
18
18
 
19
19
  def substitutions=(val)
@@ -30,7 +30,7 @@ module MailXSMTPAPI
30
30
 
31
31
  module UniqueArguments
32
32
  def unique_args
33
- value['unique_args'] ||= {}
33
+ data['unique_args'] ||= {}
34
34
  end
35
35
 
36
36
  def unique_args=(val)
@@ -41,33 +41,33 @@ module MailXSMTPAPI
41
41
 
42
42
  module Category
43
43
  def category
44
- value['category']
44
+ data['category']
45
45
  end
46
46
 
47
47
  def category=(val)
48
- value['category'] = val
48
+ data['category'] = val
49
49
  end
50
50
  end
51
51
 
52
52
  module AsmGroupId
53
53
  def asm_group_id
54
- value['asm_group_id']
54
+ data['asm_group_id']
55
55
  end
56
56
 
57
57
  def asm_group_id=(val)
58
- value['asm_group_id'] = val
58
+ data['asm_group_id'] = val
59
59
  end
60
60
  end
61
61
 
62
62
  module Filters
63
63
  def filters
64
- value['filters'] ||= {}
64
+ data['filters'] ||= {}
65
65
  end
66
66
  end
67
67
 
68
68
  module Sections
69
69
  def sections
70
- value['section'] ||= {}
70
+ data['section'] ||= {}
71
71
  end
72
72
  end
73
73
 
@@ -7,6 +7,8 @@ module MailXSMTPAPI
7
7
  FIELD_NAME = 'x-smtpapi'
8
8
  CAPITALIZED_FIELD = 'X-SMTPAPI'
9
9
 
10
+ attr_reader :data
11
+
10
12
  # Accessors
11
13
  include Recipients
12
14
  include Substitutions
@@ -19,7 +21,11 @@ module MailXSMTPAPI
19
21
  def initialize(value = nil, charset = 'utf-8')
20
22
  self.charset = charset
21
23
  self.name = CAPITALIZED_FIELD
22
- self.value = value || {}
24
+ @data = value || {}
25
+ end
26
+
27
+ def value
28
+ JSON.generate(data)
23
29
  end
24
30
 
25
31
  def encoded
@@ -33,11 +39,11 @@ module MailXSMTPAPI
33
39
  # to take advantage of folding, decoded must return a string of
34
40
  # JSON with extra spaces inserted for line wrapping.
35
41
  def decoded
36
- JSON.generate(value).gsub(/(["\]}])([,:])(["\[{])/, '\\1\\2 \\3')
42
+ value.gsub(/(["\]}])([,:])(["\[{])/, '\\1\\2 \\3')
37
43
  end
38
44
 
39
45
  def empty?
40
- value.values.all?{|v| !v || v.empty? }
46
+ data.values.all?{|v| !v || v.empty? }
41
47
  end
42
48
  end
43
49
  end
@@ -1,3 +1,3 @@
1
1
  module MailXSMTPAPI
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
3
3
  end
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.add_development_dependency "bundler", "~> 1.7"
21
21
  spec.add_development_dependency "rake", "~> 10.0"
22
22
  spec.add_development_dependency "minitest"
23
+ spec.add_development_dependency "appraisal"
23
24
 
24
25
  spec.add_dependency "mail", "> 2.6.0"
25
26
  end
@@ -6,10 +6,11 @@ class MailIntegrationTest < Minitest::Test
6
6
  assert subject.smtpapi
7
7
  assert subject.smtpapi.empty?
8
8
 
9
- subject.smtpapi.value['to'] = 'c@example.com'
9
+ subject.smtpapi.data['to'] = 'c@example.com'
10
10
  refute subject.smtpapi.empty?
11
11
 
12
- assert_equal 'c@example.com', subject.smtpapi.value['to']
12
+ assert_equal 'c@example.com', subject.smtpapi.data['to']
13
+ assert_equal '{"to":"c@example.com"}', subject.smtpapi.value
13
14
  end
14
15
 
15
16
  def test_hash_reader
@@ -19,7 +20,8 @@ class MailIntegrationTest < Minitest::Test
19
20
 
20
21
  def test_hash_writer
21
22
  subject['x-smtpapi'] = {'to' => 'c@example.com'}
22
- assert_equal 'c@example.com', subject.smtpapi.value['to']
23
+ assert_equal 'c@example.com', subject.smtpapi.data['to']
24
+ assert_equal '{"to":"c@example.com"}', subject.smtpapi.value
23
25
  end
24
26
 
25
27
  def test_limited_field
@@ -27,7 +29,8 @@ class MailIntegrationTest < Minitest::Test
27
29
  subject['x-smtpapi'] = {'to' => 'd@example.com'}
28
30
 
29
31
  refute subject['x-smtpapi'].is_a?(Array)
30
- assert_equal 'd@example.com', subject['x-smtpapi'].value['to']
32
+ assert_equal 'd@example.com', subject['x-smtpapi'].data['to']
33
+ assert_equal '{"to":"d@example.com"}', subject.smtpapi.value
31
34
  end
32
35
 
33
36
  def test_field_name
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail-x_smtpapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lance Ivy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-14 00:00:00.000000000 Z
11
+ date: 2018-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: appraisal
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: mail
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -74,11 +88,18 @@ extensions: []
74
88
  extra_rdoc_files: []
75
89
  files:
76
90
  - ".gitignore"
91
+ - ".ruby-version"
92
+ - Appraisals
93
+ - CHANGELOG.md
77
94
  - Gemfile
78
95
  - LICENSE.txt
79
96
  - README.md
80
97
  - Rakefile
81
98
  - circle.yml
99
+ - gemfiles/mail_2.6.gemfile
100
+ - gemfiles/mail_2.6.gemfile.lock
101
+ - gemfiles/mail_2.7.gemfile
102
+ - gemfiles/mail_2.7.gemfile.lock
82
103
  - lib/mail-x_smtpapi.rb
83
104
  - lib/mail/x_smtpapi.rb
84
105
  - lib/mail_x_smtpapi/accessors.rb
@@ -109,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
130
  version: '0'
110
131
  requirements: []
111
132
  rubyforge_project:
112
- rubygems_version: 2.6.4
133
+ rubygems_version: 2.5.1
113
134
  signing_key:
114
135
  specification_version: 4
115
136
  summary: Adds SendGrid X-SMTPAPI header support to Mail