guard-coffeescript 0.3.1 → 0.3.2

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
@@ -106,22 +106,40 @@ guard 'coffeescript', :input => 'app/assets/javascripts'
106
106
  There following options can be passed to Guard::CoffeeScript:
107
107
 
108
108
  ```ruby
109
- :input => 'coffeescripts' # Relative path to the input directory
109
+ :input => 'coffeescripts' # Relative path to the input directory.
110
110
  # default: nil
111
111
 
112
- :output => 'javascripts' # Relative path to the output directory
112
+ :output => 'javascripts' # Relative path to the output directory.
113
113
  # default: the path given with the :input option
114
114
 
115
- :bare => true # Compile without the top-level function wrapper
115
+ :bare => true # Compile without the top-level function wrapper.
116
+ # Provide either a boolean value or an Array of filenames.
116
117
  # default: false
117
118
 
118
- :shallow => true # Do not create nested output directories
119
+ :shallow => true # Do not create nested output directories.
119
120
  # default: false
120
121
 
121
- :hide_success => true # Disable successful compilation messages
122
+ :hide_success => true # Disable successful compilation messages.
122
123
  # default: false
123
124
  ```
124
125
 
126
+ ### Selective bare option
127
+
128
+ The `:bare` option can take a boolean value that indicates if all scripts should be compiled without the top-level function wrapper.
129
+
130
+ ```ruby
131
+ :bare => true
132
+ ```
133
+
134
+ But you can also pass an Array of filenames that should be compiled without the top-level function wrapper. The path of the file to compile is
135
+ ignored, so the list of filenames should not contain any path information:
136
+
137
+ ```ruby
138
+ :bare => %w{ a.coffee b.coffee }
139
+ ```
140
+
141
+ In the above example, all `a.coffee` and `b.coffee` files will be compiled with option `:bare => true` and all other files with option `:bare => false`.
142
+
125
143
  ### Nested directories
126
144
 
127
145
  The Guard detects by default nested directories and creates these within the output directory. The detection is based on the match
@@ -204,6 +222,7 @@ For questions please join us on our [Google group](http://groups.google.com/grou
204
222
 
205
223
  * [Aaron Jensen](https://github.com/aaronjensen)
206
224
  * [Andrew Assarattanakul](https://github.com/vizjerai)
225
+ * [Jeremy Raines](https://github.com/jraines)
207
226
  * [Patrick Ewing](https://github.com/hoverbird)
208
227
 
209
228
  ## Acknowledgment
@@ -45,7 +45,17 @@ module Guard
45
45
  end
46
46
 
47
47
  def compile(file, options)
48
- ::CoffeeScript.compile(File.read(file), options)
48
+ file_options = options_for_file(file, options)
49
+ ::CoffeeScript.compile(File.read(file), file_options)
50
+ end
51
+
52
+ def options_for_file(file, options)
53
+ return options unless options[:bare].respond_to? :include?
54
+ file_options = options.clone
55
+ filename = file[/([^\/]*)\.coffee/]
56
+ file_options[:bare] = file_options[:bare].include?(filename)
57
+
58
+ file_options
49
59
  end
50
60
 
51
61
  def process_compile_result(content, file, directory)
@@ -255,7 +255,7 @@ x
255
255
  18
256
256
  __metaclass_init__
257
257
  i
258
- 104
258
+ 118
259
259
  5
260
260
  66
261
261
  99
@@ -359,6 +359,20 @@ i
359
359
  49
360
360
  3
361
361
  4
362
+ 15
363
+ 99
364
+ 7
365
+ 17
366
+ 7
367
+ 18
368
+ 65
369
+ 67
370
+ 49
371
+ 2
372
+ 0
373
+ 49
374
+ 3
375
+ 4
362
376
  11
363
377
  I
364
378
  5
@@ -370,7 +384,7 @@ I
370
384
  0
371
385
  n
372
386
  p
373
- 17
387
+ 19
374
388
  x
375
389
  3
376
390
  run
@@ -1242,35 +1256,50 @@ x
1242
1256
  7
1243
1257
  compile
1244
1258
  i
1245
- 17
1259
+ 29
1260
+ 5
1261
+ 20
1262
+ 0
1263
+ 20
1264
+ 1
1265
+ 47
1266
+ 49
1267
+ 0
1268
+ 2
1269
+ 19
1270
+ 2
1271
+ 15
1246
1272
  44
1247
1273
  43
1248
- 0
1249
- 45
1250
1274
  1
1275
+ 45
1251
1276
  2
1277
+ 3
1252
1278
  20
1253
1279
  0
1254
1280
  49
1255
- 3
1281
+ 4
1256
1282
  1
1257
1283
  20
1258
- 1
1284
+ 2
1259
1285
  49
1260
- 4
1286
+ 5
1261
1287
  2
1262
1288
  11
1263
1289
  I
1264
- 5
1290
+ 6
1265
1291
  I
1266
- 2
1292
+ 3
1267
1293
  I
1268
1294
  2
1269
1295
  I
1270
1296
  2
1271
1297
  n
1272
1298
  p
1273
- 5
1299
+ 6
1300
+ x
1301
+ 16
1302
+ options_for_file
1274
1303
  x
1275
1304
  12
1276
1305
  CoffeeScript
@@ -1285,7 +1314,7 @@ x
1285
1314
  7
1286
1315
  compile
1287
1316
  p
1288
- 5
1317
+ 7
1289
1318
  I
1290
1319
  -1
1291
1320
  I
@@ -1295,12 +1324,195 @@ I
1295
1324
  I
1296
1325
  30
1297
1326
  I
1298
- 11
1327
+ c
1328
+ I
1329
+ 31
1330
+ I
1331
+ 1d
1299
1332
  x
1300
1333
  77
1301
1334
  /Users/michi/Repositories/guard-coffeescript/lib/guard/coffeescript/runner.rb
1302
1335
  p
1336
+ 3
1337
+ x
1338
+ 4
1339
+ file
1340
+ x
1341
+ 7
1342
+ options
1343
+ x
1344
+ 12
1345
+ file_options
1346
+ x
1347
+ 16
1348
+ options_for_file
1349
+ M
1350
+ 1
1351
+ n
1352
+ n
1353
+ x
1354
+ 16
1355
+ options_for_file
1356
+ i
1357
+ 82
1358
+ 20
1359
+ 1
1360
+ 7
1361
+ 0
1362
+ 49
1363
+ 1
1364
+ 1
1365
+ 7
1366
+ 2
1367
+ 49
1368
+ 3
1369
+ 1
1370
+ 9
1371
+ 17
1372
+ 1
1373
+ 8
1374
+ 20
1375
+ 20
1376
+ 1
1377
+ 11
1378
+ 15
1379
+ 20
1380
+ 1
1381
+ 49
1382
+ 4
1383
+ 0
1384
+ 19
1385
+ 2
1386
+ 15
1387
+ 20
1388
+ 0
1389
+ 7
1390
+ 5
1391
+ 13
1392
+ 70
1393
+ 9
1394
+ 49
1395
+ 15
1396
+ 44
1397
+ 43
1398
+ 6
1399
+ 7
1400
+ 7
1401
+ 78
1402
+ 49
1403
+ 8
1404
+ 2
1405
+ 6
1406
+ 5
1407
+ 49
1408
+ 1
1409
+ 1
1410
+ 19
1411
+ 3
1412
+ 15
1413
+ 20
1414
+ 2
1415
+ 7
1416
+ 0
1417
+ 20
1418
+ 2
1419
+ 7
1420
+ 0
1421
+ 49
1422
+ 1
1423
+ 1
1424
+ 20
1425
+ 3
1426
+ 49
1303
1427
  2
1428
+ 1
1429
+ 13
1430
+ 18
1431
+ 3
1432
+ 49
1433
+ 9
1434
+ 2
1435
+ 15
1436
+ 15
1437
+ 20
1438
+ 2
1439
+ 11
1440
+ I
1441
+ 8
1442
+ I
1443
+ 4
1444
+ I
1445
+ 2
1446
+ I
1447
+ 2
1448
+ n
1449
+ p
1450
+ 10
1451
+ x
1452
+ 4
1453
+ bare
1454
+ x
1455
+ 2
1456
+ []
1457
+ x
1458
+ 8
1459
+ include?
1460
+ x
1461
+ 11
1462
+ respond_to?
1463
+ x
1464
+ 5
1465
+ clone
1466
+ n
1467
+ x
1468
+ 6
1469
+ Regexp
1470
+ s
1471
+ 16
1472
+ ([^\/]*)\.coffee
1473
+ x
1474
+ 3
1475
+ new
1476
+ x
1477
+ 3
1478
+ []=
1479
+ p
1480
+ 15
1481
+ I
1482
+ -1
1483
+ I
1484
+ 34
1485
+ I
1486
+ 0
1487
+ I
1488
+ 35
1489
+ I
1490
+ 14
1491
+ I
1492
+ 0
1493
+ I
1494
+ 15
1495
+ I
1496
+ 36
1497
+ I
1498
+ 1d
1499
+ I
1500
+ 37
1501
+ I
1502
+ 37
1503
+ I
1504
+ 38
1505
+ I
1506
+ 4f
1507
+ I
1508
+ 3a
1509
+ I
1510
+ 52
1511
+ x
1512
+ 77
1513
+ /Users/michi/Repositories/guard-coffeescript/lib/guard/coffeescript/runner.rb
1514
+ p
1515
+ 4
1304
1516
  x
1305
1517
  4
1306
1518
  file
@@ -1308,6 +1520,12 @@ x
1308
1520
  7
1309
1521
  options
1310
1522
  x
1523
+ 12
1524
+ file_options
1525
+ x
1526
+ 8
1527
+ filename
1528
+ x
1311
1529
  22
1312
1530
  process_compile_result
1313
1531
  M
@@ -1517,7 +1735,7 @@ p
1517
1735
  I
1518
1736
  0
1519
1737
  I
1520
- 36
1738
+ 40
1521
1739
  I
1522
1740
  d
1523
1741
  x
@@ -1536,11 +1754,11 @@ p
1536
1754
  I
1537
1755
  -1
1538
1756
  I
1539
- 33
1757
+ 3d
1540
1758
  I
1541
1759
  0
1542
1760
  I
1543
- 34
1761
+ 3e
1544
1762
  I
1545
1763
  1b
1546
1764
  I
@@ -1548,15 +1766,15 @@ I
1548
1766
  I
1549
1767
  1c
1550
1768
  I
1551
- 35
1769
+ 3f
1552
1770
  I
1553
1771
  47
1554
1772
  I
1555
- 36
1773
+ 40
1556
1774
  I
1557
1775
  5b
1558
1776
  I
1559
- 38
1777
+ 42
1560
1778
  I
1561
1779
  5e
1562
1780
  x
@@ -1896,31 +2114,31 @@ p
1896
2114
  I
1897
2115
  0
1898
2116
  I
1899
- 40
2117
+ 4a
1900
2118
  I
1901
2119
  a
1902
2120
  I
1903
- 41
2121
+ 4b
1904
2122
  I
1905
2123
  18
1906
2124
  I
1907
- 42
2125
+ 4c
1908
2126
  I
1909
2127
  5c
1910
2128
  I
1911
- 42
2129
+ 4c
1912
2130
  I
1913
2131
  5f
1914
2132
  I
1915
- 43
2133
+ 4d
1916
2134
  I
1917
2135
  69
1918
2136
  I
1919
- 44
2137
+ 4e
1920
2138
  I
1921
2139
  78
1922
2140
  I
1923
- 46
2141
+ 50
1924
2142
  I
1925
2143
  88
1926
2144
  I
@@ -1928,7 +2146,7 @@ I
1928
2146
  I
1929
2147
  8a
1930
2148
  I
1931
- 41
2149
+ 4b
1932
2150
  I
1933
2151
  8b
1934
2152
  I
@@ -1960,11 +2178,11 @@ p
1960
2178
  I
1961
2179
  -1
1962
2180
  I
1963
- 3b
2181
+ 45
1964
2182
  I
1965
2183
  0
1966
2184
  I
1967
- 3c
2185
+ 46
1968
2186
  I
1969
2187
  22
1970
2188
  I
@@ -1972,15 +2190,15 @@ I
1972
2190
  I
1973
2191
  23
1974
2192
  I
1975
- 3e
2193
+ 48
1976
2194
  I
1977
2195
  2d
1978
2196
  I
1979
- 40
2197
+ 4a
1980
2198
  I
1981
2199
  3a
1982
2200
  I
1983
- 4b
2201
+ 55
1984
2202
  I
1985
2203
  3d
1986
2204
  x
@@ -2220,31 +2438,31 @@ p
2220
2438
  I
2221
2439
  -1
2222
2440
  I
2223
- 4e
2441
+ 58
2224
2442
  I
2225
2443
  e
2226
2444
  I
2227
- 4f
2445
+ 59
2228
2446
  I
2229
2447
  15
2230
2448
  I
2231
- 51
2449
+ 5b
2232
2450
  I
2233
2451
  24
2234
2452
  I
2235
- 52
2453
+ 5c
2236
2454
  I
2237
2455
  36
2238
2456
  I
2239
- 53
2457
+ 5d
2240
2458
  I
2241
2459
  3f
2242
2460
  I
2243
- 54
2461
+ 5e
2244
2462
  I
2245
2463
  5a
2246
2464
  I
2247
- 51
2465
+ 5b
2248
2466
  I
2249
2467
  5b
2250
2468
  I
@@ -2252,7 +2470,7 @@ I
2252
2470
  I
2253
2471
  5d
2254
2472
  I
2255
- 50
2473
+ 5a
2256
2474
  I
2257
2475
  85
2258
2476
  I
@@ -2277,7 +2495,7 @@ x
2277
2495
  7
2278
2496
  message
2279
2497
  p
2280
- 17
2498
+ 19
2281
2499
  I
2282
2500
  2
2283
2501
  I
@@ -2301,17 +2519,21 @@ I
2301
2519
  I
2302
2520
  3e
2303
2521
  I
2304
- 33
2522
+ 34
2305
2523
  I
2306
2524
  4c
2307
2525
  I
2308
- 3b
2526
+ 3d
2309
2527
  I
2310
2528
  5a
2311
2529
  I
2312
- 4e
2530
+ 45
2313
2531
  I
2314
2532
  68
2533
+ I
2534
+ 58
2535
+ I
2536
+ 76
2315
2537
  x
2316
2538
  77
2317
2539
  /Users/michi/Repositories/guard-coffeescript/lib/guard/coffeescript/runner.rb
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module CoffeeScriptVersion
3
- VERSION = '0.3.1'
3
+ VERSION = '0.3.2'
4
4
  end
5
5
  end
@@ -152,7 +152,7 @@ x
152
152
  VERSION
153
153
  s
154
154
  5
155
- 0.3.0
155
+ 0.3.1
156
156
  x
157
157
  9
158
158
  const_set
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-coffeescript
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 2
10
+ version: 0.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Kessler
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-23 00:00:00 +02:00
18
+ date: 2011-07-25 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency