roadie 1.1.1 → 1.1.2
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.
- data/Changelog.md +8 -2
- data/Gemfile.lock +61 -47
- data/README.md +1 -1
- data/gemfiles/rails-3.1.x.Gemfile +1 -1
- data/lib/roadie/version.rb +1 -1
- data/roadie.gemspec +1 -1
- data/spec/fixtures/public/stylesheets/integration.css +7 -1
- data/spec/integration_spec.rb +9 -0
- data/spec/lib/roadie/inliner_spec.rb +10 -0
- data/spec/support/have_styling_matcher.rb +1 -12
- data/spec/support/parse_styling.rb +17 -0
- metadata +7 -6
data/Changelog.md
CHANGED
@@ -1,14 +1,20 @@
|
|
1
1
|
### dev
|
2
2
|
|
3
|
-
[full changelog](https://github.com/Mange/roadie/compare/v1.1.
|
3
|
+
[full changelog](https://github.com/Mange/roadie/compare/v1.1.2...master)
|
4
4
|
|
5
5
|
* Nothing yet
|
6
6
|
|
7
|
+
### 1.1.2
|
8
|
+
|
9
|
+
[full changelog](https://github.com/Mange/roadie/compare/v1.1.1...v1.1.2)
|
10
|
+
|
11
|
+
* Support for Rails 3.1.0 and later inside gemspec
|
12
|
+
|
7
13
|
### 1.1.1
|
8
14
|
|
9
15
|
[full changelog](https://github.com/Mange/roadie/compare/v1.1.0...v1.1.1)
|
10
16
|
|
11
|
-
* Support for Rails 3.1.x (
|
17
|
+
* Support for Rails 3.1.x (up to and including RC4)
|
12
18
|
* Rails 3.0.x is still supported
|
13
19
|
* Added CI via [Travis CI](http://travis-ci.org)
|
14
20
|
|
data/Gemfile.lock
CHANGED
@@ -1,76 +1,90 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
roadie (1.1.
|
5
|
-
actionmailer (
|
4
|
+
roadie (1.1.1)
|
5
|
+
actionmailer (~> 3.0)
|
6
6
|
css_parser
|
7
7
|
nokogiri (>= 1.4.4)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: http://rubygems.org/
|
11
11
|
specs:
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
rack (~> 1.
|
23
|
-
rack-mount (~> 0.
|
24
|
-
rack-test (~> 0.
|
25
|
-
|
26
|
-
activemodel (3.0
|
27
|
-
activesupport (= 3.0
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
12
|
+
actionmailer (3.1.0)
|
13
|
+
actionpack (= 3.1.0)
|
14
|
+
mail (~> 2.3.0)
|
15
|
+
actionpack (3.1.0)
|
16
|
+
activemodel (= 3.1.0)
|
17
|
+
activesupport (= 3.1.0)
|
18
|
+
builder (~> 3.0.0)
|
19
|
+
erubis (~> 2.7.0)
|
20
|
+
i18n (~> 0.6)
|
21
|
+
rack (~> 1.3.2)
|
22
|
+
rack-cache (~> 1.0.3)
|
23
|
+
rack-mount (~> 0.8.2)
|
24
|
+
rack-test (~> 0.6.1)
|
25
|
+
sprockets (~> 2.0.0)
|
26
|
+
activemodel (3.1.0)
|
27
|
+
activesupport (= 3.1.0)
|
28
|
+
bcrypt-ruby (~> 3.0.0)
|
29
|
+
builder (~> 3.0.0)
|
30
|
+
i18n (~> 0.6)
|
31
|
+
activesupport (3.1.0)
|
32
|
+
multi_json (~> 1.0)
|
33
|
+
bcrypt-ruby (3.0.0)
|
34
|
+
builder (3.0.0)
|
32
35
|
css_parser (1.1.9)
|
33
|
-
diff-lcs (1.1.
|
34
|
-
erubis (2.
|
35
|
-
|
36
|
-
i18n (0.
|
37
|
-
mail (2.
|
38
|
-
activesupport (>= 2.3.6)
|
36
|
+
diff-lcs (1.1.3)
|
37
|
+
erubis (2.7.0)
|
38
|
+
hike (1.2.1)
|
39
|
+
i18n (0.6.0)
|
40
|
+
mail (2.3.0)
|
39
41
|
i18n (>= 0.4.0)
|
40
42
|
mime-types (~> 1.16)
|
41
43
|
treetop (~> 1.4.8)
|
42
44
|
mime-types (1.16)
|
43
|
-
|
45
|
+
multi_json (1.0.3)
|
46
|
+
nokogiri (1.5.0)
|
44
47
|
polyglot (0.3.2)
|
45
|
-
rack (1.2
|
46
|
-
rack-
|
48
|
+
rack (1.3.2)
|
49
|
+
rack-cache (1.0.3)
|
50
|
+
rack (>= 0.4)
|
51
|
+
rack-mount (0.8.3)
|
47
52
|
rack (>= 1.0.0)
|
48
|
-
rack-
|
53
|
+
rack-ssl (1.3.2)
|
54
|
+
rack
|
55
|
+
rack-test (0.6.1)
|
49
56
|
rack (>= 1.0)
|
50
|
-
railties (3.0
|
51
|
-
actionpack (= 3.0
|
52
|
-
activesupport (= 3.0
|
57
|
+
railties (3.1.0)
|
58
|
+
actionpack (= 3.1.0)
|
59
|
+
activesupport (= 3.1.0)
|
60
|
+
rack-ssl (~> 1.3.2)
|
53
61
|
rake (>= 0.8.7)
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
rspec-
|
60
|
-
|
61
|
-
|
62
|
+
rdoc (~> 3.4)
|
63
|
+
thor (~> 0.14.6)
|
64
|
+
rake (0.9.2)
|
65
|
+
rdoc (3.9.4)
|
66
|
+
rspec (2.6.0)
|
67
|
+
rspec-core (~> 2.6.0)
|
68
|
+
rspec-expectations (~> 2.6.0)
|
69
|
+
rspec-mocks (~> 2.6.0)
|
70
|
+
rspec-core (2.6.4)
|
71
|
+
rspec-expectations (2.6.0)
|
62
72
|
diff-lcs (~> 1.1.2)
|
63
|
-
rspec-mocks (2.
|
64
|
-
rspec-rails (2.
|
73
|
+
rspec-mocks (2.6.0)
|
74
|
+
rspec-rails (2.6.1)
|
65
75
|
actionpack (~> 3.0)
|
66
76
|
activesupport (~> 3.0)
|
67
77
|
railties (~> 3.0)
|
68
|
-
rspec (~> 2.
|
78
|
+
rspec (~> 2.6.0)
|
79
|
+
sprockets (2.0.0)
|
80
|
+
hike (~> 1.2)
|
81
|
+
rack (~> 1.0)
|
82
|
+
tilt (!= 1.3.0, ~> 1.1)
|
69
83
|
thor (0.14.6)
|
84
|
+
tilt (1.3.3)
|
70
85
|
treetop (1.4.10)
|
71
86
|
polyglot
|
72
87
|
polyglot (>= 0.3.1)
|
73
|
-
tzinfo (0.3.24)
|
74
88
|
|
75
89
|
PLATFORMS
|
76
90
|
ruby
|
data/README.md
CHANGED
@@ -126,8 +126,8 @@ Bugs / TODO
|
|
126
126
|
Documentation
|
127
127
|
-------------
|
128
128
|
|
129
|
+
* [Online documentation for 1.1.2](http://rubydoc.info/gems/roadie/1.1.2/frames)
|
129
130
|
* [Online documentation for 1.0.1](http://rubydoc.info/gems/roadie/1.0.1/frames)
|
130
|
-
* [Online documentation for 1.0.0](http://rubydoc.info/gems/roadie/1.0.0/frames)
|
131
131
|
* [Online documentation for master](http://rubydoc.info/github/Mange/roadie/master/frames)
|
132
132
|
* [Changelog](https://github.com/Mange/roadie/blob/master/Changelog.md)
|
133
133
|
|
data/lib/roadie/version.rb
CHANGED
data/roadie.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
|
17
17
|
s.add_dependency 'nokogiri', '>= 1.4.4'
|
18
18
|
s.add_dependency 'css_parser'
|
19
|
-
s.add_dependency 'actionmailer', '
|
19
|
+
s.add_dependency 'actionmailer', '~> 3.0'
|
20
20
|
|
21
21
|
s.add_development_dependency 'rspec-rails', '>= 2.0.0'
|
22
22
|
|
@@ -1,4 +1,10 @@
|
|
1
1
|
body { background: url(../images/dots.png) repeat-x; }
|
2
2
|
#message { background-color: #fff; margin: 0 auto; width: 75%; }
|
3
3
|
|
4
|
-
h1 { color: #eee; }
|
4
|
+
h1 { color: #eee; }
|
5
|
+
strong {
|
6
|
+
-moz-box-shadow: #62b0d7 1px 1px 1px 1px inset, #aaaaaa 1px 1px 3px 0;
|
7
|
+
-webkit-box-shadow: #62b0d7 1px 1px 1px 1px inset, #aaaaaa 1px 1px 3px 0;
|
8
|
+
-o-box-shadow: #62b0d7 1px 1px 1px 1px inset, #aaaaaa 1px 1px 3px 0;
|
9
|
+
box-shadow: #62b0d7 1px 1px 1px 1px inset, #aaaaaa 1px 1px 3px 0;
|
10
|
+
}
|
data/spec/integration_spec.rb
CHANGED
@@ -59,4 +59,13 @@ describe "roadie integration" do
|
|
59
59
|
email = IntegrationMailer.marketing('everyone@inter.net')
|
60
60
|
email.header['X-Spam'].should be_present
|
61
61
|
end
|
62
|
+
|
63
|
+
it "applies CSS3 styles" do
|
64
|
+
email = IntegrationMailer.notification('doe@example.com', 'your quota limit has been reached')
|
65
|
+
document = Nokogiri::HTML.parse(email.html_part.body.decoded)
|
66
|
+
strong_node = document.css('strong').first
|
67
|
+
stylings = SpecHelpers.styling_of_node(strong_node)
|
68
|
+
stylings.should include(['box-shadow', '#62b0d7 1px 1px 1px 1px inset, #aaaaaa 1px 1px 3px 0'])
|
69
|
+
stylings.should include(['-o-box-shadow', '#62b0d7 1px 1px 1px 1px inset, #aaaaaa 1px 1px 3px 0'])
|
70
|
+
end
|
62
71
|
end
|
@@ -20,6 +20,16 @@ describe Roadie::Inliner do
|
|
20
20
|
rendering('<p></p>').should have_styling('color' => 'green')
|
21
21
|
end
|
22
22
|
|
23
|
+
it "inlines browser-prefixed attributes" do
|
24
|
+
use_css 'p { -vendor-color: green }'
|
25
|
+
rendering('<p></p>').should have_styling('-vendor-color' => 'green')
|
26
|
+
end
|
27
|
+
|
28
|
+
it "inlines CSS3 attributes" do
|
29
|
+
use_css 'p { border-radius: 2px; }'
|
30
|
+
rendering('<p></p>').should have_styling('border-radius' => '2px')
|
31
|
+
end
|
32
|
+
|
23
33
|
it "keeps the order of the styles that are inlined" do
|
24
34
|
use_css 'h1 { padding: 2px; margin: 5px; }'
|
25
35
|
rendering('<h1></h1>').should have_styling([['padding', '2px'], ['margin', '5px']])
|
@@ -18,19 +18,8 @@ RSpec::Matchers.define :have_styling do |rules|
|
|
18
18
|
failure_message_for_should_not { "expected styles at #{@selector.inspect} to not be #{rules.inspect}" }
|
19
19
|
|
20
20
|
def parsed_styles(document)
|
21
|
-
parse_styles(element_style(document))
|
22
|
-
end
|
23
|
-
|
24
|
-
def element_style(document)
|
25
21
|
node = document.css(@selector).first
|
26
|
-
node
|
27
|
-
end
|
28
|
-
|
29
|
-
def parse_styles(styles)
|
30
|
-
return [] if styles.blank?
|
31
|
-
styles.split(';').inject([]) do |array, item|
|
32
|
-
array << item.split(':', 2).map(&:strip)
|
33
|
-
end
|
22
|
+
SpecHelpers.styling_of_node(node)
|
34
23
|
end
|
35
24
|
end
|
36
25
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module SpecHelpers
|
2
|
+
class << self
|
3
|
+
def styling_of_node(node)
|
4
|
+
if node and node['style'].present?
|
5
|
+
parse_styling(node['style'])
|
6
|
+
else
|
7
|
+
[]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def parse_styling(styles)
|
12
|
+
styles.split(';').inject([]) do |array, item|
|
13
|
+
array << item.split(':', 2).map(&:strip)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roadie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 2
|
10
|
+
version: 1.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Magnus Bergmark
|
@@ -53,14 +53,13 @@ dependencies:
|
|
53
53
|
requirement: &id003 !ruby/object:Gem::Requirement
|
54
54
|
none: false
|
55
55
|
requirements:
|
56
|
-
- -
|
56
|
+
- - ~>
|
57
57
|
- !ruby/object:Gem::Version
|
58
58
|
hash: 7
|
59
59
|
segments:
|
60
60
|
- 3
|
61
61
|
- 0
|
62
|
-
|
63
|
-
version: 3.0.0
|
62
|
+
version: "3.0"
|
64
63
|
type: :runtime
|
65
64
|
version_requirements: *id003
|
66
65
|
- !ruby/object:Gem::Dependency
|
@@ -128,6 +127,7 @@ files:
|
|
128
127
|
- spec/support/have_attribute_matcher.rb
|
129
128
|
- spec/support/have_selector_matcher.rb
|
130
129
|
- spec/support/have_styling_matcher.rb
|
130
|
+
- spec/support/parse_styling.rb
|
131
131
|
homepage: http://github.com/Mange/roadie
|
132
132
|
licenses: []
|
133
133
|
|
@@ -180,3 +180,4 @@ test_files:
|
|
180
180
|
- spec/support/have_attribute_matcher.rb
|
181
181
|
- spec/support/have_selector_matcher.rb
|
182
182
|
- spec/support/have_styling_matcher.rb
|
183
|
+
- spec/support/parse_styling.rb
|