media_embed 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8d0087117f0963f39399dc6264be4ffe4829c35
4
- data.tar.gz: b0355a81e0892fb86ae80c4156845d7be19fe153
3
+ metadata.gz: a90e907b4cd3e650fc771df66cb3b58715974d90
4
+ data.tar.gz: 57cf3b73c7cfe00fa5698a7db20fd93a9939a709
5
5
  SHA512:
6
- metadata.gz: 410dc2a1e665cb7fdc798b413477755b7836aa7318d1fa7e92be92884bd032a4856ace6b9511b088dbea023384dceeabf937eefcedc1b08927cc0af865246a5a
7
- data.tar.gz: 2149e6cf94992824bde08ccc6f55c9ed888eecbead31e1dc6ff63cf4b0dfc9470d018e6cdcb470b082786c3f5b111f1fd9393ee78328b9a2837abacfbd2434b2
6
+ metadata.gz: 195eef0aa0b75c958f777f59b379830ab2104de578ce2a1db66d898a92eef972012bf3204fc13b8ab4ecf228d4f1f0600c8ce451ad678e9fa6fc3b384df9e6ea
7
+ data.tar.gz: c9190bfe497e911a109138e3d5e1731ca59d1f50d2f82668e51834b74e4d546964ba033fa3e6623a07fff7cb5c992c9e7637f86a33f74ac01cdcca48b1fb6588
@@ -11,6 +11,8 @@ module MediaEmbed
11
11
  Video.youtube_template(match[CODE])
12
12
  elsif match = vimeo?(url)
13
13
  Video.vimeo_template(match[CODE])
14
+ elsif match = soundcloud?(url)
15
+ Podcast.soundcloud_template(match[CODE])
14
16
  else
15
17
  ''
16
18
  end
@@ -27,6 +29,10 @@ module MediaEmbed
27
29
  url.match vimeo_regex
28
30
  end
29
31
 
32
+ def soundcloud?(url)
33
+ url.match soundcloud_regex
34
+ end
35
+
30
36
  def youtube_regex
31
37
  /youtu(\.be|be\.com)\/(watch\?v=|embed\/|)([^?\s]*)/
32
38
  end
@@ -34,6 +40,10 @@ module MediaEmbed
34
40
  def vimeo_regex
35
41
  /vimeo\.com\/(channels\/\D*|groups\/\D*|album\/\d*\/video\/|video\/|)([^?\s]*)/
36
42
  end
43
+
44
+ def soundcloud_regex
45
+ /soundcloud.com\/(.*\/[a-zA-Z0-9\-\_]*)/
46
+ end
37
47
  end
38
48
  end
39
49
 
@@ -0,0 +1,7 @@
1
+ module MediaEmbed
2
+ class Podcast
3
+ def self.soundcloud_template(code)
4
+ %Q(<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//soundcloud.com/#{code}&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;visual=true"></iframe>)
5
+ end
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module MediaEmbed
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/media_embed.rb CHANGED
@@ -3,6 +3,7 @@ require "media_embed/railtie" if defined? Rails
3
3
 
4
4
  require "media_embed/handler"
5
5
  require "media_embed/video"
6
+ require "media_embed/podcast"
6
7
 
7
8
  module MediaEmbed
8
9
  end
@@ -57,3 +57,12 @@
57
57
  </ul>
58
58
 
59
59
  <h1>Podcasts</h1>
60
+
61
+ <h3>Soundcloud</h3>
62
+
63
+ <ul>
64
+ <li>
65
+ <h5>soundcloud.com/username/CODE</h5>
66
+ <%= embed("https://soundcloud.com/liluzivert/money-longer-radio-rip").html_safe %>
67
+ </li>
68
+ </ul>
@@ -246,3 +246,357 @@ Started GET "/assets/home.self-19a187bec6cdb96d6de80a61c16c857c613536adf9138476b
246
246
 
247
247
 
248
248
  Started GET "/assets/application.self-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js?body=1" for ::1 at 2016-05-26 14:53:58 -0400
249
+
250
+
251
+ Started GET "/" for ::1 at 2016-05-26 15:40:13 -0400
252
+ Processing by HomeController#index as HTML
253
+ Rendered home/index.html.erb within layouts/application (2.3ms)
254
+ Completed 200 OK in 323ms (Views: 323.0ms | ActiveRecord: 0.0ms)
255
+
256
+
257
+ Started GET "/assets/home.self-b60acab5af8d245ed2b3012f77d11d8d207d8eada27756badaf4ef05770d60f6.css?body=1" for ::1 at 2016-05-26 15:40:13 -0400
258
+
259
+
260
+ Started GET "/assets/home.self-19a187bec6cdb96d6de80a61c16c857c613536adf9138476bd367db38d282635.js?body=1" for ::1 at 2016-05-26 15:40:13 -0400
261
+
262
+
263
+ Started GET "/" for ::1 at 2016-05-26 15:41:22 -0400
264
+ Processing by HomeController#index as HTML
265
+ Rendered home/index.html.erb within layouts/application (0.9ms)
266
+ Completed 200 OK in 13ms (Views: 13.1ms | ActiveRecord: 0.0ms)
267
+
268
+
269
+ Started GET "/assets/application.self-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css?body=1" for ::1 at 2016-05-26 15:41:22 -0400
270
+
271
+
272
+ Started GET "/assets/home.self-b60acab5af8d245ed2b3012f77d11d8d207d8eada27756badaf4ef05770d60f6.css?body=1" for ::1 at 2016-05-26 15:41:22 -0400
273
+
274
+
275
+ Started GET "/assets/home.self-19a187bec6cdb96d6de80a61c16c857c613536adf9138476bd367db38d282635.js?body=1" for ::1 at 2016-05-26 15:41:22 -0400
276
+
277
+
278
+ Started GET "/assets/application.self-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js?body=1" for ::1 at 2016-05-26 15:41:22 -0400
279
+
280
+
281
+ Started GET "/" for ::1 at 2016-05-26 15:42:10 -0400
282
+ Processing by HomeController#index as HTML
283
+ Rendered home/index.html.erb within layouts/application (0.9ms)
284
+ Completed 200 OK in 11ms (Views: 10.4ms | ActiveRecord: 0.0ms)
285
+
286
+
287
+ Started GET "/assets/home.self-b60acab5af8d245ed2b3012f77d11d8d207d8eada27756badaf4ef05770d60f6.css?body=1" for ::1 at 2016-05-26 15:42:11 -0400
288
+
289
+
290
+ Started GET "/assets/application.self-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css?body=1" for ::1 at 2016-05-26 15:42:11 -0400
291
+
292
+
293
+ Started GET "/assets/home.self-19a187bec6cdb96d6de80a61c16c857c613536adf9138476bd367db38d282635.js?body=1" for ::1 at 2016-05-26 15:42:11 -0400
294
+
295
+
296
+ Started GET "/assets/application.self-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js?body=1" for ::1 at 2016-05-26 15:42:11 -0400
297
+
298
+
299
+ Started GET "/" for ::1 at 2016-05-26 15:42:21 -0400
300
+ Processing by HomeController#index as HTML
301
+ Rendered home/index.html.erb within layouts/application (57648.8ms)
302
+ Completed 500 Internal Server Error in 57658ms (ActiveRecord: 0.0ms)
303
+
304
+ ActionView::Template::Error (uninitialized constant MediaEmbed::Handler::Podcast):
305
+ 63: <ul>
306
+ 64: <li>
307
+ 65: <h5>soundcloud.com/username/CODE</h5>
308
+ 66: <% embed("https://soundcloud.com/liluzivert/money-longer-radio-rip").html_safe %>
309
+ 67: </li>
310
+ 68: </ul>
311
+ app/views/home/index.html.erb:66:in `_app_views_home_index_html_erb__13326962588793384_70216172096240'
312
+
313
+
314
+ Rendered /Users/wendybeth/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_source.erb (8.4ms)
315
+ Rendered /Users/wendybeth/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (3.1ms)
316
+ Rendered /Users/wendybeth/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (10.5ms)
317
+ Rendered /Users/wendybeth/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout (73.8ms)
318
+
319
+
320
+ Started GET "/" for ::1 at 2016-05-26 15:43:40 -0400
321
+ Processing by HomeController#index as HTML
322
+ Rendered home/index.html.erb within layouts/application (48783.2ms)
323
+ Completed 500 Internal Server Error in 48787ms (ActiveRecord: 0.0ms)
324
+
325
+ ActionView::Template::Error (uninitialized constant MediaEmbed::Handler::Podcast):
326
+ 63: <ul>
327
+ 64: <li>
328
+ 65: <h5>soundcloud.com/username/CODE</h5>
329
+ 66: <% embed("https://soundcloud.com/liluzivert/money-longer-radio-rip").html_safe %>
330
+ 67: </li>
331
+ 68: </ul>
332
+ app/views/home/index.html.erb:66:in `_app_views_home_index_html_erb__13326962588793384_70216172096240'
333
+
334
+
335
+ Rendered /Users/wendybeth/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_source.erb (7.6ms)
336
+ Rendered /Users/wendybeth/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (3.0ms)
337
+ Rendered /Users/wendybeth/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.6ms)
338
+ Rendered /Users/wendybeth/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout (61.5ms)
339
+
340
+
341
+ Started GET "/" for ::1 at 2016-05-26 15:44:40 -0400
342
+ Processing by HomeController#index as HTML
343
+ Rendered home/index.html.erb within layouts/application (2.0ms)
344
+ Completed 200 OK in 268ms (Views: 267.5ms | ActiveRecord: 0.0ms)
345
+
346
+
347
+ Started GET "/assets/application.self-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js?body=1" for ::1 at 2016-05-26 15:44:41 -0400
348
+
349
+
350
+ Started GET "/assets/home.self-b60acab5af8d245ed2b3012f77d11d8d207d8eada27756badaf4ef05770d60f6.css?body=1" for ::1 at 2016-05-26 15:44:41 -0400
351
+
352
+
353
+ Started GET "/assets/application.self-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css?body=1" for ::1 at 2016-05-26 15:44:41 -0400
354
+
355
+
356
+ Started GET "/assets/home.self-19a187bec6cdb96d6de80a61c16c857c613536adf9138476bd367db38d282635.js?body=1" for ::1 at 2016-05-26 15:44:41 -0400
357
+
358
+
359
+ Started GET "/" for ::1 at 2016-05-26 15:46:03 -0400
360
+ Processing by HomeController#index as HTML
361
+ Rendered home/index.html.erb within layouts/application (0.2ms)
362
+ Completed 200 OK in 12ms (Views: 11.7ms | ActiveRecord: 0.0ms)
363
+
364
+
365
+ Started GET "/assets/home.self-b60acab5af8d245ed2b3012f77d11d8d207d8eada27756badaf4ef05770d60f6.css?body=1" for ::1 at 2016-05-26 15:46:04 -0400
366
+
367
+
368
+ Started GET "/assets/application.self-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css?body=1" for ::1 at 2016-05-26 15:46:04 -0400
369
+
370
+
371
+ Started GET "/assets/home.self-19a187bec6cdb96d6de80a61c16c857c613536adf9138476bd367db38d282635.js?body=1" for ::1 at 2016-05-26 15:46:04 -0400
372
+
373
+
374
+ Started GET "/assets/application.self-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js?body=1" for ::1 at 2016-05-26 15:46:04 -0400
375
+
376
+
377
+ Started GET "/" for ::1 at 2016-05-26 15:46:17 -0400
378
+ Processing by HomeController#index as HTML
379
+ Rendered home/index.html.erb within layouts/application (45095.8ms)
380
+ Completed 200 OK in 45376ms (Views: 45376.8ms | ActiveRecord: 0.0ms)
381
+
382
+
383
+ Started GET "/assets/home.self-b60acab5af8d245ed2b3012f77d11d8d207d8eada27756badaf4ef05770d60f6.css?body=1" for ::1 at 2016-05-26 15:47:02 -0400
384
+
385
+
386
+ Started GET "/assets/home.self-19a187bec6cdb96d6de80a61c16c857c613536adf9138476bd367db38d282635.js?body=1" for ::1 at 2016-05-26 15:47:02 -0400
387
+
388
+
389
+ Started GET "/assets/application.self-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css?body=1" for ::1 at 2016-05-26 15:47:02 -0400
390
+
391
+
392
+ Started GET "/assets/application.self-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js?body=1" for ::1 at 2016-05-26 15:47:02 -0400
393
+
394
+
395
+ Started GET "/" for ::1 at 2016-05-26 15:47:58 -0400
396
+ Processing by HomeController#index as HTML
397
+ Rendered home/index.html.erb within layouts/application (4666.5ms)
398
+ Completed 200 OK in 4679ms (Views: 4678.6ms | ActiveRecord: 0.0ms)
399
+
400
+
401
+ Started GET "/assets/home.self-b60acab5af8d245ed2b3012f77d11d8d207d8eada27756badaf4ef05770d60f6.css?body=1" for ::1 at 2016-05-26 15:48:03 -0400
402
+
403
+
404
+ Started GET "/assets/application.self-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js?body=1" for ::1 at 2016-05-26 15:48:03 -0400
405
+
406
+
407
+ Started GET "/assets/application.self-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css?body=1" for ::1 at 2016-05-26 15:48:03 -0400
408
+
409
+
410
+ Started GET "/assets/home.self-19a187bec6cdb96d6de80a61c16c857c613536adf9138476bd367db38d282635.js?body=1" for ::1 at 2016-05-26 15:48:03 -0400
411
+
412
+
413
+ Started GET "/" for ::1 at 2016-05-26 15:49:44 -0400
414
+ Processing by HomeController#index as HTML
415
+ Rendered home/index.html.erb within layouts/application (42321.1ms)
416
+ Completed 200 OK in 56970ms (Views: 52874.9ms | ActiveRecord: 0.0ms)
417
+
418
+
419
+ Started GET "/assets/home.self-b60acab5af8d245ed2b3012f77d11d8d207d8eada27756badaf4ef05770d60f6.css?body=1" for ::1 at 2016-05-26 15:50:41 -0400
420
+
421
+
422
+ Started GET "/assets/application.self-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css?body=1" for ::1 at 2016-05-26 15:50:41 -0400
423
+
424
+
425
+ Started GET "/assets/application.self-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js?body=1" for ::1 at 2016-05-26 15:50:41 -0400
426
+
427
+
428
+ Started GET "/assets/home.self-19a187bec6cdb96d6de80a61c16c857c613536adf9138476bd367db38d282635.js?body=1" for ::1 at 2016-05-26 15:50:41 -0400
429
+
430
+
431
+ Started GET "/" for ::1 at 2016-05-26 15:51:13 -0400
432
+ Processing by HomeController#index as HTML
433
+ Rendered home/index.html.erb within layouts/application (6475.9ms)
434
+ Completed 200 OK in 6487ms (Views: 6486.6ms | ActiveRecord: 0.0ms)
435
+
436
+
437
+ Started GET "/assets/home.self-b60acab5af8d245ed2b3012f77d11d8d207d8eada27756badaf4ef05770d60f6.css?body=1" for ::1 at 2016-05-26 15:51:19 -0400
438
+
439
+
440
+ Started GET "/assets/application.self-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js?body=1" for ::1 at 2016-05-26 15:51:19 -0400
441
+
442
+
443
+ Started GET "/assets/home.self-19a187bec6cdb96d6de80a61c16c857c613536adf9138476bd367db38d282635.js?body=1" for ::1 at 2016-05-26 15:51:19 -0400
444
+
445
+
446
+ Started GET "/assets/application.self-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css?body=1" for ::1 at 2016-05-26 15:51:19 -0400
447
+
448
+
449
+ Started GET "/" for ::1 at 2016-05-26 15:53:22 -0400
450
+ Processing by HomeController#index as HTML
451
+ Rendered home/index.html.erb within layouts/application (20574.9ms)
452
+ Completed 200 OK in 20584ms (Views: 20584.8ms | ActiveRecord: 0.0ms)
453
+
454
+
455
+ Started GET "/" for ::1 at 2016-05-26 15:53:53 -0400
456
+ Processing by HomeController#index as HTML
457
+ Rendered home/index.html.erb within layouts/application (32909.8ms)
458
+ Completed 200 OK in 33177ms (Views: 33177.3ms | ActiveRecord: 0.0ms)
459
+
460
+
461
+ Started GET "/assets/application.self-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js?body=1" for ::1 at 2016-05-26 15:54:26 -0400
462
+
463
+
464
+ Started GET "/assets/home.self-b60acab5af8d245ed2b3012f77d11d8d207d8eada27756badaf4ef05770d60f6.css?body=1" for ::1 at 2016-05-26 15:54:26 -0400
465
+
466
+
467
+ Started GET "/assets/application.self-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css?body=1" for ::1 at 2016-05-26 15:54:26 -0400
468
+
469
+
470
+ Started GET "/assets/home.self-19a187bec6cdb96d6de80a61c16c857c613536adf9138476bd367db38d282635.js?body=1" for ::1 at 2016-05-26 15:54:26 -0400
471
+
472
+
473
+ Started GET "/" for ::1 at 2016-05-26 15:54:31 -0400
474
+ Processing by HomeController#index as HTML
475
+ Rendered home/index.html.erb within layouts/application (48140.5ms)
476
+ Completed 200 OK in 48154ms (Views: 48155.6ms | ActiveRecord: 0.0ms)
477
+
478
+
479
+ Started GET "/assets/home.self-b60acab5af8d245ed2b3012f77d11d8d207d8eada27756badaf4ef05770d60f6.css?body=1" for ::1 at 2016-05-26 15:55:19 -0400
480
+
481
+
482
+ Started GET "/assets/application.self-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css?body=1" for ::1 at 2016-05-26 15:55:19 -0400
483
+
484
+
485
+ Started GET "/assets/home.self-19a187bec6cdb96d6de80a61c16c857c613536adf9138476bd367db38d282635.js?body=1" for ::1 at 2016-05-26 15:55:19 -0400
486
+
487
+
488
+ Started GET "/assets/application.self-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js?body=1" for ::1 at 2016-05-26 15:55:19 -0400
489
+
490
+
491
+ Started GET "/" for ::1 at 2016-05-26 15:56:08 -0400
492
+ Processing by HomeController#index as HTML
493
+ Rendered home/index.html.erb within layouts/application (4559.6ms)
494
+ Completed in 4565ms (ActiveRecord: 0.0ms)
495
+
496
+
497
+ Started GET "/" for ::1 at 2016-05-26 15:56:21 -0400
498
+ Processing by HomeController#index as HTML
499
+ Rendered home/index.html.erb within layouts/application (27737.5ms)
500
+ Completed 200 OK in 28003ms (Views: 28003.1ms | ActiveRecord: 0.0ms)
501
+
502
+
503
+ Started GET "/assets/home.self-b60acab5af8d245ed2b3012f77d11d8d207d8eada27756badaf4ef05770d60f6.css?body=1" for ::1 at 2016-05-26 15:56:49 -0400
504
+
505
+
506
+ Started GET "/assets/application.self-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css?body=1" for ::1 at 2016-05-26 15:56:49 -0400
507
+
508
+
509
+ Started GET "/assets/application.self-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js?body=1" for ::1 at 2016-05-26 15:56:49 -0400
510
+
511
+
512
+ Started GET "/assets/home.self-19a187bec6cdb96d6de80a61c16c857c613536adf9138476bd367db38d282635.js?body=1" for ::1 at 2016-05-26 15:56:49 -0400
513
+
514
+
515
+ Started GET "/" for ::1 at 2016-05-26 15:57:20 -0400
516
+ Processing by HomeController#index as HTML
517
+ Rendered home/index.html.erb within layouts/application (7584.7ms)
518
+ Completed 200 OK in 7596ms (Views: 7595.9ms | ActiveRecord: 0.0ms)
519
+
520
+
521
+ Started GET "/assets/home.self-19a187bec6cdb96d6de80a61c16c857c613536adf9138476bd367db38d282635.js?body=1" for ::1 at 2016-05-26 15:57:27 -0400
522
+
523
+
524
+ Started GET "/assets/home.self-b60acab5af8d245ed2b3012f77d11d8d207d8eada27756badaf4ef05770d60f6.css?body=1" for ::1 at 2016-05-26 15:57:27 -0400
525
+
526
+
527
+ Started GET "/assets/application.self-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js?body=1" for ::1 at 2016-05-26 15:57:27 -0400
528
+
529
+
530
+ Started GET "/assets/application.self-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css?body=1" for ::1 at 2016-05-26 15:57:27 -0400
531
+
532
+
533
+ Started GET "/" for ::1 at 2016-05-26 15:57:38 -0400
534
+ Processing by HomeController#index as HTML
535
+ Rendered home/index.html.erb within layouts/application (2.3ms)
536
+ Completed 200 OK in 383ms (Views: 382.0ms | ActiveRecord: 0.0ms)
537
+
538
+
539
+ Started GET "/assets/application.self-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css?body=1" for ::1 at 2016-05-26 15:57:39 -0400
540
+
541
+
542
+ Started GET "/assets/home.self-19a187bec6cdb96d6de80a61c16c857c613536adf9138476bd367db38d282635.js?body=1" for ::1 at 2016-05-26 15:57:39 -0400
543
+
544
+
545
+ Started GET "/assets/application.self-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js?body=1" for ::1 at 2016-05-26 15:57:39 -0400
546
+
547
+
548
+ Started GET "/assets/home.self-b60acab5af8d245ed2b3012f77d11d8d207d8eada27756badaf4ef05770d60f6.css?body=1" for ::1 at 2016-05-26 15:57:39 -0400
549
+
550
+
551
+ Started GET "/" for ::1 at 2016-05-26 15:57:45 -0400
552
+ Processing by HomeController#index as HTML
553
+ Rendered home/index.html.erb within layouts/application (1.0ms)
554
+ Completed 200 OK in 14ms (Views: 13.6ms | ActiveRecord: 0.0ms)
555
+
556
+
557
+ Started GET "/assets/home.self-b60acab5af8d245ed2b3012f77d11d8d207d8eada27756badaf4ef05770d60f6.css?body=1" for ::1 at 2016-05-26 15:57:46 -0400
558
+
559
+
560
+ Started GET "/assets/application.self-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css?body=1" for ::1 at 2016-05-26 15:57:46 -0400
561
+
562
+
563
+ Started GET "/assets/application.self-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js?body=1" for ::1 at 2016-05-26 15:57:46 -0400
564
+
565
+
566
+ Started GET "/assets/home.self-19a187bec6cdb96d6de80a61c16c857c613536adf9138476bd367db38d282635.js?body=1" for ::1 at 2016-05-26 15:57:46 -0400
567
+
568
+
569
+ Started GET "/" for ::1 at 2016-05-26 16:09:22 -0400
570
+ Processing by HomeController#index as HTML
571
+ Rendered home/index.html.erb within layouts/application (2.6ms)
572
+ Completed 200 OK in 349ms (Views: 348.1ms | ActiveRecord: 0.0ms)
573
+
574
+
575
+ Started GET "/assets/home.self-b60acab5af8d245ed2b3012f77d11d8d207d8eada27756badaf4ef05770d60f6.css?body=1" for ::1 at 2016-05-26 16:09:23 -0400
576
+
577
+
578
+ Started GET "/assets/application.self-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css?body=1" for ::1 at 2016-05-26 16:09:23 -0400
579
+
580
+
581
+ Started GET "/assets/application.self-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js?body=1" for ::1 at 2016-05-26 16:09:23 -0400
582
+
583
+
584
+ Started GET "/assets/home.self-19a187bec6cdb96d6de80a61c16c857c613536adf9138476bd367db38d282635.js?body=1" for ::1 at 2016-05-26 16:09:23 -0400
585
+
586
+
587
+ Started GET "/" for ::1 at 2016-05-26 16:11:14 -0400
588
+ Processing by HomeController#index as HTML
589
+ Rendered home/index.html.erb within layouts/application (2.1ms)
590
+ Completed 200 OK in 333ms (Views: 332.4ms | ActiveRecord: 0.0ms)
591
+
592
+
593
+ Started GET "/assets/application.self-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js?body=1" for ::1 at 2016-05-26 16:11:15 -0400
594
+
595
+
596
+ Started GET "/assets/application.self-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css?body=1" for ::1 at 2016-05-26 16:11:15 -0400
597
+
598
+
599
+ Started GET "/assets/home.self-b60acab5af8d245ed2b3012f77d11d8d207d8eada27756badaf4ef05770d60f6.css?body=1" for ::1 at 2016-05-26 16:11:15 -0400
600
+
601
+
602
+ Started GET "/assets/home.self-19a187bec6cdb96d6de80a61c16c857c613536adf9138476bd367db38d282635.js?body=1" for ::1 at 2016-05-26 16:11:15 -0400
@@ -76,5 +76,130 @@ MediaEmbedTest: test_it_has_a_version_number
76
76
   (0.0ms) begin transaction
77
77
  --------------------------
78
78
  MediaEmbedTest: test_truth
79
+ --------------------------
80
+  (0.0ms) rollback transaction
81
+  (0.1ms) begin transaction
82
+ --------------------------------------------
83
+ MediaEmbedTest: test_it_has_a_version_number
84
+ --------------------------------------------
85
+  (0.0ms) rollback transaction
86
+  (0.1ms) begin transaction
87
+ --------------------------
88
+ MediaEmbedTest: test_truth
89
+ --------------------------
90
+  (0.1ms) rollback transaction
91
+  (0.1ms) begin transaction
92
+ ------------------------------------------------------------
93
+ HandlerTest: test_it_extracts_code_from_all_vimeo_structures
94
+ ------------------------------------------------------------
95
+  (0.0ms) rollback transaction
96
+  (0.1ms) begin transaction
97
+ ---------------------------------------------------------------
98
+ HandlerTest: test_it_extracts_codes_from_all_youtube_structures
99
+ ---------------------------------------------------------------
100
+  (0.0ms) rollback transaction
101
+  (0.1ms) begin transaction
102
+ -----------------------------------------------------------
103
+ HandlerTest: test_it_extracts_code_for_soundcloud_structure
104
+ -----------------------------------------------------------
105
+  (0.0ms) rollback transaction
106
+  (0.1ms) begin transaction
107
+ -----------------------------------------------------------
108
+ HandlerTest: test_it_extracts_code_for_soundcloud_structure
109
+ -----------------------------------------------------------
110
+  (0.1ms) rollback transaction
111
+  (0.1ms) begin transaction
112
+ ------------------------------------------------------------
113
+ HandlerTest: test_it_extracts_code_from_all_vimeo_structures
114
+ ------------------------------------------------------------
115
+  (0.0ms) rollback transaction
116
+  (0.1ms) begin transaction
117
+ ---------------------------------------------------------------
118
+ HandlerTest: test_it_extracts_codes_from_all_youtube_structures
119
+ ---------------------------------------------------------------
120
+  (0.0ms) rollback transaction
121
+  (0.1ms) begin transaction
122
+ --------------------------------------------
123
+ MediaEmbedTest: test_it_has_a_version_number
124
+ --------------------------------------------
125
+  (0.0ms) rollback transaction
126
+  (0.0ms) begin transaction
127
+ --------------------------
128
+ MediaEmbedTest: test_truth
129
+ --------------------------
130
+  (0.0ms) rollback transaction
131
+  (0.2ms) begin transaction
132
+ ---------------------------------------------------------------
133
+ HandlerTest: test_it_extracts_codes_from_all_youtube_structures
134
+ ---------------------------------------------------------------
135
+  (0.1ms) rollback transaction
136
+  (0.1ms) begin transaction
137
+ ------------------------------------------------------------
138
+ HandlerTest: test_it_extracts_code_from_all_vimeo_structures
139
+ ------------------------------------------------------------
140
+  (0.0ms) rollback transaction
141
+  (0.2ms) begin transaction
142
+ -----------------------------------------------------------
143
+ HandlerTest: test_it_extracts_code_for_soundcloud_structure
144
+ -----------------------------------------------------------
145
+  (0.0ms) rollback transaction
146
+  (0.0ms) begin transaction
147
+ --------------------------
148
+ MediaEmbedTest: test_truth
149
+ --------------------------
150
+  (0.0ms) rollback transaction
151
+  (0.2ms) begin transaction
152
+ --------------------------------------------
153
+ MediaEmbedTest: test_it_has_a_version_number
154
+ --------------------------------------------
155
+  (0.1ms) rollback transaction
156
+  (0.1ms) begin transaction
157
+ -----------------------------------------------------------
158
+ HandlerTest: test_it_extracts_code_for_soundcloud_structure
159
+ -----------------------------------------------------------
160
+  (0.1ms) rollback transaction
161
+  (0.1ms) begin transaction
162
+ ------------------------------------------------------------
163
+ HandlerTest: test_it_extracts_code_from_all_vimeo_structures
164
+ ------------------------------------------------------------
165
+  (0.0ms) rollback transaction
166
+  (0.1ms) begin transaction
167
+ ---------------------------------------------------------------
168
+ HandlerTest: test_it_extracts_codes_from_all_youtube_structures
169
+ ---------------------------------------------------------------
170
+  (0.0ms) rollback transaction
171
+  (0.0ms) begin transaction
172
+ --------------------------------------------
173
+ MediaEmbedTest: test_it_has_a_version_number
174
+ --------------------------------------------
175
+  (0.1ms) rollback transaction
176
+  (0.2ms) begin transaction
177
+ --------------------------
178
+ MediaEmbedTest: test_truth
179
+ --------------------------
180
+  (0.1ms) rollback transaction
181
+  (0.1ms) begin transaction
182
+ ------------------------------------------------------------
183
+ HandlerTest: test_it_extracts_code_from_all_vimeo_structures
184
+ ------------------------------------------------------------
185
+  (0.0ms) rollback transaction
186
+  (0.1ms) begin transaction
187
+ -----------------------------------------------------------
188
+ HandlerTest: test_it_extracts_code_for_soundcloud_structure
189
+ -----------------------------------------------------------
190
+  (0.0ms) rollback transaction
191
+  (0.1ms) begin transaction
192
+ ---------------------------------------------------------------
193
+ HandlerTest: test_it_extracts_codes_from_all_youtube_structures
194
+ ---------------------------------------------------------------
195
+  (0.0ms) rollback transaction
196
+  (0.0ms) begin transaction
197
+ --------------------------------------------
198
+ MediaEmbedTest: test_it_has_a_version_number
199
+ --------------------------------------------
200
+  (0.1ms) rollback transaction
201
+  (0.1ms) begin transaction
202
+ --------------------------
203
+ MediaEmbedTest: test_truth
79
204
  --------------------------
80
205
   (0.0ms) rollback transaction
@@ -0,0 +1 @@
1
+ 72525
@@ -19,6 +19,8 @@ class HandlerTest < ActiveSupport::TestCase
19
19
  vimeo.com/album/2222/video/8888
20
20
  )
21
21
 
22
+ SOUNDCLOUD_URL = %w( soundcloud.com/username/code-for-podcast )
23
+
22
24
  test "it extracts codes from all youtube structures" do
23
25
  YOUTUBE_URLS.map { |url| "irrelevantinfo#{url}" }.each do |url|
24
26
  match = youtube?(url)[CODE]
@@ -29,8 +31,13 @@ class HandlerTest < ActiveSupport::TestCase
29
31
  test "it extracts code from all vimeo structures" do
30
32
  VIMEO_URLS.map { |url| "irrelevantinfo#{url}" }.each do |url|
31
33
  match = vimeo?(url)[CODE]
32
- assert match = '8888', "#{url} does not return CODE, it returns #{match}"
34
+ assert match == '8888', "#{url} does not return CODE, it returns #{match}"
33
35
  end
34
36
  end
37
+
38
+ test "it extracts code for soundcloud structure" do
39
+ match = soundcloud?("irrelevantinfo#{SOUNDCLOUD_URL}")[CODE]
40
+ assert match == 'username/code-for-podcast', "#{SOUNDCLOUD_URL} does not return 'username/code-for-podcast', it returns #{match}"
41
+ end
35
42
  end
36
43
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: media_embed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - WendyBeth
@@ -78,6 +78,7 @@ files:
78
78
  - Rakefile
79
79
  - lib/media_embed.rb
80
80
  - lib/media_embed/handler.rb
81
+ - lib/media_embed/podcast.rb
81
82
  - lib/media_embed/railtie.rb
82
83
  - lib/media_embed/version.rb
83
84
  - lib/media_embed/video.rb
@@ -156,6 +157,7 @@ files:
156
157
  - test/dummy/tmp/cache/assets/sprockets/v3.0/ss/ssS2x0Wl67rwXHaVHsh6CO7ayn9fQ5saIwATKN6O-nI.cache
157
158
  - test/dummy/tmp/cache/assets/sprockets/v3.0/xt/xtXpwJn_zdX4IYipCeokPBOCp4guNpM9V_ybPdFSDFA.cache
158
159
  - test/dummy/tmp/cache/assets/sprockets/v3.0/yi/yilpDoLbllD_EjIKIfMFuMgcFT-ypWu98nAxyNQ5xKc.cache
160
+ - test/dummy/tmp/pids/server.pid
159
161
  - test/media_embed/handler_test.rb
160
162
  - test/media_embed_test.rb
161
163
  - test/test_helper.rb
@@ -258,6 +260,7 @@ test_files:
258
260
  - test/dummy/tmp/cache/assets/sprockets/v3.0/xt/xtXpwJn_zdX4IYipCeokPBOCp4guNpM9V_ybPdFSDFA.cache
259
261
  - test/dummy/tmp/cache/assets/sprockets/v3.0/yi/yilpDoLbllD_EjIKIfMFuMgcFT-ypWu98nAxyNQ5xKc.cache
260
262
  - test/dummy/tmp/cache/assets/sprockets/v3.0/Zx/Zx_pY8rr1nkaxuaXAyawN22ouXmPuf7ju8gMSZAuLME.cache
263
+ - test/dummy/tmp/pids/server.pid
261
264
  - test/media_embed/handler_test.rb
262
265
  - test/media_embed_test.rb
263
266
  - test/test_helper.rb