send_grid_mailer 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6369b54f6cbfc0e494a9606d3e6a9f670d832bba
4
- data.tar.gz: affe41703f5103c95f4525d7abf874d12f76767c
3
+ metadata.gz: e6d6d84b5829afa21ab215e02bece2ccaba7d7ac
4
+ data.tar.gz: cae30204663988eda53caeebe064852b2faf96c3
5
5
  SHA512:
6
- metadata.gz: 609fdbac2320946fb4d7a5e1318ee43ddd364e8bfddd4b7f3e3fddc549183bb524e240926809711bd0482b0580f1e7dd795a3a4c6590d36e0b6d0f8087ecd056
7
- data.tar.gz: b3a04095dbd990a56424f8a56df8cbd51bd6873e718e394a752f29f57c245bc9c3ee8a41774291f98b51a80db30c877da0a94864f0cd38f83d028327c9ae001c
6
+ metadata.gz: 6ab1e75330adca90bcb39ef0084c0f930ee8b3974e7462da0d735f7efc441cd097514eb7db02e95b9b020ac20c7a828316db9a1e2587ce90a097073fc44152a0
7
+ data.tar.gz: 0d7c96e6ccad96a206b1693861a5df4e1ed8ced8a4e7f636551a6c8a48111f55bf1169d0abd4af8302e59fd73a8933313c78410aa64227084940580695d52a0f
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ### v0.4.0
6
+
7
+ ##### Changed
8
+
9
+ * Change Rails version to be "optimistic" in order to use the gem with Rails 5 too.
10
+
5
11
  ### v0.3.0
6
12
 
7
13
  ##### Added
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- send_grid_mailer (0.3.0)
5
- rails (~> 4.2, >= 4.2.0)
4
+ send_grid_mailer (0.4.0)
5
+ rails (>= 4.2.0)
6
6
  sendgrid-ruby (~> 4.0, >= 4.0.4)
7
7
 
8
8
  GEM
@@ -63,8 +63,8 @@ GEM
63
63
  railties (>= 3.0.0)
64
64
  ffi (1.9.14)
65
65
  formatador (0.2.5)
66
- globalid (0.3.7)
67
- activesupport (>= 4.1.0)
66
+ globalid (0.4.0)
67
+ activesupport (>= 4.2.0)
68
68
  guard (2.14.0)
69
69
  formatador (>= 0.2.4)
70
70
  listen (>= 2.7, < 4.0)
@@ -163,8 +163,8 @@ GEM
163
163
  rspec-support (~> 3.4.0)
164
164
  rspec-support (3.4.1)
165
165
  ruby_dep (1.4.0)
166
- ruby_http_client (3.0.1)
167
- sendgrid-ruby (4.0.7)
166
+ ruby_http_client (3.0.2)
167
+ sendgrid-ruby (4.0.8)
168
168
  ruby_http_client (~> 3.0.1)
169
169
  shellany (0.0.1)
170
170
  simplecov (0.12.0)
@@ -16,7 +16,8 @@ module SendGridMailer
16
16
 
17
17
  def substitute(key, value, default = "")
18
18
  personalization.substitutions = SendGrid::Substitution.new(
19
- key: key, value: value.to_s || default)
19
+ key: key, value: value.to_s || default
20
+ )
20
21
  end
21
22
 
22
23
  def set_template_id(value)
@@ -26,8 +26,8 @@ module SendGridMailer
26
26
  response = sg_api.client.templates.get
27
27
 
28
28
  if response.status_code != "200"
29
- raise(SendGridMailer::Exception.new(
30
- "Error trying to get templates. Status Code: #{response.status_code}"))
29
+ m = "Error trying to get templates. Status Code: #{response.status_code}"
30
+ raise SendGridMailer::Exception.new(m)
31
31
  end
32
32
 
33
33
  JSON.parse(response.body)["templates"].each do |tpl|
@@ -35,8 +35,8 @@ module SendGridMailer
35
35
  end
36
36
 
37
37
  if !definition.template_id?
38
- raise(SendGridMailer::Exception.new(
39
- "No template with name #{definition.template_name}"))
38
+ m = "No template with name #{definition.template_name}"
39
+ raise SendGridMailer::Exception.new(m)
40
40
  end
41
41
  end
42
42
 
@@ -48,7 +48,7 @@ module ActionMailer
48
48
  attachment.read,
49
49
  attachment.filename,
50
50
  attachment.content_type.to_s.split(";").first,
51
- ((attachment.content_disposition =~ /inline/) ? 'inline' : 'attachment'),
51
+ attachment.content_disposition =~ /inline/ ? 'inline' : 'attachment',
52
52
  attachment.content_id
53
53
  )
54
54
  end
@@ -75,8 +75,9 @@ module ActionMailer
75
75
  paths = Array(templates_path)
76
76
  template = lookup_context.find_all(templates_name, paths).first
77
77
 
78
- raise ActionView::MissingTemplate.new(
79
- paths, templates_name, paths, false, 'mailer') unless template
78
+ if !template
79
+ raise ActionView::MissingTemplate.new(paths, templates_name, paths, false, 'mailer')
80
+ end
80
81
 
81
82
  set_content(render(template: template), template.type.to_s)
82
83
  end
@@ -1,3 +1,3 @@
1
1
  module SendGridMailer
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  s.test_files = Dir["spec/**/*"]
21
21
 
22
- s.add_dependency "rails", "~> 4.2", ">= 4.2.0"
22
+ s.add_dependency "rails", ">= 4.2.0"
23
23
  s.add_dependency "sendgrid-ruby", "~> 4.0", ">= 4.0.4"
24
24
  s.add_development_dependency "pry"
25
25
  s.add_development_dependency "pry-rails"
@@ -1,13 +1,13 @@
1
-  (58.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2
-  (0.2ms) select sqlite_version(*)
3
-  (3.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
- ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
- ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
6
-  (6.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
7
-  (0.2ms) select sqlite_version(*)
8
-  (4.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
9
-  (0.2ms) SELECT version FROM "schema_migrations"
10
-  (5.4ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
1
+  (3.7ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2
+  (0.1ms) select sqlite_version(*)
3
+  (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
6
+  (7.6ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
7
+  (0.1ms) select sqlite_version(*)
8
+  (5.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
9
+  (0.1ms) SELECT version FROM "schema_migrations"
10
+  (6.5ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
11
11
  ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
12
12
   (0.2ms) begin transaction
13
13
   (0.1ms) rollback transaction
@@ -23,14 +23,14 @@
23
23
   (0.1ms) rollback transaction
24
24
   (0.1ms) begin transaction
25
25
   (0.1ms) rollback transaction
26
-  (0.1ms) begin transaction
26
+  (0.2ms) begin transaction
27
27
   (0.1ms) rollback transaction
28
28
   (0.1ms) begin transaction
29
29
   (0.1ms) rollback transaction
30
30
   (0.1ms) begin transaction
31
-  (0.1ms) rollback transaction
31
+  (0.0ms) rollback transaction
32
32
   (0.1ms) begin transaction
33
-  (0.1ms) rollback transaction
33
+  (0.0ms) rollback transaction
34
34
   (0.1ms) begin transaction
35
35
   (0.1ms) rollback transaction
36
36
   (0.1ms) begin transaction
@@ -39,7 +39,7 @@
39
39
   (0.1ms) rollback transaction
40
40
   (0.1ms) begin transaction
41
41
 
42
- TestMailer#body_email: processed outbound mail in 8.0ms
42
+ TestMailer#body_email: processed outbound mail in 5.1ms
43
43
 
44
44
  Subject: Body email
45
45
  Template ID: -
@@ -56,10 +56,10 @@ Attachments: -
56
56
 
57
57
  The E-mail was successfully sent :)
58
58
  Status Code: 202
59
-  (0.2ms) rollback transaction
59
+  (0.1ms) rollback transaction
60
60
   (0.1ms) begin transaction
61
61
 
62
- TestMailer#body_params_email: processed outbound mail in 0.9ms
62
+ TestMailer#body_params_email: processed outbound mail in 0.4ms
63
63
 
64
64
  Subject: Body params email
65
65
  Template ID: -
@@ -78,9 +78,9 @@ The E-mail was successfully sent :)
78
78
  Status Code: 202
79
79
   (0.1ms) rollback transaction
80
80
   (0.1ms) begin transaction
81
- Rendered test_mailer/rails_tpl_email.html.erb within layouts/mailer (2.0ms)
81
+ Rendered test_mailer/rails_tpl_email.html.erb within layouts/mailer (1.2ms)
82
82
 
83
- TestMailer#rails_tpl_email: processed outbound mail in 19.1ms
83
+ TestMailer#rails_tpl_email: processed outbound mail in 11.1ms
84
84
 
85
85
  Subject: Rails tpl email
86
86
  Template ID: -
@@ -106,7 +106,7 @@ Status Code: 202
106
106
   (0.1ms) rollback transaction
107
107
   (0.1ms) begin transaction
108
108
 
109
- TestMailer#from_params_email: processed outbound mail in 0.8ms
109
+ TestMailer#from_params_email: processed outbound mail in 0.5ms
110
110
 
111
111
  Subject: From params email
112
112
  Template ID: -
@@ -126,7 +126,7 @@ Status Code: 202
126
126
   (0.1ms) rollback transaction
127
127
   (0.1ms) begin transaction
128
128
 
129
- TestMailer#from_email: processed outbound mail in 0.9ms
129
+ TestMailer#from_email: processed outbound mail in 0.4ms
130
130
 
131
131
  Subject: From email
132
132
  Template ID: -
@@ -146,7 +146,7 @@ Status Code: 202
146
146
   (0.1ms) rollback transaction
147
147
   (0.1ms) begin transaction
148
148
 
149
- TestMailer#recipients_params_email: processed outbound mail in 0.9ms
149
+ TestMailer#recipients_params_email: processed outbound mail in 0.5ms
150
150
 
151
151
  Subject: Recipients params email
152
152
  Template ID: -
@@ -166,7 +166,7 @@ Status Code: 202
166
166
   (0.1ms) rollback transaction
167
167
   (0.1ms) begin transaction
168
168
 
169
- TestMailer#recipients_email: processed outbound mail in 0.9ms
169
+ TestMailer#recipients_email: processed outbound mail in 0.4ms
170
170
 
171
171
  Subject: Recipients email
172
172
  Template ID: -
@@ -186,7 +186,7 @@ Status Code: 202
186
186
   (0.1ms) rollback transaction
187
187
   (0.1ms) begin transaction
188
188
 
189
- TestMailer#template_id_params_email: processed outbound mail in 0.8ms
189
+ TestMailer#template_id_params_email: processed outbound mail in 0.4ms
190
190
 
191
191
  Subject: Template id params email
192
192
  Template ID: XXX
@@ -201,10 +201,10 @@ Attachments: -
201
201
 
202
202
  The E-mail was successfully sent :)
203
203
  Status Code: 202
204
-  (0.1ms) rollback transaction
204
+  (0.2ms) rollback transaction
205
205
   (0.1ms) begin transaction
206
206
 
207
- TestMailer#template_id_email: processed outbound mail in 0.9ms
207
+ TestMailer#template_id_email: processed outbound mail in 0.4ms
208
208
 
209
209
  Subject: Template id email
210
210
  Template ID: XXX
@@ -222,7 +222,7 @@ Status Code: 202
222
222
   (0.1ms) rollback transaction
223
223
   (0.1ms) begin transaction
224
224
 
225
- TestMailer#subject_params_email: processed outbound mail in 0.6ms
225
+ TestMailer#subject_params_email: processed outbound mail in 0.3ms
226
226
 
227
227
  Subject: My Subject
228
228
  Template ID: -
@@ -242,7 +242,7 @@ Status Code: 202
242
242
   (0.1ms) rollback transaction
243
243
   (0.1ms) begin transaction
244
244
 
245
- TestMailer#subject_email: processed outbound mail in 0.8ms
245
+ TestMailer#subject_email: processed outbound mail in 0.4ms
246
246
 
247
247
  Subject: My Subject
248
248
  Template ID: -
@@ -259,10 +259,10 @@ Attachments: -
259
259
 
260
260
  The E-mail was successfully sent :)
261
261
  Status Code: 202
262
-  (0.2ms) rollback transaction
262
+  (0.1ms) rollback transaction
263
263
   (0.1ms) begin transaction
264
264
 
265
- TestMailer#headers_params_email: processed outbound mail in 0.9ms
265
+ TestMailer#headers_params_email: processed outbound mail in 0.4ms
266
266
 
267
267
  Subject: Headers params email
268
268
  Template ID: -
@@ -284,7 +284,7 @@ Status Code: 202
284
284
   (0.1ms) rollback transaction
285
285
   (0.1ms) begin transaction
286
286
 
287
- TestMailer#headers_email: processed outbound mail in 2.3ms
287
+ TestMailer#headers_email: processed outbound mail in 1.2ms
288
288
 
289
289
  Subject: Headers email
290
290
  Template ID: -
@@ -306,7 +306,7 @@ Status Code: 202
306
306
   (0.1ms) rollback transaction
307
307
   (0.1ms) begin transaction
308
308
 
309
- TestMailer#add_attachments_email: processed outbound mail in 16.3ms
309
+ TestMailer#add_attachments_email: processed outbound mail in 9.3ms
310
310
 
311
311
  Subject: Add attachments email
312
312
  Template ID: -
@@ -324,10 +324,10 @@ Attachments:
324
324
 
325
325
  The E-mail was successfully sent :)
326
326
  Status Code: 202
327
-  (0.2ms) rollback transaction
328
-  (0.2ms) begin transaction
327
+  (0.1ms) rollback transaction
328
+  (0.1ms) begin transaction
329
329
 
330
- TestMailer#substitutions_email: processed outbound mail in 0.9ms
330
+ TestMailer#substitutions_email: processed outbound mail in 0.6ms
331
331
 
332
332
  Subject: Substitutions email
333
333
  Template ID: -
@@ -349,7 +349,7 @@ Status Code: 202
349
349
   (0.1ms) rollback transaction
350
350
   (0.1ms) begin transaction
351
351
 
352
- TestMailer#template_name_email: processed outbound mail in 0.9ms
352
+ TestMailer#template_name_email: processed outbound mail in 0.4ms
353
353
 
354
354
  Subject: Template name email
355
355
  Template ID: 123
@@ -367,9 +367,9 @@ Status Code: 202
367
367
   (0.1ms) rollback transaction
368
368
   (0.1ms) begin transaction
369
369
 
370
- TestMailer#template_name_email: processed outbound mail in 0.9ms
370
+ TestMailer#template_name_email: processed outbound mail in 0.5ms
371
371
   (0.1ms) rollback transaction
372
372
   (0.1ms) begin transaction
373
373
 
374
- TestMailer#template_name_email: processed outbound mail in 0.8ms
375
-  (0.2ms) rollback transaction
374
+ TestMailer#template_name_email: processed outbound mail in 0.4ms
375
+  (0.1ms) rollback transaction
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: send_grid_mailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Platanus
@@ -9,15 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-03-26 00:00:00.000000000 Z
12
+ date: 2017-04-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
19
- - !ruby/object:Gem::Version
20
- version: '4.2'
21
18
  - - ">="
22
19
  - !ruby/object:Gem::Version
23
20
  version: 4.2.0
@@ -25,9 +22,6 @@ dependencies:
25
22
  prerelease: false
26
23
  version_requirements: !ruby/object:Gem::Requirement
27
24
  requirements:
28
- - - "~>"
29
- - !ruby/object:Gem::Version
30
- version: '4.2'
31
25
  - - ">="
32
26
  - !ruby/object:Gem::Version
33
27
  version: 4.2.0