guard-coffeescript 0.2.3 → 0.2.4

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.
data/README.md CHANGED
@@ -77,20 +77,20 @@ In addition to the standard configuration, this Guard has a short notation for c
77
77
  directory. This notation creates a watcher from the `:input` parameter that matches all CoffeeScript files under the given directory
78
78
  and you don't have to specify a watch regular expression.
79
79
 
80
- ### Standard ruby gem
80
+ ### Standard Ruby gem
81
81
 
82
82
  guard 'coffeescript', :input => 'coffeescripts', :output => 'javascripts'
83
83
 
84
- ### Rails app
84
+ ### Rails 3.1 app
85
85
 
86
- guard 'coffeescript', :input => 'app/coffeescripts', :output => 'public/javascripts/compiled'
86
+ guard 'coffeescript', :input => 'app/assets/javascripts'
87
87
 
88
88
  ## Options
89
89
 
90
90
  There following options can be passed to Guard::CoffeeScript:
91
91
 
92
92
  :input => 'coffeescripts' # Relative path to the input directory, default: nil
93
- :output => 'javascripts' # Relative path to the output directory, default: nil
93
+ :output => 'javascripts' # Relative path to the output directory, default: input directory
94
94
  :bare => true # Compile without the top-level function wrapper, default: false
95
95
  :shallow => true # Do not create nested output directories, default: false
96
96
  :hide_success => true # Disable successful compilation messages, default: false
@@ -11,13 +11,18 @@ module Guard
11
11
 
12
12
  def initialize(watchers = [], options = {})
13
13
  watchers = [] if !watchers
14
- watchers << ::Guard::Watcher.new(%r{#{ options.delete(:input) }/(.+\.coffee)}) if options[:input]
15
-
16
- super(watchers, {
14
+ defaults = {
17
15
  :bare => false,
18
16
  :shallow => false,
19
17
  :hide_success => false,
20
- }.merge(options))
18
+ }
19
+
20
+ if options[:input]
21
+ defaults.merge!({ :output => options[:input] })
22
+ watchers << ::Guard::Watcher.new(%r{#{ options.delete(:input) }/(.+\.coffee)})
23
+ end
24
+
25
+ super(watchers, defaults.merge(options))
21
26
  end
22
27
 
23
28
  def run_all
@@ -308,7 +308,7 @@ x
308
308
  10
309
309
  initialize
310
310
  i
311
- 165
311
+ 197
312
312
  23
313
313
  0
314
314
  10
@@ -344,147 +344,179 @@ i
344
344
  19
345
345
  0
346
346
  15
347
- 20
347
+ 44
348
+ 43
349
+ 0
350
+ 4
351
+ 3
352
+ 49
348
353
  1
354
+ 1
355
+ 13
356
+ 7
357
+ 2
358
+ 3
359
+ 49
360
+ 3
361
+ 2
362
+ 15
363
+ 13
349
364
  7
365
+ 4
366
+ 3
367
+ 49
368
+ 3
350
369
  2
370
+ 15
371
+ 13
372
+ 7
373
+ 5
374
+ 3
351
375
  49
352
376
  3
377
+ 2
378
+ 15
379
+ 19
380
+ 2
381
+ 15
382
+ 20
383
+ 1
384
+ 7
385
+ 6
386
+ 49
387
+ 7
388
+ 1
389
+ 9
390
+ 181
391
+ 20
392
+ 2
393
+ 44
394
+ 43
395
+ 0
396
+ 79
397
+ 49
398
+ 1
399
+ 1
400
+ 13
401
+ 7
402
+ 8
403
+ 20
404
+ 1
405
+ 7
406
+ 6
407
+ 49
408
+ 7
353
409
  1
410
+ 49
411
+ 3
412
+ 2
413
+ 15
414
+ 49
354
415
  9
355
- 119
416
+ 1
417
+ 15
356
418
  20
357
419
  0
358
420
  44
359
421
  43
360
- 4
422
+ 10
361
423
  43
362
- 5
424
+ 11
363
425
  13
364
426
  71
365
- 6
427
+ 12
366
428
  47
367
429
  9
368
- 90
430
+ 152
369
431
  47
370
432
  49
371
- 7
433
+ 13
372
434
  0
373
435
  13
374
436
  44
375
437
  43
376
- 8
438
+ 14
377
439
  20
378
440
  1
379
441
  7
380
- 2
442
+ 6
381
443
  49
382
- 9
444
+ 15
383
445
  1
384
446
  47
385
447
  101
386
- 10
448
+ 16
387
449
  7
388
- 11
450
+ 17
389
451
  63
390
452
  2
391
453
  78
392
454
  49
393
- 6
455
+ 12
394
456
  2
395
457
  47
396
458
  49
397
- 12
459
+ 18
398
460
  1
399
461
  15
400
462
  8
401
- 114
463
+ 176
402
464
  44
403
465
  43
404
- 8
466
+ 14
405
467
  20
406
468
  1
407
469
  7
408
- 2
470
+ 6
409
471
  49
410
- 9
472
+ 15
411
473
  1
412
474
  47
413
475
  101
414
- 10
476
+ 16
415
477
  7
416
- 11
478
+ 17
417
479
  63
418
480
  2
419
481
  78
420
482
  49
421
- 6
483
+ 12
422
484
  2
423
485
  49
424
- 6
486
+ 12
425
487
  1
426
488
  49
427
- 13
489
+ 19
428
490
  1
429
491
  8
430
- 120
492
+ 182
431
493
  1
432
494
  15
433
495
  20
434
496
  0
435
- 44
436
- 43
437
- 0
438
- 4
439
- 3
440
- 49
441
- 1
442
- 1
443
- 13
444
- 7
445
- 14
446
- 3
447
- 49
448
- 15
449
- 2
450
- 15
451
- 13
452
- 7
453
- 16
454
- 3
455
- 49
456
- 15
457
- 2
458
- 15
459
- 13
460
- 7
461
- 17
462
- 3
463
- 49
464
- 15
497
+ 20
465
498
  2
466
- 15
467
499
  20
468
500
  1
469
501
  49
470
- 18
502
+ 20
471
503
  1
472
504
  54
473
505
  52
474
- 12
506
+ 18
475
507
  2
476
508
  11
477
509
  I
478
- 8
510
+ 9
479
511
  I
480
- 2
512
+ 3
481
513
  I
482
514
  0
483
515
  I
484
516
  2
485
517
  n
486
518
  p
487
- 19
519
+ 21
488
520
  x
489
521
  4
490
522
  Hash
@@ -492,12 +524,30 @@ x
492
524
  16
493
525
  new_from_literal
494
526
  x
527
+ 4
528
+ bare
529
+ x
530
+ 3
531
+ []=
532
+ x
533
+ 7
534
+ shallow
535
+ x
536
+ 12
537
+ hide_success
538
+ x
495
539
  5
496
540
  input
497
541
  x
498
542
  2
499
543
  []
500
544
  x
545
+ 6
546
+ output
547
+ x
548
+ 6
549
+ merge!
550
+ x
501
551
  5
502
552
  Guard
503
553
  x
@@ -528,22 +578,10 @@ x
528
578
  2
529
579
  <<
530
580
  x
531
- 4
532
- bare
533
- x
534
- 3
535
- []=
536
- x
537
- 7
538
- shallow
539
- x
540
- 12
541
- hide_success
542
- x
543
581
  5
544
582
  merge
545
583
  p
546
- 19
584
+ 25
547
585
  I
548
586
  -1
549
587
  I
@@ -555,38 +593,50 @@ d
555
593
  I
556
594
  23
557
595
  I
558
- e
596
+ 12
559
597
  I
560
- 79
598
+ 2c
561
599
  I
562
- 10
600
+ f
563
601
  I
564
- 7b
602
+ 34
565
603
  I
566
- 14
604
+ 10
567
605
  I
568
- 84
606
+ 3c
569
607
  I
570
608
  11
571
609
  I
572
- 8c
610
+ 43
611
+ I
612
+ e
573
613
  I
574
- 12
614
+ 46
575
615
  I
576
- 94
616
+ 14
577
617
  I
578
- 13
618
+ 4f
619
+ I
620
+ 15
579
621
  I
580
- 9b
622
+ 6a
623
+ I
624
+ 16
625
+ I
626
+ b5
581
627
  I
582
628
  14
583
629
  I
584
- a5
630
+ b7
631
+ I
632
+ 19
633
+ I
634
+ c5
585
635
  x
586
636
  70
587
637
  /Users/michi/Repositories/guard-coffeescript/lib/guard/coffeescript.rb
588
638
  p
589
- 2
639
+ 3
590
640
  x
591
641
  8
592
642
  watchers
@@ -594,6 +644,9 @@ x
594
644
  7
595
645
  options
596
646
  x
647
+ 8
648
+ defaults
649
+ x
597
650
  17
598
651
  method_visibility
599
652
  x
@@ -688,11 +741,11 @@ p
688
741
  I
689
742
  -1
690
743
  I
691
- 17
744
+ 1c
692
745
  I
693
746
  0
694
747
  I
695
- 18
748
+ 1d
696
749
  I
697
750
  1f
698
751
  x
@@ -782,15 +835,15 @@ p
782
835
  I
783
836
  -1
784
837
  I
785
- 1b
838
+ 20
786
839
  I
787
840
  0
788
841
  I
789
- 1c
842
+ 21
790
843
  I
791
844
  17
792
845
  I
793
- 1d
846
+ 22
794
847
  I
795
848
  1f
796
849
  x
@@ -927,15 +980,15 @@ p
927
980
  I
928
981
  0
929
982
  I
930
- 23
983
+ 28
931
984
  I
932
985
  4
933
986
  I
934
- 24
987
+ 29
935
988
  I
936
989
  12
937
990
  I
938
- 25
991
+ 2a
939
992
  I
940
993
  24
941
994
  x
@@ -957,11 +1010,11 @@ p
957
1010
  I
958
1011
  -1
959
1012
  I
960
- 22
1013
+ 27
961
1014
  I
962
1015
  0
963
1016
  I
964
- 23
1017
+ 28
965
1018
  I
966
1019
  c
967
1020
  x
@@ -993,19 +1046,19 @@ c
993
1046
  I
994
1047
  31
995
1048
  I
996
- 17
1049
+ 1c
997
1050
  I
998
1051
  3f
999
1052
  I
1000
- 1b
1053
+ 20
1001
1054
  I
1002
1055
  4d
1003
1056
  I
1004
- 20
1057
+ 25
1005
1058
  I
1006
1059
  51
1007
1060
  I
1008
- 22
1061
+ 27
1009
1062
  I
1010
1063
  5f
1011
1064
  x
@@ -49,7 +49,7 @@ module Guard
49
49
 
50
50
  def process_compile_result(content, file, directory)
51
51
  FileUtils.mkdir_p(File.expand_path(directory)) if !File.directory?(directory)
52
- filename = File.join(directory, File.basename(file.gsub(/coffee$/, 'js')))
52
+ filename = File.join(directory, File.basename(file.gsub(/(js\.coffee|coffee)$/, 'js')))
53
53
  File.open(File.expand_path(filename), 'w') { |f| f.write(content) }
54
54
 
55
55
  filename
@@ -1418,8 +1418,8 @@ x
1418
1418
  6
1419
1419
  Regexp
1420
1420
  s
1421
- 7
1422
- coffee$
1421
+ 20
1422
+ (js\.coffee|coffee)$
1423
1423
  x
1424
1424
  3
1425
1425
  new
@@ -1 +1 @@
1
- guard 'coffeescript', :input => 'app/coffeescripts', :output => 'public/javascripts/compiled'
1
+ guard 'coffeescript', :input => 'app/assets/javascripts'
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module CoffeeScriptVersion
3
- VERSION = '0.2.3'
3
+ VERSION = '0.2.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: guard-coffeescript
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.3
5
+ version: 0.2.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Michael Kessler
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-13 00:00:00 +02:00
13
+ date: 2011-05-24 00:00:00 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency