podgraph 0.1.5 → 1.0.1
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 +7 -0
- data/README.md +49 -0
- data/package.gemspec +33 -0
- data/podgraph +5 -0
- data/podgraph.rb +105 -0
- metadata +64 -88
- data/LICENSE +0 -22
- data/NEWS +0 -41
- data/README.rdoc +0 -99
- data/Rakefile +0 -44
- data/TODO +0 -7
- data/bin/podgraph +0 -78
- data/lib/podgraph/meta.rb +0 -9
- data/lib/podgraph/posterous.rb +0 -163
- data/lib/podgraph/trestle.rb +0 -216
- data/test/.document +0 -0
- data/test/blue.png +0 -0
- data/test/config.yaml +0 -3
- data/test/empty.html +0 -0
- data/test/garbage_01.html +0 -1
- data/test/garbage_02.html +0 -1
- data/test/garbage_03.html +0 -8
- data/test/garbage_04.html +0 -9
- data/test/helper.rb +0 -3
- data/test/helper_trestle.rb +0 -37
- data/test/mechanical-turk/1.html +0 -329
- data/test/mechanical-turk/2.html +0 -320
- data/test/mechanical-turk/3.html +0 -320
- data/test/mechanical-turk/Baby-Bunnie.jpg +0 -0
- data/test/mechanical-turk/config.yaml +0 -3
- data/test/mechanical-turk/sun.jpg +0 -0
- data/test/nosubject.html +0 -5
- data/test/rake_git.rb +0 -36
- data/test/related.html +0 -15
- data/test/simple.html +0 -9
- data/test/test_mime.rb +0 -132
- data/test/yellow.png +0 -0
data/test/mechanical-turk/3.html
DELETED
@@ -1,320 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="koi8-r" ?>
|
2
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r" />
|
6
|
-
<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
|
7
|
-
<title>Mixergy: Daniel Delaney (VendrTV)</title>
|
8
|
-
<style type="text/css">
|
9
|
-
|
10
|
-
/*
|
11
|
-
:Author: David Goodger (goodger@python.org)
|
12
|
-
:Id: $Id: html4css1.css 5196 2007-06-03 20:25:28Z wiemann $
|
13
|
-
:Copyright: This stylesheet has been placed in the public domain.
|
14
|
-
|
15
|
-
Default cascading style sheet for the HTML output of Docutils.
|
16
|
-
|
17
|
-
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
|
18
|
-
customize this style sheet.
|
19
|
-
*/
|
20
|
-
|
21
|
-
/* used to remove borders from tables and images */
|
22
|
-
.borderless, table.borderless td, table.borderless th {
|
23
|
-
border: 0 }
|
24
|
-
|
25
|
-
table.borderless td, table.borderless th {
|
26
|
-
/* Override padding for "table.docutils td" with "! important".
|
27
|
-
The right padding separates the table cells. */
|
28
|
-
padding: 0 0.5em 0 0 ! important }
|
29
|
-
|
30
|
-
.first {
|
31
|
-
/* Override more specific margin styles with "! important". */
|
32
|
-
margin-top: 0 ! important }
|
33
|
-
|
34
|
-
.last, .with-subtitle {
|
35
|
-
margin-bottom: 0 ! important }
|
36
|
-
|
37
|
-
.hidden {
|
38
|
-
display: none }
|
39
|
-
|
40
|
-
a.toc-backref {
|
41
|
-
text-decoration: none ;
|
42
|
-
color: black }
|
43
|
-
|
44
|
-
blockquote.epigraph {
|
45
|
-
margin: 2em 5em ; }
|
46
|
-
|
47
|
-
dl.docutils dd {
|
48
|
-
margin-bottom: 0.5em }
|
49
|
-
|
50
|
-
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
51
|
-
dl.docutils dt {
|
52
|
-
font-weight: bold }
|
53
|
-
*/
|
54
|
-
|
55
|
-
div.abstract {
|
56
|
-
margin: 2em 5em }
|
57
|
-
|
58
|
-
div.abstract p.topic-title {
|
59
|
-
font-weight: bold ;
|
60
|
-
text-align: center }
|
61
|
-
|
62
|
-
div.admonition, div.attention, div.caution, div.danger, div.error,
|
63
|
-
div.hint, div.important, div.note, div.tip, div.warning {
|
64
|
-
margin: 2em ;
|
65
|
-
border: medium outset ;
|
66
|
-
padding: 1em }
|
67
|
-
|
68
|
-
div.admonition p.admonition-title, div.hint p.admonition-title,
|
69
|
-
div.important p.admonition-title, div.note p.admonition-title,
|
70
|
-
div.tip p.admonition-title {
|
71
|
-
font-weight: bold ;
|
72
|
-
font-family: sans-serif }
|
73
|
-
|
74
|
-
div.attention p.admonition-title, div.caution p.admonition-title,
|
75
|
-
div.danger p.admonition-title, div.error p.admonition-title,
|
76
|
-
div.warning p.admonition-title {
|
77
|
-
color: red ;
|
78
|
-
font-weight: bold ;
|
79
|
-
font-family: sans-serif }
|
80
|
-
|
81
|
-
/* Uncomment (and remove this text!) to get reduced vertical space in
|
82
|
-
compound paragraphs.
|
83
|
-
div.compound .compound-first, div.compound .compound-middle {
|
84
|
-
margin-bottom: 0.5em }
|
85
|
-
|
86
|
-
div.compound .compound-last, div.compound .compound-middle {
|
87
|
-
margin-top: 0.5em }
|
88
|
-
*/
|
89
|
-
|
90
|
-
div.dedication {
|
91
|
-
margin: 2em 5em ;
|
92
|
-
text-align: center ;
|
93
|
-
font-style: italic }
|
94
|
-
|
95
|
-
div.dedication p.topic-title {
|
96
|
-
font-weight: bold ;
|
97
|
-
font-style: normal }
|
98
|
-
|
99
|
-
div.figure {
|
100
|
-
margin-left: 2em ;
|
101
|
-
margin-right: 2em }
|
102
|
-
|
103
|
-
div.footer, div.header {
|
104
|
-
clear: both;
|
105
|
-
font-size: smaller }
|
106
|
-
|
107
|
-
div.line-block {
|
108
|
-
display: block ;
|
109
|
-
margin-top: 1em ;
|
110
|
-
margin-bottom: 1em }
|
111
|
-
|
112
|
-
div.line-block div.line-block {
|
113
|
-
margin-top: 0 ;
|
114
|
-
margin-bottom: 0 ;
|
115
|
-
margin-left: 1.5em }
|
116
|
-
|
117
|
-
div.sidebar {
|
118
|
-
margin: 0 0 0.5em 1em ;
|
119
|
-
border: medium outset ;
|
120
|
-
padding: 1em ;
|
121
|
-
background-color: #ffffee ;
|
122
|
-
width: 40% ;
|
123
|
-
float: right ;
|
124
|
-
clear: right }
|
125
|
-
|
126
|
-
div.sidebar p.rubric {
|
127
|
-
font-family: sans-serif ;
|
128
|
-
font-size: medium }
|
129
|
-
|
130
|
-
div.system-messages {
|
131
|
-
margin: 5em }
|
132
|
-
|
133
|
-
div.system-messages h1 {
|
134
|
-
color: red }
|
135
|
-
|
136
|
-
div.system-message {
|
137
|
-
border: medium outset ;
|
138
|
-
padding: 1em }
|
139
|
-
|
140
|
-
div.system-message p.system-message-title {
|
141
|
-
color: red ;
|
142
|
-
font-weight: bold }
|
143
|
-
|
144
|
-
div.topic {
|
145
|
-
margin: 2em }
|
146
|
-
|
147
|
-
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
148
|
-
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
149
|
-
margin-top: 0.4em }
|
150
|
-
|
151
|
-
h1.title {
|
152
|
-
text-align: center }
|
153
|
-
|
154
|
-
h2.subtitle {
|
155
|
-
text-align: center }
|
156
|
-
|
157
|
-
hr.docutils {
|
158
|
-
width: 75% }
|
159
|
-
|
160
|
-
img.align-left {
|
161
|
-
clear: left }
|
162
|
-
|
163
|
-
img.align-right {
|
164
|
-
clear: right }
|
165
|
-
|
166
|
-
ol.simple, ul.simple {
|
167
|
-
margin-bottom: 1em }
|
168
|
-
|
169
|
-
ol.arabic {
|
170
|
-
list-style: decimal }
|
171
|
-
|
172
|
-
ol.loweralpha {
|
173
|
-
list-style: lower-alpha }
|
174
|
-
|
175
|
-
ol.upperalpha {
|
176
|
-
list-style: upper-alpha }
|
177
|
-
|
178
|
-
ol.lowerroman {
|
179
|
-
list-style: lower-roman }
|
180
|
-
|
181
|
-
ol.upperroman {
|
182
|
-
list-style: upper-roman }
|
183
|
-
|
184
|
-
p.attribution {
|
185
|
-
text-align: right ;
|
186
|
-
margin-left: 50% }
|
187
|
-
|
188
|
-
p.caption {
|
189
|
-
font-style: italic }
|
190
|
-
|
191
|
-
p.credits {
|
192
|
-
font-style: italic ;
|
193
|
-
font-size: smaller }
|
194
|
-
|
195
|
-
p.label {
|
196
|
-
white-space: nowrap }
|
197
|
-
|
198
|
-
p.rubric {
|
199
|
-
font-weight: bold ;
|
200
|
-
font-size: larger ;
|
201
|
-
color: maroon ;
|
202
|
-
text-align: center }
|
203
|
-
|
204
|
-
p.sidebar-title {
|
205
|
-
font-family: sans-serif ;
|
206
|
-
font-weight: bold ;
|
207
|
-
font-size: larger }
|
208
|
-
|
209
|
-
p.sidebar-subtitle {
|
210
|
-
font-family: sans-serif ;
|
211
|
-
font-weight: bold }
|
212
|
-
|
213
|
-
p.topic-title {
|
214
|
-
font-weight: bold }
|
215
|
-
|
216
|
-
pre.address {
|
217
|
-
margin-bottom: 0 ;
|
218
|
-
margin-top: 0 ;
|
219
|
-
font-family: serif ;
|
220
|
-
font-size: 100% }
|
221
|
-
|
222
|
-
pre.literal-block, pre.doctest-block {
|
223
|
-
margin-left: 2em ;
|
224
|
-
margin-right: 2em }
|
225
|
-
|
226
|
-
span.classifier {
|
227
|
-
font-family: sans-serif ;
|
228
|
-
font-style: oblique }
|
229
|
-
|
230
|
-
span.classifier-delimiter {
|
231
|
-
font-family: sans-serif ;
|
232
|
-
font-weight: bold }
|
233
|
-
|
234
|
-
span.interpreted {
|
235
|
-
font-family: sans-serif }
|
236
|
-
|
237
|
-
span.option {
|
238
|
-
white-space: nowrap }
|
239
|
-
|
240
|
-
span.pre {
|
241
|
-
white-space: pre }
|
242
|
-
|
243
|
-
span.problematic {
|
244
|
-
color: red }
|
245
|
-
|
246
|
-
span.section-subtitle {
|
247
|
-
/* font-size relative to parent (h1..h6 element) */
|
248
|
-
font-size: 80% }
|
249
|
-
|
250
|
-
table.citation {
|
251
|
-
border-left: solid 1px gray;
|
252
|
-
margin-left: 1px }
|
253
|
-
|
254
|
-
table.docinfo {
|
255
|
-
margin: 2em 4em }
|
256
|
-
|
257
|
-
table.docutils {
|
258
|
-
margin-top: 0.5em ;
|
259
|
-
margin-bottom: 0.5em }
|
260
|
-
|
261
|
-
table.footnote {
|
262
|
-
border-left: solid 1px black;
|
263
|
-
margin-left: 1px }
|
264
|
-
|
265
|
-
table.docutils td, table.docutils th,
|
266
|
-
table.docinfo td, table.docinfo th {
|
267
|
-
padding-left: 0.5em ;
|
268
|
-
padding-right: 0.5em ;
|
269
|
-
vertical-align: top }
|
270
|
-
|
271
|
-
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
272
|
-
font-weight: bold ;
|
273
|
-
text-align: left ;
|
274
|
-
white-space: nowrap ;
|
275
|
-
padding-left: 0 }
|
276
|
-
|
277
|
-
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
278
|
-
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
279
|
-
font-size: 100% }
|
280
|
-
|
281
|
-
ul.auto-toc {
|
282
|
-
list-style-type: none }
|
283
|
-
|
284
|
-
</style>
|
285
|
-
</head>
|
286
|
-
<body>
|
287
|
-
<div class="document" id="mixergy-daniel-delaney-vendrtv">
|
288
|
-
|
289
|
-
<h1> ww</h1>
|
290
|
-
<p><a class="reference external" href="http://bit.ly/9pS1DZ">��������</a> is a completely mess. �����
|
291
|
-
���������� ��� ����, ��� � ����� ��� �����. ������, ������ ��� �������
|
292
|
-
��������� ��� �������������� �������--���� �������� ������ �������� so
|
293
|
-
called <em>������ ����� �����</em> � ������ ���� ������� ���������? ��, ������,
|
294
|
-
����� ������ ����� ���������.</p>
|
295
|
-
<p>�� ��� ��� ������. �������� �������� ����� �� ��� ���:</p>
|
296
|
-
<ol class="arabic simple">
|
297
|
-
<li>������, ������� �� ������� ��������� ���� � ����, �������� �������
|
298
|
-
������������ ������������� �����.</li>
|
299
|
-
<li>� ���� ��������� ����������� (�����-�� ������������� Fine Art degree)
|
300
|
-
�� �� ��� ����� �� ������ ������ � ������� (n<sup>2</sup>-n)/2, ����� ��
|
301
|
-
�� �� �������� ���� 7 ������� "�������� ���". ��� �� �����, ���
|
302
|
-
������ ��� ������ ���� overcommunication � ��������� �������� �� 3-�
|
303
|
-
�������.</li>
|
304
|
-
<li>������ ������� �� ������, � ��� ����� ������, content creators for
|
305
|
-
the web � ��������� �������� ���� ���, �������� ����� ��������� ���
|
306
|
-
��������.</li>
|
307
|
-
<li>���� �� ������ "��� ���� ���", � best content ever.</li>
|
308
|
-
<li>��������: ����� ����� ��� ����� ���� �� 37 Signals! �� ������ ��
|
309
|
-
�����. ������ �� �������� ��� 2 �����, �� ���� ���� ����� � ���
|
310
|
-
������� ����� ��� � ����� ���������-������������ �� ���.</li>
|
311
|
-
<li>��� ����� (����� �������� ��������) ��� ���������� �������������� ���
|
312
|
-
������� ������������ ��������� (��� ��� ��� ������ ������ "I don't
|
313
|
-
know")--��� ������ ���������� �.3 � �.5 � ��� �������� ��������.</li>
|
314
|
-
</ol>
|
315
|
-
<p>���������, ��� ��� ��� � �� �����, ������ ������������ ������� ������
|
316
|
-
����� �� ����� �., �������, � ��������, ���������� ���� �� ��� ����, ���
|
317
|
-
��������� � ������.</p>
|
318
|
-
</div>
|
319
|
-
</body>
|
320
|
-
</html>
|
Binary file
|
Binary file
|
data/test/nosubject.html
DELETED
data/test/rake_git.rb
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# -*-ruby-*-
|
3
|
-
# :erb:
|
4
|
-
|
5
|
-
# This is a helper for your Rakefile. Read the comments for each
|
6
|
-
# function.
|
7
|
-
|
8
|
-
require 'git'
|
9
|
-
require 'pp'
|
10
|
-
|
11
|
-
# Return a list of files in a git repository _repdir_.
|
12
|
-
#
|
13
|
-
# Add this to your gem spec:
|
14
|
-
#
|
15
|
-
# spec = Gem::Specification.new {|i|
|
16
|
-
# i.files = git_ls('.')
|
17
|
-
# }
|
18
|
-
#
|
19
|
-
# What it does is just collecting the list of the files from the git
|
20
|
-
# repository. The idea is to use that list for the gem spec. No more
|
21
|
-
# missing or redundant files in gems!
|
22
|
-
def git_ls(repdir, ignore_some = true)
|
23
|
-
ignore = ['/?\.gitignore$']
|
24
|
-
|
25
|
-
r = []
|
26
|
-
g = Git.open repdir
|
27
|
-
g.ls_files.each {|i, v|
|
28
|
-
next if ignore_some && ignore.index {|ign| i.match(/#{ign}/) }
|
29
|
-
r << i
|
30
|
-
}
|
31
|
-
r
|
32
|
-
end
|
33
|
-
|
34
|
-
pp git_ls('.') if __FILE__ == $0
|
35
|
-
|
36
|
-
# Don't remove this: falsework/0.2.2/naive/2010-12-26T04:50:00+02:00
|
data/test/related.html
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<body>
|
3
|
-
<div>
|
4
|
-
<h1>The Test</h1>
|
5
|
-
<p> of the best</p>
|
6
|
-
of fucking <img src='blue.png'/> inline<br/>
|
7
|
-
<p>
|
8
|
-
<img
|
9
|
-
src='http://images.google.com/intl/en_ALL/images/logos/images_logo_lg.gif'/><div>
|
10
|
-
and <i>external<br/><img src='yellow.png'/></i> images.</div>
|
11
|
-
</p>
|
12
|
-
(hidden text)
|
13
|
-
</div>
|
14
|
-
</body>
|
15
|
-
</html>
|
data/test/simple.html
DELETED
data/test/test_mime.rb
DELETED
@@ -1,132 +0,0 @@
|
|
1
|
-
require_relative 'helper'
|
2
|
-
require_relative '../lib/podgraph/posterous'
|
3
|
-
|
4
|
-
class TestMime < MiniTest::Unit::TestCase
|
5
|
-
def setup
|
6
|
-
@testdir = File.expand_path(File.dirname(__FILE__))
|
7
|
-
@to = 'alex@goliard'
|
8
|
-
@from = 'alexander.gromnitsky@gmail.com'
|
9
|
-
@conf = {}
|
10
|
-
@u = Trestle.new @conf
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_broken_subject
|
14
|
-
e = assert_raises(RuntimeError) {
|
15
|
-
p = Podgraph::Posterous.new(@u, @testdir+'/nosubject.html', @to,
|
16
|
-
@from, 'related')
|
17
|
-
}
|
18
|
-
assert_match(/cannot extract the subject/, e.message)
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_missing_input_file
|
22
|
-
e = assert_raises(Errno::ENOENT) {
|
23
|
-
p = Podgraph::Posterous.new(@u, 'something_completly_unreliable.html',
|
24
|
-
@to, @from, 'related')
|
25
|
-
}
|
26
|
-
assert_match(/no such file or directory/i, e.message)
|
27
|
-
end
|
28
|
-
|
29
|
-
def test_empty_input_file
|
30
|
-
e = assert_raises(RuntimeError) {
|
31
|
-
p = Podgraph::Posterous.new(@u, @testdir+'/empty.html',
|
32
|
-
@to, @from, 'related')
|
33
|
-
}
|
34
|
-
assert_match(/cannot extract the subject/, e.message)
|
35
|
-
end
|
36
|
-
|
37
|
-
def test_invalid_input_file_01
|
38
|
-
e = assert_raises(RuntimeError) {
|
39
|
-
p = Podgraph::Posterous.new(@u, @testdir+'/garbage_01.html',
|
40
|
-
@to, @from, 'related')
|
41
|
-
}
|
42
|
-
assert_match(/cannot extract the subject/, e.message)
|
43
|
-
end
|
44
|
-
|
45
|
-
def test_invalid_input_file_02
|
46
|
-
assert_raises(REXML::ParseException) {
|
47
|
-
p = Podgraph::Posterous.new(@u, @testdir+'/garbage_02.html',
|
48
|
-
@to, @from, 'related')
|
49
|
-
}
|
50
|
-
end
|
51
|
-
|
52
|
-
def test_invalid_input_file_03
|
53
|
-
e = assert_raises(RuntimeError) {
|
54
|
-
p = Podgraph::Posterous.new(@u, @testdir+'/garbage_03.html',
|
55
|
-
@to, @from, 'related')
|
56
|
-
}
|
57
|
-
assert_match(/body is empty or filled with nonsence/, e.message)
|
58
|
-
end
|
59
|
-
|
60
|
-
def test_invalid_input_file_04
|
61
|
-
e = assert_raises(RuntimeError) {
|
62
|
-
p = Podgraph::Posterous.new(@u, @testdir+'/garbage_04.html',
|
63
|
-
@to, @from, 'related')
|
64
|
-
mail = p.generate()
|
65
|
-
}
|
66
|
-
assert_match(/cannot attach/, e.message)
|
67
|
-
end
|
68
|
-
|
69
|
-
|
70
|
-
# NOTE: run
|
71
|
-
#
|
72
|
-
# ../bin/podgraph -S simple.html | grep -i -v -e ^To: -e '^Date:' -e ^Message-ID: -e '^user-agent:'|md5
|
73
|
-
#
|
74
|
-
# to get a new hash for this test.
|
75
|
-
def test_simple
|
76
|
-
p = Podgraph::Posterous.new(@u, @testdir+'/simple.html', @to, @from, 'related')
|
77
|
-
mail = p.generate.to_s
|
78
|
-
mail.sub!(/^Date: .+$\n/, '')
|
79
|
-
mail.sub!(/^To: .+$\n/, '')
|
80
|
-
mail.sub!(/^Message-ID: .+$\n/, '')
|
81
|
-
mail.sub!(/^User-Agent: .+$\n/, '')
|
82
|
-
# p mail
|
83
|
-
# puts mail
|
84
|
-
assert_equal('54c07d54f21efd28cc4634bd6b61efaf',
|
85
|
-
Digest::MD5.hexdigest(mail + "\n"))
|
86
|
-
end
|
87
|
-
|
88
|
-
def test_related
|
89
|
-
p = mail = nil
|
90
|
-
Dir.chdir(@testdir) do
|
91
|
-
p = Podgraph::Posterous.new(@u, @testdir+'/related.html', @to, @from, 'related')
|
92
|
-
mail = p.generate()
|
93
|
-
end
|
94
|
-
assert_equal(mail.multipart?, true)
|
95
|
-
assert_equal(mail.parts.length, 3) # html and 2 images
|
96
|
-
# check for 2 images
|
97
|
-
assert_equal(p.o[:a_marks].key?('blue.png'), true)
|
98
|
-
assert_equal(p.o[:a_marks].key?('yellow.png'), true)
|
99
|
-
|
100
|
-
# html
|
101
|
-
assert_equal(mail.parts[0].content_type, "text/html; charset=UTF-8")
|
102
|
-
refute_equal(mail.parts[0].content_disposition, "inline")
|
103
|
-
assert_equal(mail.parts[1].content_disposition, "inline")
|
104
|
-
assert_equal(mail.parts[2].content_disposition, "inline")
|
105
|
-
|
106
|
-
# search in the html our inline images
|
107
|
-
mail.parts[1..-1].each {|i|
|
108
|
-
assert_match(Regexp.new("cid:#{i.content_id[1..-1]}"),
|
109
|
-
mail.parts[0].body.decoded)
|
110
|
-
}
|
111
|
-
end
|
112
|
-
|
113
|
-
def test_mixed
|
114
|
-
p = mail = nil
|
115
|
-
Dir.chdir(@testdir) do
|
116
|
-
p = Podgraph::Posterous.new(@u, 'related.html', @to, @from, 'mixed')
|
117
|
-
mail = p.generate()
|
118
|
-
end
|
119
|
-
assert_equal(mail.multipart?, true)
|
120
|
-
assert_equal(mail.parts.length, 3) # html and 2 images
|
121
|
-
# check for 2 images
|
122
|
-
assert_equal(p.o[:attachment].include?('blue.png'), true)
|
123
|
-
assert_equal(p.o[:attachment].include?('yellow.png'), true)
|
124
|
-
|
125
|
-
# html
|
126
|
-
assert_equal(mail.parts[0].content_type, "text/html; charset=UTF-8")
|
127
|
-
assert_equal(mail.parts[0].content_disposition, "inline")
|
128
|
-
refute_equal(mail.parts[1].content_disposition, "inline")
|
129
|
-
refute_equal(mail.parts[2].content_disposition, "inline")
|
130
|
-
end
|
131
|
-
|
132
|
-
end
|
data/test/yellow.png
DELETED
Binary file
|