controller-specific-assets 0.1.25 → 0.2.25

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: f3ce558f6cfc404a2dbbb93a2aa94236b1c6bb87
4
- data.tar.gz: 6cebd499a0bc48e6c342163353e96dfa753b9d56
3
+ metadata.gz: ec5abae7e6d647b7c501dfb69afed515cfe24834
4
+ data.tar.gz: f6c1c03c9c0ecbcb5b9fafe09b7ee097cf8ffc71
5
5
  SHA512:
6
- metadata.gz: 5a758dc80ac311594fb91ad85969be67fdef5d51fed311bc896d0213f38865e9d0a9d01726ab15d95b9c97b908bb7aa7eb0cf09307b1a6393511261923741f95
7
- data.tar.gz: 2c57e382f031cf0f7e4839a94329a34feaf8d618cb2663f8830f26a73691437259519cf18b6827c6c96e378d3b2897e214add515b9af7118c13aaf6d2d326189
6
+ metadata.gz: b231c0c6aca0c50da167352de1b0e3cb4037a639dbf3bdb8ba4ed185ef04e1c18893caad2bc6f6d7ec35253851a90628c0dc4ff9a341e8a9344aabfc469cb27e
7
+ data.tar.gz: 4a3638a5ff895754847bef3dd9177a4948900b67990726697fc7e0f773fa7e1e1dab2932e2ae36b50f2f2bec3592417b3cf517d978c72a6af5c49cc5bb4a34d6
@@ -8,6 +8,14 @@ module ControllerSpecificAssetsHelpers
8
8
  stylesheet_link_tag generate_asset_path("controller_#{params[:controller]}", 'css')
9
9
  end
10
10
 
11
+ def controller_javascript_url
12
+ generate_asset_path("controller_#{params[:controller]}", 'js')
13
+ end
14
+
15
+ def controller_stylesheet_url
16
+ generate_asset_path("controller_#{params[:controller]}", 'css')
17
+ end
18
+
11
19
  private
12
20
 
13
21
  def generate_asset_path(path, ext)
@@ -1,3 +1,3 @@
1
1
  module ControllerSpecificAssets
2
- VERSION = "0.1.25"
2
+ VERSION = "0.2.25"
3
3
  end
@@ -5,10 +5,14 @@ class ControllerSpecificAssetsTest < ActiveSupport::TestCase
5
5
  include ActionView::Helpers
6
6
  include ControllerSpecificAssetsHelpers
7
7
 
8
- def test_if_is_module
8
+ def test_if_gem_is_module
9
9
  assert_kind_of Module, ControllerSpecificAssets
10
10
  end
11
11
 
12
+ def test_if_helpers_is_module
13
+ assert_kind_of Module, ControllerSpecificAssetsHelpers
14
+ end
15
+
12
16
  def test_non_existing_javascript_file
13
17
  def params
14
18
  { :controller => "pages" }
@@ -34,7 +38,35 @@ class ControllerSpecificAssetsTest < ActiveSupport::TestCase
34
38
  def params
35
39
  { :controller => "users" }
36
40
  end
37
- assert_equal '<link rel="stylesheet" media="screen" href="/stylesheets/controller_users.css" />', controller_javascript_tag
41
+ assert_equal '<link rel="stylesheet" media="screen" href="/stylesheets/controller_users.css" />', controller_stylesheet_tag
42
+ end
43
+
44
+ def test_non_existing_javascript_file_path
45
+ def params
46
+ { :controller => "pages" }
47
+ end
48
+ assert_equal 'application.js', controller_javascript_url
49
+ end
50
+
51
+ def test_existing_javascript_file_path
52
+ def params
53
+ { :controller => "users" }
54
+ end
55
+ assert_equal 'controller_users.js', controller_javascript_url
56
+ end
57
+
58
+ def test_non_existing_css_file_path
59
+ def params
60
+ { :controller => "pages" }
61
+ end
62
+ assert_equal 'application.css', controller_stylesheet_url
63
+ end
64
+
65
+ def test_existing_css_file_path
66
+ def params
67
+ { :controller => "users" }
68
+ end
69
+ assert_equal 'controller_users.css', controller_stylesheet_url
38
70
  end
39
71
 
40
72
  end
@@ -353,3 +353,283 @@ ControllerSpecificAssetsTest: test_non_existing_css_file
353
353
  ControllerSpecificAssetsTest: test_existing_css_file
354
354
  ----------------------------------------------------
355
355
   (0.1ms) rollback transaction
356
+  (0.1ms) begin transaction
357
+ --------------------------------------------------------
358
+ ControllerSpecificAssetsTest: test_non_existing_css_file
359
+ --------------------------------------------------------
360
+  (0.1ms) rollback transaction
361
+  (0.1ms) begin transaction
362
+ -----------------------------------------------------------
363
+ ControllerSpecificAssetsTest: test_existing_javascript_file
364
+ -----------------------------------------------------------
365
+  (0.0ms) rollback transaction
366
+  (0.0ms) begin transaction
367
+ ----------------------------------------------------
368
+ ControllerSpecificAssetsTest: test_existing_css_file
369
+ ----------------------------------------------------
370
+  (0.1ms) rollback transaction
371
+  (0.1ms) begin transaction
372
+ -----------------------------------------------
373
+ ControllerSpecificAssetsTest: test_if_is_module
374
+ -----------------------------------------------
375
+  (0.0ms) rollback transaction
376
+  (0.1ms) begin transaction
377
+ ---------------------------------------------------------------
378
+ ControllerSpecificAssetsTest: test_non_existing_javascript_file
379
+ ---------------------------------------------------------------
380
+  (0.0ms) rollback transaction
381
+  (0.1ms) begin transaction
382
+ -----------------------------------------------
383
+ ControllerSpecificAssetsTest: test_if_is_module
384
+ -----------------------------------------------
385
+  (0.1ms) rollback transaction
386
+  (0.1ms) begin transaction
387
+ -----------------------------------------------------------
388
+ ControllerSpecificAssetsTest: test_existing_javascript_file
389
+ -----------------------------------------------------------
390
+  (0.1ms) rollback transaction
391
+  (0.1ms) begin transaction
392
+ ----------------------------------------------------
393
+ ControllerSpecificAssetsTest: test_existing_css_file
394
+ ----------------------------------------------------
395
+  (0.0ms) rollback transaction
396
+  (0.0ms) begin transaction
397
+ --------------------------------------------------------
398
+ ControllerSpecificAssetsTest: test_non_existing_css_file
399
+ --------------------------------------------------------
400
+  (0.0ms) rollback transaction
401
+  (0.0ms) begin transaction
402
+ ---------------------------------------------------------------
403
+ ControllerSpecificAssetsTest: test_non_existing_javascript_file
404
+ ---------------------------------------------------------------
405
+  (0.0ms) rollback transaction
406
+  (0.1ms) begin transaction
407
+ -----------------------------------------------
408
+ ControllerSpecificAssetsTest: test_if_is_module
409
+ -----------------------------------------------
410
+  (0.1ms) rollback transaction
411
+  (0.1ms) begin transaction
412
+ ---------------------------------------------------------------
413
+ ControllerSpecificAssetsTest: test_non_existing_javascript_file
414
+ ---------------------------------------------------------------
415
+  (0.1ms) rollback transaction
416
+  (0.1ms) begin transaction
417
+ ----------------------------------------------------
418
+ ControllerSpecificAssetsTest: test_existing_css_file
419
+ ----------------------------------------------------
420
+  (0.1ms) rollback transaction
421
+  (0.1ms) begin transaction
422
+ --------------------------------------------------------
423
+ ControllerSpecificAssetsTest: test_non_existing_css_file
424
+ --------------------------------------------------------
425
+  (0.0ms) rollback transaction
426
+  (0.1ms) begin transaction
427
+ -----------------------------------------------------------
428
+ ControllerSpecificAssetsTest: test_existing_javascript_file
429
+ -----------------------------------------------------------
430
+  (0.0ms) rollback transaction
431
+  (0.1ms) begin transaction
432
+ --------------------------------------------------------------------
433
+ ControllerSpecificAssetsTest: test_non_existing_javascript_file_path
434
+ --------------------------------------------------------------------
435
+  (0.0ms) rollback transaction
436
+  (0.1ms) begin transaction
437
+ --------------------------------------------------------
438
+ ControllerSpecificAssetsTest: test_non_existing_css_file
439
+ --------------------------------------------------------
440
+  (0.1ms) rollback transaction
441
+  (0.0ms) begin transaction
442
+ ---------------------------------------------------------------
443
+ ControllerSpecificAssetsTest: test_non_existing_javascript_file
444
+ ---------------------------------------------------------------
445
+  (0.1ms) rollback transaction
446
+  (0.1ms) begin transaction
447
+ -----------------------------------------------
448
+ ControllerSpecificAssetsTest: test_if_is_module
449
+ -----------------------------------------------
450
+  (0.0ms) rollback transaction
451
+  (0.0ms) begin transaction
452
+ -----------------------------------------------------------
453
+ ControllerSpecificAssetsTest: test_existing_javascript_file
454
+ -----------------------------------------------------------
455
+  (0.0ms) rollback transaction
456
+  (0.1ms) begin transaction
457
+ ----------------------------------------------------
458
+ ControllerSpecificAssetsTest: test_existing_css_file
459
+ ----------------------------------------------------
460
+  (0.0ms) rollback transaction
461
+  (0.1ms) begin transaction
462
+ --------------------------------------------------------------------
463
+ ControllerSpecificAssetsTest: test_non_existing_javascript_file_path
464
+ --------------------------------------------------------------------
465
+  (0.0ms) rollback transaction
466
+  (0.1ms) begin transaction
467
+ ----------------------------------------------------
468
+ ControllerSpecificAssetsTest: test_existing_css_file
469
+ ----------------------------------------------------
470
+  (0.1ms) rollback transaction
471
+  (0.1ms) begin transaction
472
+ --------------------------------------------------------
473
+ ControllerSpecificAssetsTest: test_non_existing_css_file
474
+ --------------------------------------------------------
475
+  (0.0ms) rollback transaction
476
+  (0.1ms) begin transaction
477
+ -----------------------------------------------
478
+ ControllerSpecificAssetsTest: test_if_is_module
479
+ -----------------------------------------------
480
+  (0.0ms) rollback transaction
481
+  (0.0ms) begin transaction
482
+ ----------------------------------------------------------------
483
+ ControllerSpecificAssetsTest: test_existing_javascript_file_path
484
+ ----------------------------------------------------------------
485
+  (0.0ms) rollback transaction
486
+  (0.1ms) begin transaction
487
+ -----------------------------------------------------------
488
+ ControllerSpecificAssetsTest: test_existing_javascript_file
489
+ -----------------------------------------------------------
490
+  (0.0ms) rollback transaction
491
+  (0.1ms) begin transaction
492
+ ---------------------------------------------------------------
493
+ ControllerSpecificAssetsTest: test_non_existing_javascript_file
494
+ ---------------------------------------------------------------
495
+  (0.0ms) rollback transaction
496
+  (0.1ms) begin transaction
497
+ --------------------------------------------------------------------
498
+ ControllerSpecificAssetsTest: test_non_existing_javascript_file_path
499
+ --------------------------------------------------------------------
500
+  (0.0ms) rollback transaction
501
+  (0.1ms) begin transaction
502
+ ----------------------------------------------------
503
+ ControllerSpecificAssetsTest: test_existing_css_file
504
+ ----------------------------------------------------
505
+  (0.1ms) rollback transaction
506
+  (0.1ms) begin transaction
507
+ -------------------------------------------------------------
508
+ ControllerSpecificAssetsTest: test_non_existing_css_file_path
509
+ -------------------------------------------------------------
510
+  (0.0ms) rollback transaction
511
+  (0.1ms) begin transaction
512
+ ----------------------------------------------------------------
513
+ ControllerSpecificAssetsTest: test_existing_javascript_file_path
514
+ ----------------------------------------------------------------
515
+  (0.0ms) rollback transaction
516
+  (0.1ms) begin transaction
517
+ --------------------------------------------------------
518
+ ControllerSpecificAssetsTest: test_non_existing_css_file
519
+ --------------------------------------------------------
520
+  (0.1ms) rollback transaction
521
+  (0.1ms) begin transaction
522
+ -----------------------------------------------------------
523
+ ControllerSpecificAssetsTest: test_existing_javascript_file
524
+ -----------------------------------------------------------
525
+  (0.0ms) rollback transaction
526
+  (0.1ms) begin transaction
527
+ --------------------------------------------------------------------
528
+ ControllerSpecificAssetsTest: test_non_existing_javascript_file_path
529
+ --------------------------------------------------------------------
530
+  (0.0ms) rollback transaction
531
+  (0.1ms) begin transaction
532
+ ---------------------------------------------------------------
533
+ ControllerSpecificAssetsTest: test_non_existing_javascript_file
534
+ ---------------------------------------------------------------
535
+  (0.0ms) rollback transaction
536
+  (0.0ms) begin transaction
537
+ -----------------------------------------------
538
+ ControllerSpecificAssetsTest: test_if_is_module
539
+ -----------------------------------------------
540
+  (0.0ms) rollback transaction
541
+  (0.1ms) begin transaction
542
+ --------------------------------------------------------
543
+ ControllerSpecificAssetsTest: test_non_existing_css_file
544
+ --------------------------------------------------------
545
+  (0.1ms) rollback transaction
546
+  (0.1ms) begin transaction
547
+ ---------------------------------------------------------------
548
+ ControllerSpecificAssetsTest: test_non_existing_javascript_file
549
+ ---------------------------------------------------------------
550
+  (0.0ms) rollback transaction
551
+  (0.1ms) begin transaction
552
+ ----------------------------------------------------------------
553
+ ControllerSpecificAssetsTest: test_existing_javascript_file_path
554
+ ----------------------------------------------------------------
555
+  (0.1ms) rollback transaction
556
+  (0.1ms) begin transaction
557
+ --------------------------------------------------------------------
558
+ ControllerSpecificAssetsTest: test_non_existing_javascript_file_path
559
+ --------------------------------------------------------------------
560
+  (0.0ms) rollback transaction
561
+  (0.1ms) begin transaction
562
+ -----------------------------------------------
563
+ ControllerSpecificAssetsTest: test_if_is_module
564
+ -----------------------------------------------
565
+  (0.0ms) rollback transaction
566
+  (0.1ms) begin transaction
567
+ -------------------------------------------------------------
568
+ ControllerSpecificAssetsTest: test_non_existing_css_file_path
569
+ -------------------------------------------------------------
570
+  (0.1ms) rollback transaction
571
+  (0.1ms) begin transaction
572
+ ----------------------------------------------------
573
+ ControllerSpecificAssetsTest: test_existing_css_file
574
+ ----------------------------------------------------
575
+  (0.0ms) rollback transaction
576
+  (0.1ms) begin transaction
577
+ ---------------------------------------------------------
578
+ ControllerSpecificAssetsTest: test_existing_css_file_path
579
+ ---------------------------------------------------------
580
+  (0.0ms) rollback transaction
581
+  (0.1ms) begin transaction
582
+ -----------------------------------------------------------
583
+ ControllerSpecificAssetsTest: test_existing_javascript_file
584
+ -----------------------------------------------------------
585
+  (0.0ms) rollback transaction
586
+  (0.1ms) begin transaction
587
+ ---------------------------------------------------------------
588
+ ControllerSpecificAssetsTest: test_non_existing_javascript_file
589
+ ---------------------------------------------------------------
590
+  (0.1ms) rollback transaction
591
+  (0.1ms) begin transaction
592
+ --------------------------------------------------------------------
593
+ ControllerSpecificAssetsTest: test_non_existing_javascript_file_path
594
+ --------------------------------------------------------------------
595
+  (0.0ms) rollback transaction
596
+  (0.1ms) begin transaction
597
+ ---------------------------------------------------
598
+ ControllerSpecificAssetsTest: test_if_gem_is_module
599
+ ---------------------------------------------------
600
+  (0.0ms) rollback transaction
601
+  (0.1ms) begin transaction
602
+ -------------------------------------------------------------
603
+ ControllerSpecificAssetsTest: test_non_existing_css_file_path
604
+ -------------------------------------------------------------
605
+  (0.1ms) rollback transaction
606
+  (0.0ms) begin transaction
607
+ ----------------------------------------------------
608
+ ControllerSpecificAssetsTest: test_existing_css_file
609
+ ----------------------------------------------------
610
+  (0.0ms) rollback transaction
611
+  (0.0ms) begin transaction
612
+ -------------------------------------------------------
613
+ ControllerSpecificAssetsTest: test_if_helpers_is_module
614
+ -------------------------------------------------------
615
+  (0.0ms) rollback transaction
616
+  (0.1ms) begin transaction
617
+ --------------------------------------------------------
618
+ ControllerSpecificAssetsTest: test_non_existing_css_file
619
+ --------------------------------------------------------
620
+  (0.0ms) rollback transaction
621
+  (0.1ms) begin transaction
622
+ ---------------------------------------------------------
623
+ ControllerSpecificAssetsTest: test_existing_css_file_path
624
+ ---------------------------------------------------------
625
+  (0.0ms) rollback transaction
626
+  (0.1ms) begin transaction
627
+ ----------------------------------------------------------------
628
+ ControllerSpecificAssetsTest: test_existing_javascript_file_path
629
+ ----------------------------------------------------------------
630
+  (0.0ms) rollback transaction
631
+  (0.1ms) begin transaction
632
+ -----------------------------------------------------------
633
+ ControllerSpecificAssetsTest: test_existing_javascript_file
634
+ -----------------------------------------------------------
635
+  (0.0ms) rollback transaction
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: controller-specific-assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.25
4
+ version: 0.2.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakub Bilko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-22 00:00:00.000000000 Z
11
+ date: 2015-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails