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