griddler 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/lib/griddler/adapters/mandrill_adapter.rb +6 -11
- data/lib/griddler/email.rb +3 -6
- data/lib/griddler/version.rb +1 -1
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a2cacfe5e74d1231a76e4502ed28c88399fd769
|
4
|
+
data.tar.gz: 3213db391f6032cfa65f6d0fa2e0323b45016001
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9cf20906c65491d019e30b68dfd669c5f16f80eca4cbb922410c91f63b338e723e52f1a7912e56a2f6dfc10b041806eb64fe2ce7bc6adfdea3a1038ac88c304
|
7
|
+
data.tar.gz: b047cccc5d6ea2fdfce31da626671fe11de304ec5d338850afacdf1640da27f51d60c31bee2b72d54d9c64db6147c17a9ad4d5d54e93d193e32d5925d1f6e6b7
|
data/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c)
|
1
|
+
Copyright (c) 2014 Caleb Thompson, Joel Oliveira and thoughtbot, inc.
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -286,6 +286,6 @@ The names and logos for thoughtbot are trademarks of thoughtbot, inc.
|
|
286
286
|
License
|
287
287
|
-------
|
288
288
|
|
289
|
-
Griddler is Copyright ©
|
289
|
+
Griddler is Copyright © 2014 Caleb Thompson, Joel Oliveira and thoughtbot. It is
|
290
290
|
free software, and may be redistributed under the terms specified in the LICENSE
|
291
291
|
file.
|
@@ -13,12 +13,12 @@ module Griddler
|
|
13
13
|
def normalize_params
|
14
14
|
events.map do |event|
|
15
15
|
{
|
16
|
-
to: recipients(event),
|
17
|
-
cc:
|
16
|
+
to: recipients(:to, event),
|
17
|
+
cc: recipients(:cc, event),
|
18
18
|
from: full_email([ event[:from_email], event[:from_name] ]),
|
19
19
|
subject: event[:subject],
|
20
|
-
text: event
|
21
|
-
html: event
|
20
|
+
text: event.fetch(:text, ''),
|
21
|
+
html: event.fetch(:html, ''),
|
22
22
|
raw_body: event[:raw_msg],
|
23
23
|
attachments: attachment_files(event)
|
24
24
|
}
|
@@ -35,13 +35,8 @@ module Griddler
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
def recipients(event)
|
39
|
-
event[
|
40
|
-
end
|
41
|
-
|
42
|
-
def ccs(event)
|
43
|
-
found = event[:headers].select { |header| header.first == 'Cc' }.first
|
44
|
-
Array(found).last.to_s.split(',').map(&:strip)
|
38
|
+
def recipients(field, event)
|
39
|
+
Array.wrap(event[field]).map { |recipient| full_email(recipient) }
|
45
40
|
end
|
46
41
|
|
47
42
|
def full_email(contact_info)
|
data/lib/griddler/email.rb
CHANGED
@@ -16,7 +16,7 @@ module Griddler
|
|
16
16
|
@body = extract_body
|
17
17
|
@raw_text = params[:text]
|
18
18
|
@raw_html = params[:html]
|
19
|
-
@raw_body = @raw_text || @raw_html
|
19
|
+
@raw_body = @raw_text.presence || @raw_html
|
20
20
|
|
21
21
|
@headers = extract_headers
|
22
22
|
|
@@ -68,11 +68,8 @@ module Griddler
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def text_or_sanitized_html
|
71
|
-
|
72
|
-
|
73
|
-
elsif params.key? :html
|
74
|
-
clean_html(params[:html])
|
75
|
-
end
|
71
|
+
text = clean_text(params.fetch(:text, ''))
|
72
|
+
text.presence || clean_html(params.fetch(:html, '')).presence
|
76
73
|
end
|
77
74
|
|
78
75
|
def clean_text(text)
|
data/lib/griddler/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: griddler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Caleb Thompson
|
@@ -11,76 +11,76 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-
|
14
|
+
date: 2014-03-13 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
18
18
|
requirement: !ruby/object:Gem::Requirement
|
19
19
|
requirements:
|
20
|
-
- -
|
20
|
+
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 3.2.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 3.2.0
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: htmlentities
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
requirements:
|
34
|
-
- -
|
34
|
+
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: '0'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
|
-
- -
|
41
|
+
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '0'
|
44
44
|
- !ruby/object:Gem::Dependency
|
45
45
|
name: rspec-rails
|
46
46
|
requirement: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
48
|
-
- -
|
48
|
+
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
50
|
version: '0'
|
51
51
|
type: :development
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
|
-
- -
|
55
|
+
- - ">="
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '0'
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: sqlite3
|
60
60
|
requirement: !ruby/object:Gem::Requirement
|
61
61
|
requirements:
|
62
|
-
- -
|
62
|
+
- - ">="
|
63
63
|
- !ruby/object:Gem::Version
|
64
64
|
version: '0'
|
65
65
|
type: :development
|
66
66
|
prerelease: false
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
69
|
-
- -
|
69
|
+
- - ">="
|
70
70
|
- !ruby/object:Gem::Version
|
71
71
|
version: '0'
|
72
72
|
- !ruby/object:Gem::Dependency
|
73
73
|
name: jquery-rails
|
74
74
|
requirement: !ruby/object:Gem::Requirement
|
75
75
|
requirements:
|
76
|
-
- -
|
76
|
+
- - ">="
|
77
77
|
- !ruby/object:Gem::Version
|
78
78
|
version: '0'
|
79
79
|
type: :development
|
80
80
|
prerelease: false
|
81
81
|
version_requirements: !ruby/object:Gem::Requirement
|
82
82
|
requirements:
|
83
|
-
- -
|
83
|
+
- - ">="
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '0'
|
86
86
|
description:
|
@@ -125,17 +125,17 @@ require_paths:
|
|
125
125
|
- lib
|
126
126
|
required_ruby_version: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
|
-
- -
|
128
|
+
- - ">="
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: 1.9.2
|
131
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
132
|
requirements:
|
133
|
-
- -
|
133
|
+
- - ">="
|
134
134
|
- !ruby/object:Gem::Version
|
135
135
|
version: '0'
|
136
136
|
requirements: []
|
137
137
|
rubyforge_project:
|
138
|
-
rubygems_version: 2.2.
|
138
|
+
rubygems_version: 2.2.2
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
141
|
summary: SendGrid Parse API client Rails Engine
|