maildown 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +0 -1
- data/lib/maildown/markdown_engine.rb +19 -0
- data/lib/maildown/md.rb +35 -0
- data/lib/maildown/version.rb +1 -1
- data/lib/maildown.rb +2 -34
- data/test/dummy/config/routes.rb +0 -1
- data/test/dummy/log/test.log +49 -304
- data/test/test_helper.rb +3 -3
- data/test/unit/maildown_test.rb +0 -1
- data/test/unit/markdown_engine_test.rb +19 -0
- metadata +8 -15
- data/app/assets/javascripts/maildown/application.js +0 -13
- data/app/assets/stylesheets/maildown/application.css +0 -13
- data/app/controllers/maildown/application_controller.rb +0 -4
- data/app/helpers/maildown/application_helper.rb +0 -4
- data/app/views/layouts/maildown/application.html.erb +0 -14
- data/config/routes.rb +0 -2
- data/lib/maildown/engine.rb +0 -5
- data/test/integration/navigation_test.rb +0 -10
- data/test/maildown_test.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 847ff20b1b3ab1e407996c247ee581b2a6478fe6
|
4
|
+
data.tar.gz: 962b050fb870616662467fcb9e79f6d5f736478b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 417ef54f34355c7dec1ca652f7abbf59eaed13909c0a1abf767322be219b65efc1a2259545fea1b6a7ca372b06bf6aefb144b1d13d6b8a6c29871da617405ee6
|
7
|
+
data.tar.gz: 0ebc3e520263090547dcbe213da6cbd36c4cb01dbbffe85e27a0ee6d5f2124b33ce93432626c2e149e3e16364c37bf86ed514f1fded9022a14253be02c174c25
|
data/Rakefile
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
module Maildown
|
2
|
+
module MarkdownEngine
|
3
|
+
def self.to_html(string)
|
4
|
+
Thread.current[:maildown_markdown_engine_block].call(string)
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.set(&block)
|
8
|
+
Thread.current[:maildown_markdown_engine_block] = block
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.block
|
12
|
+
Thread.current[:maildown_markdown_engine_block]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
Maildown::MarkdownEngine.set do |string|
|
18
|
+
Kramdown::Document.new(string).to_html
|
19
|
+
end
|
data/lib/maildown/md.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
module Maildown
|
2
|
+
class Md
|
3
|
+
attr_accessor :string
|
4
|
+
|
5
|
+
# responses is an array of hashes containing a body: and :content_type
|
6
|
+
def initialize(responses)
|
7
|
+
@responses = responses.reject {|r| r[:content_type] == Mime::HTML.to_s || r[:content_type] == Mime::TEXT.to_s }
|
8
|
+
md_response = responses.detect {|r| r[:content_type] == Mime::MD.to_s }
|
9
|
+
if md_response.present?
|
10
|
+
@string = md_response[:body]
|
11
|
+
@responses.delete(md_response)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_text
|
16
|
+
string
|
17
|
+
end
|
18
|
+
|
19
|
+
def to_html
|
20
|
+
Maildown::MarkdownEngine.to_html(string)
|
21
|
+
end
|
22
|
+
|
23
|
+
def to_responses
|
24
|
+
[
|
25
|
+
{ body: to_text, content_type: "text/plain"},
|
26
|
+
{ body: to_html, content_type: "text/html"}
|
27
|
+
].concat(@responses)
|
28
|
+
end
|
29
|
+
|
30
|
+
|
31
|
+
def contains_md?
|
32
|
+
string.present?
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/maildown/version.rb
CHANGED
data/lib/maildown.rb
CHANGED
@@ -1,40 +1,8 @@
|
|
1
|
-
require "maildown/engine"
|
2
1
|
require 'kramdown'
|
3
2
|
|
4
3
|
module Maildown
|
5
|
-
class Md
|
6
|
-
attr_accessor :string
|
7
|
-
|
8
|
-
# responses is an array of hashes containing a body: and :content_type
|
9
|
-
def initialize(responses)
|
10
|
-
@responses = responses.reject {|r| r[:content_type] == Mime::HTML.to_s || r[:content_type] == Mime::TEXT.to_s }
|
11
|
-
md_response = responses.detect {|r| r[:content_type] == Mime::MD.to_s }
|
12
|
-
if md_response.present?
|
13
|
-
@string = md_response[:body]
|
14
|
-
@responses.delete(md_response)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def to_text
|
19
|
-
string
|
20
|
-
end
|
21
|
-
|
22
|
-
def to_html
|
23
|
-
Kramdown::Document.new(string).to_html
|
24
|
-
end
|
25
|
-
|
26
|
-
def to_responses
|
27
|
-
[
|
28
|
-
{ body: to_text, content_type: "text/plain"},
|
29
|
-
{ body: to_html, content_type: "text/html"}
|
30
|
-
].concat(@responses)
|
31
|
-
end
|
32
|
-
|
33
|
-
|
34
|
-
def contains_md?
|
35
|
-
string.present?
|
36
|
-
end
|
37
|
-
end
|
38
4
|
end
|
39
5
|
|
6
|
+
require 'maildown/markdown_engine'
|
7
|
+
require 'maildown/md'
|
40
8
|
require 'maildown/ext/action_mailer'
|
data/test/dummy/config/routes.rb
CHANGED
data/test/dummy/log/test.log
CHANGED
@@ -1,252 +1,17 @@
|
|
1
|
-
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
2
|
-
-------------------
|
3
|
-
MaildownTest: test_
|
4
|
-
-------------------
|
5
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
6
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
7
|
-
------------------------
|
8
|
-
MaildownTest: test_truth
|
9
|
-
------------------------
|
10
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
11
|
-
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
12
|
-
-------------------
|
13
|
-
MaildownTest: test_
|
14
|
-
-------------------
|
15
|
-
[1m[35m (0.2ms)[0m rollback transaction
|
16
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
17
|
-
------------------------
|
18
|
-
MaildownTest: test_truth
|
19
|
-
------------------------
|
20
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
21
|
-
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
22
|
-
-------------------
|
23
|
-
MaildownTest: test_
|
24
|
-
-------------------
|
25
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
26
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
27
|
-
------------------------
|
28
|
-
MaildownTest: test_truth
|
29
|
-
------------------------
|
30
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
31
|
-
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
32
|
-
------------------------------------
|
33
|
-
MaildownTest: test_no_md_in_response
|
34
|
-
------------------------------------
|
35
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
36
|
-
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
37
|
-
------------------------------------
|
38
|
-
MaildownTest: test_parse_md_response
|
39
|
-
------------------------------------
|
40
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
41
|
-
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
42
|
-
------------------------
|
43
|
-
MaildownTest: test_truth
|
44
|
-
------------------------
|
45
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
46
1
|
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
47
|
-
|
48
|
-
ExtActionMailerTest:
|
49
|
-
|
50
|
-
[1m[35m (0.2ms)[0m rollback transaction
|
51
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
52
|
-
------------------------------------
|
53
|
-
MaildownTest: test_no_md_in_response
|
54
|
-
------------------------------------
|
55
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
56
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
57
|
-
------------------------------------
|
58
|
-
MaildownTest: test_parse_md_response
|
59
|
-
------------------------------------
|
60
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
61
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
62
|
-
------------------------
|
63
|
-
MaildownTest: test_truth
|
64
|
-
------------------------
|
65
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
66
|
-
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
67
|
-
--------------------------
|
68
|
-
ExtActionMailerTest: test_
|
69
|
-
--------------------------
|
70
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
71
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
72
|
-
------------------------------------
|
73
|
-
MaildownTest: test_no_md_in_response
|
74
|
-
------------------------------------
|
75
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
76
|
-
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
77
|
-
------------------------------------
|
78
|
-
MaildownTest: test_parse_md_response
|
79
|
-
------------------------------------
|
80
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
81
|
-
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
82
|
-
------------------------
|
83
|
-
MaildownTest: test_truth
|
84
|
-
------------------------
|
85
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
86
|
-
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
87
|
-
--------------------------
|
88
|
-
ExtActionMailerTest: test_
|
89
|
-
--------------------------
|
90
|
-
[1m[35m (0.2ms)[0m rollback transaction
|
91
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
92
|
-
------------------------------------
|
93
|
-
MaildownTest: test_no_md_in_response
|
94
|
-
------------------------------------
|
95
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
96
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
97
|
-
------------------------------------
|
98
|
-
MaildownTest: test_parse_md_response
|
99
|
-
------------------------------------
|
100
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
101
|
-
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
102
|
-
------------------------
|
103
|
-
MaildownTest: test_truth
|
104
|
-
------------------------
|
105
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
106
|
-
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
107
|
-
--------------------------
|
108
|
-
ExtActionMailerTest: test_
|
109
|
-
--------------------------
|
110
|
-
[1m[35m (0.2ms)[0m rollback transaction
|
111
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
112
|
-
------------------------------------
|
113
|
-
MaildownTest: test_no_md_in_response
|
114
|
-
------------------------------------
|
115
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
116
|
-
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
117
|
-
------------------------------------
|
118
|
-
MaildownTest: test_parse_md_response
|
119
|
-
------------------------------------
|
120
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
121
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
122
|
-
------------------------
|
123
|
-
MaildownTest: test_truth
|
124
|
-
------------------------
|
125
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
126
|
-
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
127
|
-
--------------------------
|
128
|
-
ExtActionMailerTest: test_
|
129
|
-
--------------------------
|
130
|
-
[1m[35m (0.2ms)[0m rollback transaction
|
131
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
132
|
-
------------------------------------
|
133
|
-
MaildownTest: test_no_md_in_response
|
134
|
-
------------------------------------
|
135
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
136
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
137
|
-
------------------------------------
|
138
|
-
MaildownTest: test_parse_md_response
|
139
|
-
------------------------------------
|
140
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
141
|
-
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
142
|
-
------------------------
|
143
|
-
MaildownTest: test_truth
|
144
|
-
------------------------
|
145
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
146
|
-
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
147
|
-
--------------------------
|
148
|
-
ExtActionMailerTest: test_
|
149
|
-
--------------------------
|
150
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
151
|
-
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
152
|
-
------------------------------------
|
153
|
-
MaildownTest: test_no_md_in_response
|
154
|
-
------------------------------------
|
155
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
156
|
-
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
157
|
-
------------------------------------
|
158
|
-
MaildownTest: test_parse_md_response
|
159
|
-
------------------------------------
|
2
|
+
-----------------------------------------------------------
|
3
|
+
ExtActionMailerTest: test_correctly_registered_md_mime_type
|
4
|
+
-----------------------------------------------------------
|
160
5
|
[1m[35m (0.1ms)[0m rollback transaction
|
161
6
|
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
166
|
-
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
167
|
-
--------------------------
|
168
|
-
ExtActionMailerTest: test_
|
169
|
-
--------------------------
|
170
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
171
|
-
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
172
|
-
------------------------------------
|
173
|
-
MaildownTest: test_no_md_in_response
|
174
|
-
------------------------------------
|
175
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
176
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
177
|
-
------------------------------------
|
178
|
-
MaildownTest: test_parse_md_response
|
179
|
-
------------------------------------
|
180
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
181
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
182
|
-
------------------------
|
183
|
-
MaildownTest: test_truth
|
184
|
-
------------------------
|
185
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
186
|
-
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
187
|
-
--------------------------
|
188
|
-
ExtActionMailerTest: test_
|
189
|
-
--------------------------
|
190
|
-
[1m[35m (0.2ms)[0m rollback transaction
|
191
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
192
|
-
------------------------------------
|
193
|
-
MaildownTest: test_no_md_in_response
|
194
|
-
------------------------------------
|
195
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
196
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
197
|
-
------------------------------------
|
198
|
-
MaildownTest: test_parse_md_response
|
199
|
-
------------------------------------
|
200
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
201
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
202
|
-
------------------------
|
203
|
-
MaildownTest: test_truth
|
204
|
-
------------------------
|
7
|
+
-------------------------------------------------------------
|
8
|
+
ExtActionMailerTest: test_default_types_on_action_mailer_base
|
9
|
+
-------------------------------------------------------------
|
205
10
|
[1m[35m (0.0ms)[0m rollback transaction
|
206
|
-
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
207
|
-
--------------------------
|
208
|
-
ExtActionMailerTest: test_
|
209
|
-
--------------------------
|
210
|
-
[1m[35m (0.2ms)[0m rollback transaction
|
211
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
212
|
-
------------------------------------
|
213
|
-
MaildownTest: test_no_md_in_response
|
214
|
-
------------------------------------
|
215
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
216
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
217
|
-
------------------------------------
|
218
|
-
MaildownTest: test_parse_md_response
|
219
|
-
------------------------------------
|
220
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
221
11
|
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
226
|
-
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
227
|
-
--------------------------
|
228
|
-
ExtActionMailerTest: test_
|
229
|
-
--------------------------
|
230
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
231
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
232
|
-
------------------------------------
|
233
|
-
MaildownTest: test_no_md_in_response
|
234
|
-
------------------------------------
|
235
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
236
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
237
|
-
------------------------------------
|
238
|
-
MaildownTest: test_parse_md_response
|
239
|
-
------------------------------------
|
240
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
241
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
242
|
-
------------------------
|
243
|
-
MaildownTest: test_truth
|
244
|
-
------------------------
|
245
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
246
|
-
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
247
|
-
--------------------------
|
248
|
-
ExtActionMailerTest: test_
|
249
|
-
--------------------------
|
12
|
+
----------------------------------------------
|
13
|
+
ExtActionMailerTest: test_monkeypatch_location
|
14
|
+
----------------------------------------------
|
250
15
|
[1m[35m (0.0ms)[0m rollback transaction
|
251
16
|
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
252
17
|
------------------------------------
|
@@ -256,43 +21,23 @@ MaildownTest: test_no_md_in_response
|
|
256
21
|
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
257
22
|
------------------------------------
|
258
23
|
MaildownTest: test_parse_md_response
|
259
|
-
------------------------------------
|
260
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
261
|
-
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
262
|
-
------------------------
|
263
|
-
MaildownTest: test_truth
|
264
|
-
------------------------
|
265
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
266
|
-
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
267
|
-
--------------------------
|
268
|
-
ExtActionMailerTest: test_
|
269
|
-
--------------------------
|
270
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
271
|
-
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
272
|
-
------------------------------------
|
273
|
-
MaildownTest: test_no_md_in_response
|
274
|
-
------------------------------------
|
275
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
276
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
277
|
-
------------------------------------
|
278
|
-
MaildownTest: test_parse_md_response
|
279
24
|
------------------------------------
|
280
25
|
[1m[35m (0.1ms)[0m rollback transaction
|
281
|
-
[1m[36m (0.
|
282
|
-
------------------------
|
283
|
-
MaildownTest: test_truth
|
284
|
-
------------------------
|
285
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
286
|
-
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
26
|
+
[1m[36m (0.5ms)[0m [1mbegin transaction[0m
|
287
27
|
-----------------------------------------------------------
|
288
28
|
ExtActionMailerTest: test_correctly_registered_md_mime_type
|
289
29
|
-----------------------------------------------------------
|
290
|
-
[1m[35m (0.
|
30
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
291
31
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
292
32
|
-------------------------------------------------------------
|
293
33
|
ExtActionMailerTest: test_default_types_on_action_mailer_base
|
294
34
|
-------------------------------------------------------------
|
295
|
-
[1m[35m (0.
|
35
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
36
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
37
|
+
----------------------------------------------
|
38
|
+
ExtActionMailerTest: test_monkeypatch_location
|
39
|
+
----------------------------------------------
|
40
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
296
41
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
297
42
|
------------------------------------
|
298
43
|
MaildownTest: test_no_md_in_response
|
@@ -303,22 +48,22 @@ MaildownTest: test_no_md_in_response
|
|
303
48
|
MaildownTest: test_parse_md_response
|
304
49
|
------------------------------------
|
305
50
|
[1m[35m (0.1ms)[0m rollback transaction
|
306
|
-
[1m[36m (0.
|
307
|
-
------------------------
|
308
|
-
MaildownTest: test_truth
|
309
|
-
------------------------
|
310
|
-
[1m[35m (0.0ms)[0m rollback transaction
|
311
|
-
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
51
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
312
52
|
-----------------------------------------------------------
|
313
53
|
ExtActionMailerTest: test_correctly_registered_md_mime_type
|
314
54
|
-----------------------------------------------------------
|
315
55
|
[1m[35m (0.1ms)[0m rollback transaction
|
316
|
-
[1m[36m (0.
|
56
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
317
57
|
-------------------------------------------------------------
|
318
58
|
ExtActionMailerTest: test_default_types_on_action_mailer_base
|
319
59
|
-------------------------------------------------------------
|
320
60
|
[1m[35m (0.0ms)[0m rollback transaction
|
321
61
|
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
62
|
+
----------------------------------------------
|
63
|
+
ExtActionMailerTest: test_monkeypatch_location
|
64
|
+
----------------------------------------------
|
65
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
66
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
322
67
|
------------------------------------
|
323
68
|
MaildownTest: test_no_md_in_response
|
324
69
|
------------------------------------
|
@@ -329,51 +74,51 @@ MaildownTest: test_parse_md_response
|
|
329
74
|
------------------------------------
|
330
75
|
[1m[35m (0.1ms)[0m rollback transaction
|
331
76
|
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
[1m[35m (0.
|
77
|
+
---------------------------------------
|
78
|
+
MarkdownEngineTest: test_can_set_engine
|
79
|
+
---------------------------------------
|
80
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
336
81
|
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
337
82
|
-----------------------------------------------------------
|
338
83
|
ExtActionMailerTest: test_correctly_registered_md_mime_type
|
339
84
|
-----------------------------------------------------------
|
340
85
|
[1m[35m (0.0ms)[0m rollback transaction
|
341
|
-
[1m[36m (0.
|
86
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
342
87
|
-------------------------------------------------------------
|
343
88
|
ExtActionMailerTest: test_default_types_on_action_mailer_base
|
344
89
|
-------------------------------------------------------------
|
345
90
|
[1m[35m (0.0ms)[0m rollback transaction
|
346
|
-
[1m[36m (0.
|
91
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
347
92
|
----------------------------------------------
|
348
93
|
ExtActionMailerTest: test_monkeypatch_location
|
349
94
|
----------------------------------------------
|
350
|
-
[1m[35m (0.
|
351
|
-
[1m[36m (0.
|
95
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
96
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
352
97
|
------------------------------------
|
353
98
|
MaildownTest: test_no_md_in_response
|
354
99
|
------------------------------------
|
355
|
-
[1m[35m (0.
|
100
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
356
101
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
357
102
|
------------------------------------
|
358
103
|
MaildownTest: test_parse_md_response
|
359
104
|
------------------------------------
|
360
105
|
[1m[35m (0.1ms)[0m rollback transaction
|
361
106
|
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
[1m[35m (0.
|
107
|
+
---------------------------------------
|
108
|
+
MarkdownEngineTest: test_can_set_engine
|
109
|
+
---------------------------------------
|
110
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
366
111
|
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
367
112
|
-----------------------------------------------------------
|
368
113
|
ExtActionMailerTest: test_correctly_registered_md_mime_type
|
369
114
|
-----------------------------------------------------------
|
370
115
|
[1m[35m (0.0ms)[0m rollback transaction
|
371
|
-
[1m[36m (0.
|
116
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
372
117
|
-------------------------------------------------------------
|
373
118
|
ExtActionMailerTest: test_default_types_on_action_mailer_base
|
374
119
|
-------------------------------------------------------------
|
375
120
|
[1m[35m (0.0ms)[0m rollback transaction
|
376
|
-
[1m[36m (0.
|
121
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
377
122
|
----------------------------------------------
|
378
123
|
ExtActionMailerTest: test_monkeypatch_location
|
379
124
|
----------------------------------------------
|
@@ -383,21 +128,21 @@ ExtActionMailerTest: test_monkeypatch_location
|
|
383
128
|
MaildownTest: test_no_md_in_response
|
384
129
|
------------------------------------
|
385
130
|
[1m[35m (0.0ms)[0m rollback transaction
|
386
|
-
[1m[36m (0.
|
131
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
387
132
|
------------------------------------
|
388
133
|
MaildownTest: test_parse_md_response
|
389
134
|
------------------------------------
|
390
135
|
[1m[35m (0.1ms)[0m rollback transaction
|
391
136
|
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
392
|
-
|
393
|
-
|
394
|
-
|
137
|
+
---------------------------------------
|
138
|
+
MarkdownEngineTest: test_can_set_engine
|
139
|
+
---------------------------------------
|
395
140
|
[1m[35m (0.0ms)[0m rollback transaction
|
396
|
-
[1m[36m (0.
|
141
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
397
142
|
-----------------------------------------------------------
|
398
143
|
ExtActionMailerTest: test_correctly_registered_md_mime_type
|
399
144
|
-----------------------------------------------------------
|
400
|
-
[1m[35m (0.
|
145
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
401
146
|
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
402
147
|
-------------------------------------------------------------
|
403
148
|
ExtActionMailerTest: test_default_types_on_action_mailer_base
|
@@ -418,8 +163,8 @@ MaildownTest: test_no_md_in_response
|
|
418
163
|
MaildownTest: test_parse_md_response
|
419
164
|
------------------------------------
|
420
165
|
[1m[35m (0.1ms)[0m rollback transaction
|
421
|
-
[1m[36m (0.
|
422
|
-
|
423
|
-
|
424
|
-
|
166
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
167
|
+
---------------------------------------
|
168
|
+
MarkdownEngineTest: test_can_set_engine
|
169
|
+
---------------------------------------
|
425
170
|
[1m[35m (0.0ms)[0m rollback transaction
|
data/test/test_helper.rb
CHANGED
@@ -10,9 +10,9 @@ Rails.backtrace_cleaner.remove_silencers!
|
|
10
10
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
11
11
|
|
12
12
|
# Load fixtures from the engine
|
13
|
-
if ActiveSupport::TestCase.method_defined?(:fixture_path=)
|
14
|
-
|
15
|
-
end
|
13
|
+
# if ActiveSupport::TestCase.method_defined?(:fixture_path=)
|
14
|
+
# ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
15
|
+
# end
|
16
16
|
|
17
17
|
|
18
18
|
def orig_text_response
|
data/test/unit/maildown_test.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class MarkdownEngineTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@default_setup = Maildown::MarkdownEngine.block
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
Maildown::MarkdownEngine.set(&@default_setup)
|
11
|
+
end
|
12
|
+
|
13
|
+
test "can set engine" do
|
14
|
+
Maildown::MarkdownEngine.set do |text|
|
15
|
+
"foo: #{text}"
|
16
|
+
end
|
17
|
+
assert_equal "foo: bar", Maildown::MarkdownEngine.to_html("bar")
|
18
|
+
end
|
19
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maildown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- schneems
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '>'
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '>'
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 4.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: kramdown
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -60,14 +60,9 @@ executables: []
|
|
60
60
|
extensions: []
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
|
-
- app/assets/javascripts/maildown/application.js
|
64
|
-
- app/assets/stylesheets/maildown/application.css
|
65
|
-
- app/controllers/maildown/application_controller.rb
|
66
|
-
- app/helpers/maildown/application_helper.rb
|
67
|
-
- app/views/layouts/maildown/application.html.erb
|
68
|
-
- config/routes.rb
|
69
|
-
- lib/maildown/engine.rb
|
70
63
|
- lib/maildown/ext/action_mailer.rb
|
64
|
+
- lib/maildown/markdown_engine.rb
|
65
|
+
- lib/maildown/md.rb
|
71
66
|
- lib/maildown/version.rb
|
72
67
|
- lib/maildown.rb
|
73
68
|
- lib/tasks/maildown_tasks.rake
|
@@ -106,11 +101,10 @@ files:
|
|
106
101
|
- test/dummy/public/favicon.ico
|
107
102
|
- test/dummy/Rakefile
|
108
103
|
- test/dummy/README.rdoc
|
109
|
-
- test/integration/navigation_test.rb
|
110
|
-
- test/maildown_test.rb
|
111
104
|
- test/test_helper.rb
|
112
105
|
- test/unit/ext_action_mailer_test.rb
|
113
106
|
- test/unit/maildown_test.rb
|
107
|
+
- test/unit/markdown_engine_test.rb
|
114
108
|
homepage: https://www.github.com/schneems/maildown
|
115
109
|
licenses:
|
116
110
|
- MIT
|
@@ -169,8 +163,7 @@ test_files:
|
|
169
163
|
- test/dummy/public/favicon.ico
|
170
164
|
- test/dummy/Rakefile
|
171
165
|
- test/dummy/README.rdoc
|
172
|
-
- test/integration/navigation_test.rb
|
173
|
-
- test/maildown_test.rb
|
174
166
|
- test/test_helper.rb
|
175
167
|
- test/unit/ext_action_mailer_test.rb
|
176
168
|
- test/unit/maildown_test.rb
|
169
|
+
- test/unit/markdown_engine_test.rb
|
@@ -1,13 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file.
|
9
|
-
//
|
10
|
-
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
11
|
-
// about supported directives.
|
12
|
-
//
|
13
|
-
//= require_tree .
|
@@ -1,13 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
-
* listed below.
|
4
|
-
*
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
-
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
-
*
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
|
-
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
-
*
|
11
|
-
*= require_self
|
12
|
-
*= require_tree .
|
13
|
-
*/
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Maildown</title>
|
5
|
-
<%= stylesheet_link_tag "maildown/application", media: "all" %>
|
6
|
-
<%= javascript_include_tag "maildown/application" %>
|
7
|
-
<%= csrf_meta_tags %>
|
8
|
-
</head>
|
9
|
-
<body>
|
10
|
-
|
11
|
-
<%= yield %>
|
12
|
-
|
13
|
-
</body>
|
14
|
-
</html>
|
data/config/routes.rb
DELETED
data/lib/maildown/engine.rb
DELETED