awesomemailer 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/VERSION +1 -1
- data/awesomemailer.gemspec +4 -3
- data/lib/awesome_mailer/base.rb +1 -4
- data/lib/awesome_mailer/renderer.rb +12 -3
- metadata +19 -30
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 79d38ee89624a5a38d11397602eb68885a7fcffb
|
4
|
+
data.tar.gz: 3a01abeeac5a568f041ee1d0ea219f5670b6732e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d361a95f61e243366ee330ceaa2aa72ca8d86df13734e1b86c1b8e352d4d116444b02bb44ca352020bd5bafadd44a939dd35c2778fd571547f8b5d84337135f7
|
7
|
+
data.tar.gz: b77ae200edc6be2d5b91e202354c2833990bc3fd483459c090013ff623492daec09b8de20ed6ec9bdb774e08cde96286252df9f03e317e06b5b1f2148d8625a2
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2010 Flip Sasser
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.4
|
data/awesomemailer.gemspec
CHANGED
@@ -5,11 +5,12 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "awesomemailer"
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.2"
|
9
9
|
|
10
|
+
s.license = "MIT"
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
12
|
s.authors = ["Flip Sasser"]
|
12
|
-
s.date = "2013-
|
13
|
+
s.date = "2013-06-13"
|
13
14
|
s.description = "\n AwesomeMailer embeds your e-mail CSS inline, allowing you to write e-mail templates without worrying too much about stylesheets\n "
|
14
15
|
s.email = "flip@x451.com"
|
15
16
|
s.extra_rdoc_files = [
|
@@ -27,7 +28,7 @@ Gem::Specification.new do |s|
|
|
27
28
|
]
|
28
29
|
s.homepage = "http://github.com/Plinq/awesome_mailer"
|
29
30
|
s.require_paths = ["lib"]
|
30
|
-
s.rubygems_version = "1.8.
|
31
|
+
s.rubygems_version = "1.8.25"
|
31
32
|
s.summary = "An ActionMailer extension that embeds CSS inline in e-mails"
|
32
33
|
|
33
34
|
if s.respond_to? :specification_version then
|
data/lib/awesome_mailer/base.rb
CHANGED
@@ -3,14 +3,11 @@ require 'action_mailer'
|
|
3
3
|
|
4
4
|
module AwesomeMailer
|
5
5
|
class Base < ActionMailer::Base
|
6
|
-
abstract!
|
7
|
-
include ActionView::Helpers::AssetTagHelper::StylesheetTagHelpers
|
8
|
-
include ActionView::Helpers::AssetTagHelper::JavascriptTagHelpers
|
9
|
-
include AbstractController::UrlFor
|
10
6
|
|
11
7
|
def render(*arguments)
|
12
8
|
return super unless formats.include? :html
|
13
9
|
AwesomeMailer::Renderer.new(super).to_html
|
14
10
|
end
|
11
|
+
|
15
12
|
end
|
16
13
|
end
|
@@ -25,6 +25,7 @@ module AwesomeMailer
|
|
25
25
|
end
|
26
26
|
|
27
27
|
private
|
28
|
+
|
28
29
|
def apply_styles_to_body!(selector, properties)
|
29
30
|
search_selector = selector =~ /^body/ ? selector : "body #{selector}"
|
30
31
|
elements = document.search(search_selector)
|
@@ -67,7 +68,7 @@ module AwesomeMailer
|
|
67
68
|
next if applied_rules.include? rule
|
68
69
|
rule.each_selector do |selector, properties, specificity|
|
69
70
|
properties = properties.split(';').map(&:strip)
|
70
|
-
if selector =~ /(^@|:(active|checked|disabled|enabled|focus|hover|lang|link|target|visited|:)|moz|webkit)/
|
71
|
+
if selector =~ /(^@|:(active|checked|disabled|enabled|focus|hover|lang|link|not|target|visited|:)|moz|webkit)/
|
71
72
|
# Special selectors get sent to the <head> tag
|
72
73
|
apply_styles_to_head!(selector, properties)
|
73
74
|
else
|
@@ -99,8 +100,16 @@ module AwesomeMailer
|
|
99
100
|
end
|
100
101
|
|
101
102
|
def default_host
|
102
|
-
if
|
103
|
-
|
103
|
+
if AwesomeMailer::Base.respond_to?(:default_url_options)
|
104
|
+
options = AwesomeMailer::Base.default_url_options
|
105
|
+
elsif defined?(Rails) && Rails.application && Rails.application.config
|
106
|
+
if Rails.application.config.action_mailer.respond_to?(:default_url_options)
|
107
|
+
options = Rails.application.config.action_mailer.default_url_options
|
108
|
+
end
|
109
|
+
end
|
110
|
+
options ||= {}
|
111
|
+
if host = options[:host]
|
112
|
+
"#{options[:scheme] || 'http'}://#{host}"
|
104
113
|
end
|
105
114
|
end
|
106
115
|
|
metadata
CHANGED
@@ -1,89 +1,82 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awesomemailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Flip Sasser
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-08-22 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: actionmailer
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '3.2'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '3.2'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: addressable
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: css_parser
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: 1.2.5
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: 1.2.5
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: nokogiri
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - ">="
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: 1.5.6
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - ">="
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: 1.5.6
|
78
|
-
description:
|
79
|
-
|
69
|
+
description: "\n AwesomeMailer embeds your e-mail CSS inline, allowing you to
|
70
|
+
write e-mail templates without worrying too much about stylesheets\n "
|
80
71
|
email: flip@x451.com
|
81
72
|
executables: []
|
82
73
|
extensions: []
|
83
74
|
extra_rdoc_files:
|
75
|
+
- LICENSE
|
84
76
|
- README.md
|
85
77
|
files:
|
86
78
|
- CHANGELOG
|
79
|
+
- LICENSE
|
87
80
|
- README.md
|
88
81
|
- VERSION
|
89
82
|
- awesomemailer.gemspec
|
@@ -93,29 +86,25 @@ files:
|
|
93
86
|
- lib/awesomemailer.rb
|
94
87
|
homepage: http://github.com/Plinq/awesome_mailer
|
95
88
|
licenses: []
|
89
|
+
metadata: {}
|
96
90
|
post_install_message:
|
97
91
|
rdoc_options: []
|
98
92
|
require_paths:
|
99
93
|
- lib
|
100
94
|
required_ruby_version: !ruby/object:Gem::Requirement
|
101
|
-
none: false
|
102
95
|
requirements:
|
103
|
-
- -
|
96
|
+
- - ">="
|
104
97
|
- !ruby/object:Gem::Version
|
105
98
|
version: '0'
|
106
|
-
segments:
|
107
|
-
- 0
|
108
|
-
hash: -2229618769423316685
|
109
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
|
-
none: false
|
111
100
|
requirements:
|
112
|
-
- -
|
101
|
+
- - ">="
|
113
102
|
- !ruby/object:Gem::Version
|
114
103
|
version: '0'
|
115
104
|
requirements: []
|
116
105
|
rubyforge_project:
|
117
|
-
rubygems_version:
|
106
|
+
rubygems_version: 2.4.1
|
118
107
|
signing_key:
|
119
|
-
specification_version:
|
108
|
+
specification_version: 4
|
120
109
|
summary: An ActionMailer extension that embeds CSS inline in e-mails
|
121
110
|
test_files: []
|