maildown 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/maildown/markdown_engine.rb +6 -6
- data/lib/maildown/version.rb +1 -1
- data/test/dummy/log/test.log +315 -0
- data/test/unit/markdown_engine_test.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fbb042d5b05b5808b449558be71d6368b078217
|
4
|
+
data.tar.gz: 7fb8d61976d1b8a372ceda791f2c0469fb2ee007
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62200cf6528749371a68749dcac9f8cbdf122c73608921ba8184c9a094b7dc031bed12f86a4f04ddb4b727ae1905e8bbaa2d81073bb6dd803b8479fc5365dc3d
|
7
|
+
data.tar.gz: 2d4b1ceda215343801a35643a26805cdee546f638ef84023a251ffac395c2decf3e669177ebe397e6177015b23ec83f120297446bfff45126df8ca7f144ff330
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Maildown
|
2
2
|
module MarkdownEngine
|
3
3
|
def self.to_html(string)
|
4
|
-
|
4
|
+
block.call(string)
|
5
5
|
end
|
6
6
|
|
7
7
|
def self.set(&block)
|
@@ -9,11 +9,11 @@ module Maildown
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.block
|
12
|
-
Thread.current[:maildown_markdown_engine_block]
|
12
|
+
Thread.current[:maildown_markdown_engine_block] || default
|
13
13
|
end
|
14
|
-
end
|
15
|
-
end
|
16
14
|
|
17
|
-
|
18
|
-
|
15
|
+
def self.default
|
16
|
+
->(string) { Kramdown::Document.new(string).to_html }
|
17
|
+
end
|
18
|
+
end
|
19
19
|
end
|
data/lib/maildown/version.rb
CHANGED
data/test/dummy/log/test.log
CHANGED
@@ -168,3 +168,318 @@ MaildownTest: test_parse_md_response
|
|
168
168
|
MarkdownEngineTest: test_can_set_engine
|
169
169
|
---------------------------------------
|
170
170
|
[1m[35m (0.0ms)[0m rollback transaction
|
171
|
+
[1m[36m (0.4ms)[0m [1mbegin transaction[0m
|
172
|
+
-----------------------------------------------------------
|
173
|
+
ExtActionMailerTest: test_correctly_registered_md_mime_type
|
174
|
+
-----------------------------------------------------------
|
175
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
176
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
177
|
+
-------------------------------------------------------------
|
178
|
+
ExtActionMailerTest: test_default_types_on_action_mailer_base
|
179
|
+
-------------------------------------------------------------
|
180
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
181
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
182
|
+
----------------------------------------------
|
183
|
+
ExtActionMailerTest: test_monkeypatch_location
|
184
|
+
----------------------------------------------
|
185
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
186
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
187
|
+
------------------------------------
|
188
|
+
MaildownTest: test_no_md_in_response
|
189
|
+
------------------------------------
|
190
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
191
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
192
|
+
------------------------------------
|
193
|
+
MaildownTest: test_parse_md_response
|
194
|
+
------------------------------------
|
195
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
196
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
197
|
+
---------------------------------------
|
198
|
+
MarkdownEngineTest: test_can_set_engine
|
199
|
+
---------------------------------------
|
200
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
201
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
202
|
+
--------------------------------------------
|
203
|
+
MarkdownEngineTest: test_multiple_threads_yo
|
204
|
+
--------------------------------------------
|
205
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
206
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
207
|
+
-----------------------------------------------------------
|
208
|
+
ExtActionMailerTest: test_correctly_registered_md_mime_type
|
209
|
+
-----------------------------------------------------------
|
210
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
211
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
212
|
+
-------------------------------------------------------------
|
213
|
+
ExtActionMailerTest: test_default_types_on_action_mailer_base
|
214
|
+
-------------------------------------------------------------
|
215
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
216
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
217
|
+
----------------------------------------------
|
218
|
+
ExtActionMailerTest: test_monkeypatch_location
|
219
|
+
----------------------------------------------
|
220
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
221
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
222
|
+
------------------------------------
|
223
|
+
MaildownTest: test_no_md_in_response
|
224
|
+
------------------------------------
|
225
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
226
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
227
|
+
------------------------------------
|
228
|
+
MaildownTest: test_parse_md_response
|
229
|
+
------------------------------------
|
230
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
231
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
232
|
+
---------------------------------------
|
233
|
+
MarkdownEngineTest: test_can_set_engine
|
234
|
+
---------------------------------------
|
235
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
236
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
237
|
+
--------------------------------------------
|
238
|
+
MarkdownEngineTest: test_multiple_threads_yo
|
239
|
+
--------------------------------------------
|
240
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
241
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
242
|
+
-----------------------------------------------------------
|
243
|
+
ExtActionMailerTest: test_correctly_registered_md_mime_type
|
244
|
+
-----------------------------------------------------------
|
245
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
246
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
247
|
+
-------------------------------------------------------------
|
248
|
+
ExtActionMailerTest: test_default_types_on_action_mailer_base
|
249
|
+
-------------------------------------------------------------
|
250
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
251
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
252
|
+
----------------------------------------------
|
253
|
+
ExtActionMailerTest: test_monkeypatch_location
|
254
|
+
----------------------------------------------
|
255
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
256
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
257
|
+
------------------------------------
|
258
|
+
MaildownTest: test_no_md_in_response
|
259
|
+
------------------------------------
|
260
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
261
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
262
|
+
------------------------------------
|
263
|
+
MaildownTest: test_parse_md_response
|
264
|
+
------------------------------------
|
265
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
266
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
267
|
+
---------------------------------------
|
268
|
+
MarkdownEngineTest: test_can_set_engine
|
269
|
+
---------------------------------------
|
270
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
271
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
272
|
+
----------------------------------------------------------
|
273
|
+
MarkdownEngineTest: test_default_works_in_multiple_threads
|
274
|
+
----------------------------------------------------------
|
275
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
276
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
277
|
+
-----------------------------------------------------------
|
278
|
+
ExtActionMailerTest: test_correctly_registered_md_mime_type
|
279
|
+
-----------------------------------------------------------
|
280
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
281
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
282
|
+
-------------------------------------------------------------
|
283
|
+
ExtActionMailerTest: test_default_types_on_action_mailer_base
|
284
|
+
-------------------------------------------------------------
|
285
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
286
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
287
|
+
----------------------------------------------
|
288
|
+
ExtActionMailerTest: test_monkeypatch_location
|
289
|
+
----------------------------------------------
|
290
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
291
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
292
|
+
------------------------------------
|
293
|
+
MaildownTest: test_no_md_in_response
|
294
|
+
------------------------------------
|
295
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
296
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
297
|
+
------------------------------------
|
298
|
+
MaildownTest: test_parse_md_response
|
299
|
+
------------------------------------
|
300
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
301
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
302
|
+
---------------------------------------
|
303
|
+
MarkdownEngineTest: test_can_set_engine
|
304
|
+
---------------------------------------
|
305
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
306
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
307
|
+
----------------------------------------------------------
|
308
|
+
MarkdownEngineTest: test_default_works_in_multiple_threads
|
309
|
+
----------------------------------------------------------
|
310
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
311
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
312
|
+
-----------------------------------------------------------
|
313
|
+
ExtActionMailerTest: test_correctly_registered_md_mime_type
|
314
|
+
-----------------------------------------------------------
|
315
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
316
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
317
|
+
-------------------------------------------------------------
|
318
|
+
ExtActionMailerTest: test_default_types_on_action_mailer_base
|
319
|
+
-------------------------------------------------------------
|
320
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
321
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
322
|
+
----------------------------------------------
|
323
|
+
ExtActionMailerTest: test_monkeypatch_location
|
324
|
+
----------------------------------------------
|
325
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
326
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
327
|
+
------------------------------------
|
328
|
+
MaildownTest: test_no_md_in_response
|
329
|
+
------------------------------------
|
330
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
331
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
332
|
+
------------------------------------
|
333
|
+
MaildownTest: test_parse_md_response
|
334
|
+
------------------------------------
|
335
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
336
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
337
|
+
---------------------------------------
|
338
|
+
MarkdownEngineTest: test_can_set_engine
|
339
|
+
---------------------------------------
|
340
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
341
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
342
|
+
----------------------------------------------------------
|
343
|
+
MarkdownEngineTest: test_default_works_in_multiple_threads
|
344
|
+
----------------------------------------------------------
|
345
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
346
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
347
|
+
-----------------------------------------------------------
|
348
|
+
ExtActionMailerTest: test_correctly_registered_md_mime_type
|
349
|
+
-----------------------------------------------------------
|
350
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
351
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
352
|
+
-------------------------------------------------------------
|
353
|
+
ExtActionMailerTest: test_default_types_on_action_mailer_base
|
354
|
+
-------------------------------------------------------------
|
355
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
356
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
357
|
+
----------------------------------------------
|
358
|
+
ExtActionMailerTest: test_monkeypatch_location
|
359
|
+
----------------------------------------------
|
360
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
361
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
362
|
+
------------------------------------
|
363
|
+
MaildownTest: test_no_md_in_response
|
364
|
+
------------------------------------
|
365
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
366
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
367
|
+
------------------------------------
|
368
|
+
MaildownTest: test_parse_md_response
|
369
|
+
------------------------------------
|
370
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
371
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
372
|
+
---------------------------------------
|
373
|
+
MarkdownEngineTest: test_can_set_engine
|
374
|
+
---------------------------------------
|
375
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
376
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
377
|
+
----------------------------------------------------------
|
378
|
+
MarkdownEngineTest: test_default_works_in_multiple_threads
|
379
|
+
----------------------------------------------------------
|
380
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
381
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
382
|
+
-----------------------------------------------------------
|
383
|
+
ExtActionMailerTest: test_correctly_registered_md_mime_type
|
384
|
+
-----------------------------------------------------------
|
385
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
386
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
387
|
+
-------------------------------------------------------------
|
388
|
+
ExtActionMailerTest: test_default_types_on_action_mailer_base
|
389
|
+
-------------------------------------------------------------
|
390
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
391
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
392
|
+
----------------------------------------------
|
393
|
+
ExtActionMailerTest: test_monkeypatch_location
|
394
|
+
----------------------------------------------
|
395
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
396
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
397
|
+
------------------------------------
|
398
|
+
MaildownTest: test_no_md_in_response
|
399
|
+
------------------------------------
|
400
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
401
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
402
|
+
------------------------------------
|
403
|
+
MaildownTest: test_parse_md_response
|
404
|
+
------------------------------------
|
405
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
406
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
407
|
+
---------------------------------------
|
408
|
+
MarkdownEngineTest: test_can_set_engine
|
409
|
+
---------------------------------------
|
410
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
411
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
412
|
+
----------------------------------------------------------
|
413
|
+
MarkdownEngineTest: test_default_works_in_multiple_threads
|
414
|
+
----------------------------------------------------------
|
415
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
416
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
417
|
+
-----------------------------------------------------------
|
418
|
+
ExtActionMailerTest: test_correctly_registered_md_mime_type
|
419
|
+
-----------------------------------------------------------
|
420
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
421
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
422
|
+
-------------------------------------------------------------
|
423
|
+
ExtActionMailerTest: test_default_types_on_action_mailer_base
|
424
|
+
-------------------------------------------------------------
|
425
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
426
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
427
|
+
----------------------------------------------
|
428
|
+
ExtActionMailerTest: test_monkeypatch_location
|
429
|
+
----------------------------------------------
|
430
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
431
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
432
|
+
------------------------------------
|
433
|
+
MaildownTest: test_no_md_in_response
|
434
|
+
------------------------------------
|
435
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
436
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
437
|
+
------------------------------------
|
438
|
+
MaildownTest: test_parse_md_response
|
439
|
+
------------------------------------
|
440
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
441
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
442
|
+
---------------------------------------
|
443
|
+
MarkdownEngineTest: test_can_set_engine
|
444
|
+
---------------------------------------
|
445
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
446
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
447
|
+
----------------------------------------------------------
|
448
|
+
MarkdownEngineTest: test_default_works_in_multiple_threads
|
449
|
+
----------------------------------------------------------
|
450
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
451
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
452
|
+
-----------------------------------------------------------
|
453
|
+
ExtActionMailerTest: test_correctly_registered_md_mime_type
|
454
|
+
-----------------------------------------------------------
|
455
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
456
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
457
|
+
-------------------------------------------------------------
|
458
|
+
ExtActionMailerTest: test_default_types_on_action_mailer_base
|
459
|
+
-------------------------------------------------------------
|
460
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
461
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
462
|
+
----------------------------------------------
|
463
|
+
ExtActionMailerTest: test_monkeypatch_location
|
464
|
+
----------------------------------------------
|
465
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
466
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
467
|
+
------------------------------------
|
468
|
+
MaildownTest: test_no_md_in_response
|
469
|
+
------------------------------------
|
470
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
471
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
472
|
+
------------------------------------
|
473
|
+
MaildownTest: test_parse_md_response
|
474
|
+
------------------------------------
|
475
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
476
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
477
|
+
---------------------------------------
|
478
|
+
MarkdownEngineTest: test_can_set_engine
|
479
|
+
---------------------------------------
|
480
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
481
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
482
|
+
----------------------------------------------------------
|
483
|
+
MarkdownEngineTest: test_default_works_in_multiple_threads
|
484
|
+
----------------------------------------------------------
|
485
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
@@ -16,4 +16,11 @@ class MarkdownEngineTest < ActiveSupport::TestCase
|
|
16
16
|
end
|
17
17
|
assert_equal "foo: bar", Maildown::MarkdownEngine.to_html("bar")
|
18
18
|
end
|
19
|
+
|
20
|
+
test "default works in multiple threads" do
|
21
|
+
thread = Thread.new do
|
22
|
+
assert_equal "<p>bar</p>\n", Maildown::MarkdownEngine.to_html("bar")
|
23
|
+
end
|
24
|
+
thread.join
|
25
|
+
end
|
19
26
|
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: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- schneems
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|