app_stack 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"result":{"covered_percent":94.33}}
1
+ {"result":{"covered_percent":95.5}}
@@ -1 +1 @@
1
- {"RSpec":{"coverage":{"/cygdrive/d/working/gems/app_stack-gem/lib/app_stack.rb":[null,null,1,1,1,1,1,1,1,null,1,null,2,null,1,null,1,null,null,1,1,null,null,null,1,null,1,1,null,null,1,null,null,1,null],"/cygdrive/d/working/gems/app_stack-gem/lib/app_stack/config.rb":[null,1,null,1,1,null,null,1,1,null,1,39,39,null,null,39,null,null,null,null,null,null,null,null,null,39,null,68,null,null,67,66,null,null,null,37,null,null,null,37,315,null,null,null,37,null,null,1,244,null,null,null,1,2,null,null,1,22,null,null,null,1,34,34,34,null,null,1,49,null,null,1,42,14,14,14,null,null,28,null,null,null,1,null,null,1,null,24,24,88,20,20,20,null,null,68,68,null,null,24,null,null,null,1,100,100,null,10,10,10,10,null,null,90,126,null,null,100,null,null,null,null,1,92,92,92,100,null,92,null,null,null],"/cygdrive/d/working/gems/app_stack-gem/lib/app_stack/merger.rb":[null,null,1,null,1,1,null,1,null,7,7,7,null,7,7,7,7,null,7,7,7,null,null,1,3,3,9,48,48,3,null,6,null,null,39,39,117,null,null,39,6,null,33,null,null,null,9,null,null,3,0,0,0,null,null,0,0,0,null,null,null,null,1,1,12,2,null,null,1,null,1,11,11,11,null,null,1,1,1,1,1,1,null,0,0,null,1,null,null,null,1,7,null,7,null,28,null,0,21,null,null,null,null,1,21,21,21,21,21,21,63,21,null,null,null,1,84,45,6,null,null,1,0,0,null,null,null],"/cygdrive/d/working/gems/app_stack-gem/spec/fixtures/sample_files/module_1/spec/config_spec.rb":[],"/cygdrive/d/working/gems/app_stack-gem/spec/fixtures/sample_files/my_app/spec/config_spec.rb":[],"/cygdrive/d/working/gems/app_stack-gem/spec/fixtures/sample_files/my_app_back/spec/config_spec.rb":[],"/cygdrive/d/working/gems/app_stack-gem/spec/merger_spec.rb":[null,null,1,null,1,7,1,1,1,null,null,1,1,1,null,null,1,1,1,null,null,1,1,1,null,null,null,1,1,1,1,1,1,null,null,1,1,1,1,1,null,null,null],"/cygdrive/d/working/gems/app_stack-gem/spec/stackup_spec.rb":[null,1,null,1,1,1,1,1,1,1,1,1,1,1,null,null,null]},"timestamp":1380702239}}
1
+ {"RSpec":{"coverage":{"/cygdrive/d/working/gems/app_stack-gem/lib/app_stack.rb":[null,null,1,1,1,1,1,1,1,null,1,null,2,null,1,null,1,null,null,1,1,null,null,null,1,null,1,1,null,null,1,null,null,1,null],"/cygdrive/d/working/gems/app_stack-gem/lib/app_stack/config.rb":[null,1,null,1,1,null,null,1,1,null,1,39,39,null,null,39,null,null,null,null,null,null,null,null,null,39,null,68,null,null,67,66,null,null,null,37,null,null,null,37,330,null,null,null,37,null,null,1,247,null,null,null,1,2,null,null,1,23,null,null,null,1,34,34,34,null,null,1,49,null,null,1,42,14,14,14,null,null,28,null,null,null,1,null,null,1,null,24,24,88,20,20,20,null,null,68,68,null,null,24,null,null,null,1,100,100,null,10,10,10,10,null,null,90,126,null,null,100,null,null,null,null,1,92,92,92,100,null,92,null,null,null],"/cygdrive/d/working/gems/app_stack-gem/lib/app_stack/merger.rb":[null,null,1,null,1,1,null,1,null,7,7,7,null,7,7,7,7,null,7,7,7,null,null,1,3,3,9,48,48,3,null,6,null,null,39,156,null,39,6,null,33,null,null,null,null,null,null,3,30,15,60,15,3,null,null,null,3,0,0,0,null,null,0,0,0,null,null,null,3,null,null,1,1,12,3,null,null,1,null,1,11,11,11,null,null,1,2,2,2,1,1,null,1,1,null,2,null,null,null,1,7,null,7,null,28,null,0,21,null,null,null,null,1,21,21,21,21,21,21,63,21,null,null,null,1,87,48,9,null,null,1,0,0,null,null,null],"/cygdrive/d/working/gems/app_stack-gem/spec/fixtures/sample_files/module_1/spec/config_spec.rb":[],"/cygdrive/d/working/gems/app_stack-gem/spec/fixtures/sample_files/my_app/spec/config_spec.rb":[],"/cygdrive/d/working/gems/app_stack-gem/spec/fixtures/sample_files/my_app_back/spec/config_spec.rb":[],"/cygdrive/d/working/gems/app_stack-gem/spec/merger_spec.rb":[null,null,1,null,1,7,1,1,1,null,null,1,1,1,null,null,1,1,1,null,null,1,1,1,null,null,null,1,1,1,1,1,1,null,null,1,1,1,1,1,null,null,null],"/cygdrive/d/working/gems/app_stack-gem/spec/stackup_spec.rb":[null,1,null,1,1,1,1,1,1,1,1,1,1,1,1,null,null,null]},"timestamp":1380718828}}
@@ -14,27 +14,27 @@
14
14
  <img src="./assets/0.7.1/loading.gif" alt="loading"/>
15
15
  </div>
16
16
  <div id="wrapper" style="display:none;">
17
- <div class="timestamp">Generated <abbr class="timeago" title="2013-10-02T16:23:59+08:00">2013-10-02T16:23:59+08:00</abbr></div>
17
+ <div class="timestamp">Generated <abbr class="timeago" title="2013-10-02T21:00:28+08:00">2013-10-02T21:00:28+08:00</abbr></div>
18
18
  <ul class="group_tabs"></ul>
19
19
 
20
20
  <div id="content">
21
21
  <div class="file_list_container" id="AllFiles">
22
22
  <h2>
23
23
  <span class="group_name">All Files</span>
24
- (<span class="covered_percent"><span class="green">94.33%</span></span>
24
+ (<span class="covered_percent"><span class="green">95.5%</span></span>
25
25
  covered at
26
26
  <span class="covered_strength">
27
27
  <span class="green">
28
- 7.44
28
+ 7.59
29
29
  </span>
30
30
  </span> hits/line)
31
31
  </h2>
32
32
  <a name="AllFiles"></a>
33
33
  <div>
34
34
  <b>8</b> files in total.
35
- <b>194</b> relevant lines.
36
- <span class="green"><b>183</b> lines covered</span> and
37
- <span class="red"><b>11</b> lines missed </span>
35
+ <b>200</b> relevant lines.
36
+ <span class="green"><b>191</b> lines covered</span> and
37
+ <span class="red"><b>9</b> lines missed </span>
38
38
  </div>
39
39
  <table class="file_list">
40
40
  <thead>
@@ -67,17 +67,17 @@
67
67
  <td>62</td>
68
68
  <td>62</td>
69
69
  <td>0</td>
70
- <td>43.7</td>
70
+ <td>44.0</td>
71
71
  </tr>
72
72
 
73
73
  <tr>
74
74
  <td class="strong"><a href="#6efd526042569fe4b2332978c90171abe4fc0f64" class="src_link" title="lib/app_stack/merger.rb">lib/app_stack/merger.rb</a></td>
75
- <td class="yellow strong">85.53 %</td>
76
- <td>127</td>
77
- <td>76</td>
78
- <td>65</td>
79
- <td>11</td>
80
- <td>12.5</td>
75
+ <td class="yellow strong">88.89 %</td>
76
+ <td>136</td>
77
+ <td>81</td>
78
+ <td>72</td>
79
+ <td>9</td>
80
+ <td>13.4</td>
81
81
  </tr>
82
82
 
83
83
  <tr>
@@ -123,9 +123,9 @@
123
123
  <tr>
124
124
  <td class="strong"><a href="#36cf8ee74ad0aed8b9e2c51cc062f25c3bcf5f51" class="src_link" title="spec/stackup_spec.rb">spec/stackup_spec.rb</a></td>
125
125
  <td class="green strong">100.0 %</td>
126
- <td>17</td>
127
- <td>12</td>
128
- <td>12</td>
126
+ <td>18</td>
127
+ <td>13</td>
128
+ <td>13</td>
129
129
  <td>0</td>
130
130
  <td>1.0</td>
131
131
  </tr>
@@ -628,8 +628,8 @@
628
628
  <code class="ruby"> @config.each do |k, v|</code>
629
629
  </li>
630
630
 
631
- <li class="covered" data-hits="315" data-linenumber="41">
632
- <span class="hits">315</span>
631
+ <li class="covered" data-hits="330" data-linenumber="41">
632
+ <span class="hits">330</span>
633
633
 
634
634
  <code class="ruby"> self.class.send(:define_method, k.to_sym) { v }</code>
635
635
  </li>
@@ -676,8 +676,8 @@
676
676
  <code class="ruby"> def directory</code>
677
677
  </li>
678
678
 
679
- <li class="covered" data-hits="244" data-linenumber="49">
680
- <span class="hits">244</span>
679
+ <li class="covered" data-hits="247" data-linenumber="49">
680
+ <span class="hits">247</span>
681
681
 
682
682
  <code class="ruby"> File.expand_path('../', filename)</code>
683
683
  </li>
@@ -730,8 +730,8 @@
730
730
  <code class="ruby"> def attr_vars</code>
731
731
  </li>
732
732
 
733
- <li class="covered" data-hits="22" data-linenumber="58">
734
- <span class="hits">22</span>
733
+ <li class="covered" data-hits="23" data-linenumber="58">
734
+ <span class="hits">23</span>
735
735
 
736
736
  <code class="ruby"> @config[:attrs]</code>
737
737
  </li>
@@ -1187,11 +1187,11 @@
1187
1187
  <div class="source_table" id="6efd526042569fe4b2332978c90171abe4fc0f64">
1188
1188
  <div class="header">
1189
1189
  <h3>lib/app_stack/merger.rb</h3>
1190
- <h4><span class="yellow">85.53 %</span> covered</h4>
1190
+ <h4><span class="yellow">88.89 %</span> covered</h4>
1191
1191
  <div>
1192
- <b>76</b> relevant lines.
1193
- <span class="green"><b>65</b> lines covered</span> and
1194
- <span class="red"><b>11</b> lines missed.</span>
1192
+ <b>81</b> relevant lines.
1193
+ <span class="green"><b>72</b> lines covered</span> and
1194
+ <span class="red"><b>9</b> lines missed.</span>
1195
1195
  </div>
1196
1196
  </div>
1197
1197
 
@@ -1408,553 +1408,607 @@
1408
1408
  <code class="ruby"> tpl_file = nil</code>
1409
1409
  </li>
1410
1410
 
1411
- <li class="covered" data-hits="39" data-linenumber="36">
1412
- <span class="hits">39</span>
1413
-
1414
- <code class="ruby"> @config.tpl_ext.each do |ext|</code>
1415
- </li>
1416
-
1417
- <li class="covered" data-hits="117" data-linenumber="37">
1418
- <span class="hits">117</span>
1411
+ <li class="covered" data-hits="156" data-linenumber="36">
1412
+ <span class="hits">156</span>
1419
1413
 
1420
- <code class="ruby"> tpl_file = fr + ext if File.exists?(fr + ext)</code>
1414
+ <code class="ruby"> @config.tpl_ext.each { |ext| tpl_file = fr + ext if File.exists?(fr + ext) }</code>
1421
1415
  </li>
1422
1416
 
1423
- <li class="never" data-hits="" data-linenumber="38">
1424
-
1425
-
1426
- <code class="ruby"> end</code>
1427
- </li>
1428
-
1429
- <li class="never" data-hits="" data-linenumber="39">
1417
+ <li class="never" data-hits="" data-linenumber="37">
1430
1418
 
1431
1419
 
1432
1420
  <code class="ruby"></code>
1433
1421
  </li>
1434
1422
 
1435
- <li class="covered" data-hits="39" data-linenumber="40">
1423
+ <li class="covered" data-hits="39" data-linenumber="38">
1436
1424
  <span class="hits">39</span>
1437
1425
 
1438
1426
  <code class="ruby"> if tpl_file</code>
1439
1427
  </li>
1440
1428
 
1441
- <li class="covered" data-hits="6" data-linenumber="41">
1429
+ <li class="covered" data-hits="6" data-linenumber="39">
1442
1430
  <span class="hits">6</span>
1443
1431
 
1444
1432
  <code class="ruby"> @render_list[to.to_s] = tpl_file if newer?(tpl_file, to) || attr_mod?(to)</code>
1445
1433
  </li>
1446
1434
 
1447
- <li class="never" data-hits="" data-linenumber="42">
1435
+ <li class="never" data-hits="" data-linenumber="40">
1448
1436
 
1449
1437
 
1450
1438
  <code class="ruby"> else</code>
1451
1439
  </li>
1452
1440
 
1453
- <li class="covered" data-hits="33" data-linenumber="43">
1441
+ <li class="covered" data-hits="33" data-linenumber="41">
1454
1442
  <span class="hits">33</span>
1455
1443
 
1456
1444
  <code class="ruby"> @copy_list[to.to_s] = fr if newer?(fr, to)</code>
1457
1445
  </li>
1458
1446
 
1459
- <li class="never" data-hits="" data-linenumber="44">
1447
+ <li class="never" data-hits="" data-linenumber="42">
1460
1448
 
1461
1449
 
1462
1450
  <code class="ruby"> end</code>
1463
1451
  </li>
1464
1452
 
1465
- <li class="never" data-hits="" data-linenumber="45">
1453
+ <li class="never" data-hits="" data-linenumber="43">
1466
1454
 
1467
1455
 
1468
1456
  <code class="ruby"> end</code>
1469
1457
  </li>
1470
1458
 
1471
- <li class="never" data-hits="" data-linenumber="46">
1459
+ <li class="never" data-hits="" data-linenumber="44">
1472
1460
 
1473
1461
 
1474
1462
  <code class="ruby"> end</code>
1475
1463
  </li>
1476
1464
 
1477
- <li class="covered" data-hits="9" data-linenumber="47">
1478
- <span class="hits">9</span>
1465
+ <li class="never" data-hits="" data-linenumber="45">
1466
+
1467
+
1468
+ <code class="ruby"> end</code>
1469
+ </li>
1470
+
1471
+ <li class="never" data-hits="" data-linenumber="46">
1472
+
1473
+
1474
+ <code class="ruby"></code>
1475
+ </li>
1476
+
1477
+ <li class="never" data-hits="" data-linenumber="47">
1478
+
1479
+
1480
+ <code class="ruby"> # render local templates</code>
1481
+ </li>
1482
+
1483
+ <li class="covered" data-hits="3" data-linenumber="48">
1484
+ <span class="hits">3</span>
1485
+
1486
+ <code class="ruby"> Find.find(@config.directory) do |fr|</code>
1487
+ </li>
1488
+
1489
+ <li class="covered" data-hits="30" data-linenumber="49">
1490
+ <span class="hits">30</span>
1491
+
1492
+ <code class="ruby"> next if File.directory? fr</code>
1493
+ </li>
1494
+
1495
+ <li class="covered" data-hits="15" data-linenumber="50">
1496
+ <span class="hits">15</span>
1497
+
1498
+ <code class="ruby"> tpl_file = nil</code>
1499
+ </li>
1500
+
1501
+ <li class="covered" data-hits="60" data-linenumber="51">
1502
+ <span class="hits">60</span>
1503
+
1504
+ <code class="ruby"> @config.tpl_ext.each { |ext| tpl_file = fr + ext if File.exists?(fr + ext) }</code>
1505
+ </li>
1506
+
1507
+ <li class="covered" data-hits="15" data-linenumber="52">
1508
+ <span class="hits">15</span>
1509
+
1510
+ <code class="ruby"> if tpl_file</code>
1511
+ </li>
1512
+
1513
+ <li class="covered" data-hits="3" data-linenumber="53">
1514
+ <span class="hits">3</span>
1515
+
1516
+ <code class="ruby"> @render_list[fr] = tpl_file if newer?(tpl_file, fr) || attr_mod?(fr)</code>
1517
+ </li>
1518
+
1519
+ <li class="never" data-hits="" data-linenumber="54">
1520
+
1479
1521
 
1480
- <code class="ruby"> @prepared = true</code>
1522
+ <code class="ruby"> end</code>
1481
1523
  </li>
1482
1524
 
1483
- <li class="never" data-hits="" data-linenumber="48">
1525
+ <li class="never" data-hits="" data-linenumber="55">
1484
1526
 
1485
1527
 
1486
1528
  <code class="ruby"> end</code>
1487
1529
  </li>
1488
1530
 
1489
- <li class="never" data-hits="" data-linenumber="49">
1531
+ <li class="never" data-hits="" data-linenumber="56">
1490
1532
 
1491
1533
 
1492
1534
  <code class="ruby"></code>
1493
1535
  </li>
1494
1536
 
1495
- <li class="covered" data-hits="3" data-linenumber="50">
1537
+ <li class="covered" data-hits="3" data-linenumber="57">
1496
1538
  <span class="hits">3</span>
1497
1539
 
1498
1540
  <code class="ruby"> if verbose</code>
1499
1541
  </li>
1500
1542
 
1501
- <li class="missed" data-hits="0" data-linenumber="51">
1543
+ <li class="missed" data-hits="0" data-linenumber="58">
1502
1544
 
1503
1545
 
1504
1546
  <code class="ruby"> @copy_list.each do |to, fr|</code>
1505
1547
  </li>
1506
1548
 
1507
- <li class="missed" data-hits="0" data-linenumber="52">
1549
+ <li class="missed" data-hits="0" data-linenumber="59">
1508
1550
 
1509
1551
 
1510
1552
  <code class="ruby"> puts 'copy '.bold + fr.gsub(@config.stack_dir, '')</code>
1511
1553
  </li>
1512
1554
 
1513
- <li class="missed" data-hits="0" data-linenumber="53">
1555
+ <li class="missed" data-hits="0" data-linenumber="60">
1514
1556
 
1515
1557
 
1516
1558
  <code class="ruby"> puts ' to '.bold + to.to_s.gsub(@config.stack_dir, '')</code>
1517
1559
  </li>
1518
1560
 
1519
- <li class="never" data-hits="" data-linenumber="54">
1561
+ <li class="never" data-hits="" data-linenumber="61">
1520
1562
 
1521
1563
 
1522
1564
  <code class="ruby"> end</code>
1523
1565
  </li>
1524
1566
 
1525
- <li class="never" data-hits="" data-linenumber="55">
1567
+ <li class="never" data-hits="" data-linenumber="62">
1526
1568
 
1527
1569
 
1528
1570
  <code class="ruby"></code>
1529
1571
  </li>
1530
1572
 
1531
- <li class="missed" data-hits="0" data-linenumber="56">
1573
+ <li class="missed" data-hits="0" data-linenumber="63">
1532
1574
 
1533
1575
 
1534
1576
  <code class="ruby"> @render_list.each do |to, fr|</code>
1535
1577
  </li>
1536
1578
 
1537
- <li class="missed" data-hits="0" data-linenumber="57">
1579
+ <li class="missed" data-hits="0" data-linenumber="64">
1538
1580
 
1539
1581
 
1540
1582
  <code class="ruby"> puts 'render '.bold + fr.gsub(@config.stack_dir, '')</code>
1541
1583
  </li>
1542
1584
 
1543
- <li class="missed" data-hits="0" data-linenumber="58">
1585
+ <li class="missed" data-hits="0" data-linenumber="65">
1544
1586
 
1545
1587
 
1546
1588
  <code class="ruby"> puts ' to '.bold + to.to_s.gsub(@config.stack_dir, '')</code>
1547
1589
  </li>
1548
1590
 
1549
- <li class="never" data-hits="" data-linenumber="59">
1591
+ <li class="never" data-hits="" data-linenumber="66">
1550
1592
 
1551
1593
 
1552
1594
  <code class="ruby"> end</code>
1553
1595
  </li>
1554
1596
 
1555
- <li class="never" data-hits="" data-linenumber="60">
1597
+ <li class="never" data-hits="" data-linenumber="67">
1556
1598
 
1557
1599
 
1558
1600
  <code class="ruby"> end</code>
1559
1601
  </li>
1560
1602
 
1561
- <li class="never" data-hits="" data-linenumber="61">
1603
+ <li class="never" data-hits="" data-linenumber="68">
1604
+
1605
+
1606
+ <code class="ruby"></code>
1607
+ </li>
1608
+
1609
+ <li class="covered" data-hits="3" data-linenumber="69">
1610
+ <span class="hits">3</span>
1611
+
1612
+ <code class="ruby"> @prepared = true</code>
1613
+ </li>
1614
+
1615
+ <li class="never" data-hits="" data-linenumber="70">
1562
1616
 
1563
1617
 
1564
1618
  <code class="ruby"> end</code>
1565
1619
  </li>
1566
1620
 
1567
- <li class="never" data-hits="" data-linenumber="62">
1621
+ <li class="never" data-hits="" data-linenumber="71">
1568
1622
 
1569
1623
 
1570
1624
  <code class="ruby"></code>
1571
1625
  </li>
1572
1626
 
1573
- <li class="covered" data-hits="1" data-linenumber="63">
1627
+ <li class="covered" data-hits="1" data-linenumber="72">
1574
1628
  <span class="hits">1</span>
1575
1629
 
1576
1630
  <code class="ruby"> def merge!</code>
1577
1631
  </li>
1578
1632
 
1579
- <li class="covered" data-hits="1" data-linenumber="64">
1633
+ <li class="covered" data-hits="1" data-linenumber="73">
1580
1634
  <span class="hits">1</span>
1581
1635
 
1582
1636
  <code class="ruby"> @prepared || prepare(@verbose)</code>
1583
1637
  </li>
1584
1638
 
1585
- <li class="covered" data-hits="12" data-linenumber="65">
1639
+ <li class="covered" data-hits="12" data-linenumber="74">
1586
1640
  <span class="hits">12</span>
1587
1641
 
1588
1642
  <code class="ruby"> @copy_list.each { |to, fr| copy_file!(fr, to) }</code>
1589
1643
  </li>
1590
1644
 
1591
- <li class="covered" data-hits="2" data-linenumber="66">
1592
- <span class="hits">2</span>
1645
+ <li class="covered" data-hits="3" data-linenumber="75">
1646
+ <span class="hits">3</span>
1593
1647
 
1594
1648
  <code class="ruby"> @render_list.each { |to, fr| render_file!(fr, to) }</code>
1595
1649
  </li>
1596
1650
 
1597
- <li class="never" data-hits="" data-linenumber="67">
1651
+ <li class="never" data-hits="" data-linenumber="76">
1598
1652
 
1599
1653
 
1600
1654
  <code class="ruby"> end</code>
1601
1655
  </li>
1602
1656
 
1603
- <li class="never" data-hits="" data-linenumber="68">
1657
+ <li class="never" data-hits="" data-linenumber="77">
1604
1658
 
1605
1659
 
1606
1660
  <code class="ruby"></code>
1607
1661
  </li>
1608
1662
 
1609
- <li class="covered" data-hits="1" data-linenumber="69">
1663
+ <li class="covered" data-hits="1" data-linenumber="78">
1610
1664
  <span class="hits">1</span>
1611
1665
 
1612
1666
  <code class="ruby"> private</code>
1613
1667
  </li>
1614
1668
 
1615
- <li class="never" data-hits="" data-linenumber="70">
1669
+ <li class="never" data-hits="" data-linenumber="79">
1616
1670
 
1617
1671
 
1618
1672
  <code class="ruby"></code>
1619
1673
  </li>
1620
1674
 
1621
- <li class="covered" data-hits="1" data-linenumber="71">
1675
+ <li class="covered" data-hits="1" data-linenumber="80">
1622
1676
  <span class="hits">1</span>
1623
1677
 
1624
1678
  <code class="ruby"> def copy_file!(fr, to)</code>
1625
1679
  </li>
1626
1680
 
1627
- <li class="covered" data-hits="11" data-linenumber="72">
1681
+ <li class="covered" data-hits="11" data-linenumber="81">
1628
1682
  <span class="hits">11</span>
1629
1683
 
1630
1684
  <code class="ruby"> target_dir = File.dirname(to)</code>
1631
1685
  </li>
1632
1686
 
1633
- <li class="covered" data-hits="11" data-linenumber="73">
1687
+ <li class="covered" data-hits="11" data-linenumber="82">
1634
1688
  <span class="hits">11</span>
1635
1689
 
1636
1690
  <code class="ruby"> FileUtils.mkdir_p target_dir unless File.directory?(target_dir)</code>
1637
1691
  </li>
1638
1692
 
1639
- <li class="covered" data-hits="11" data-linenumber="74">
1693
+ <li class="covered" data-hits="11" data-linenumber="83">
1640
1694
  <span class="hits">11</span>
1641
1695
 
1642
1696
  <code class="ruby"> FileUtils.copy fr, to</code>
1643
1697
  </li>
1644
1698
 
1645
- <li class="never" data-hits="" data-linenumber="75">
1699
+ <li class="never" data-hits="" data-linenumber="84">
1646
1700
 
1647
1701
 
1648
1702
  <code class="ruby"> end</code>
1649
1703
  </li>
1650
1704
 
1651
- <li class="never" data-hits="" data-linenumber="76">
1705
+ <li class="never" data-hits="" data-linenumber="85">
1652
1706
 
1653
1707
 
1654
1708
  <code class="ruby"></code>
1655
1709
  </li>
1656
1710
 
1657
- <li class="covered" data-hits="1" data-linenumber="77">
1711
+ <li class="covered" data-hits="1" data-linenumber="86">
1658
1712
  <span class="hits">1</span>
1659
1713
 
1660
1714
  <code class="ruby"> def render_file!(fr, to)</code>
1661
1715
  </li>
1662
1716
 
1663
- <li class="covered" data-hits="1" data-linenumber="78">
1664
- <span class="hits">1</span>
1717
+ <li class="covered" data-hits="2" data-linenumber="87">
1718
+ <span class="hits">2</span>
1665
1719
 
1666
1720
  <code class="ruby"> var = @attr_vars.deep_merge(@config.attr_vars)</code>
1667
1721
  </li>
1668
1722
 
1669
- <li class="covered" data-hits="1" data-linenumber="79">
1670
- <span class="hits">1</span>
1723
+ <li class="covered" data-hits="2" data-linenumber="88">
1724
+ <span class="hits">2</span>
1671
1725
 
1672
1726
  <code class="ruby"> oh = File.open(to, 'wb')</code>
1673
1727
  </li>
1674
1728
 
1675
- <li class="covered" data-hits="1" data-linenumber="80">
1676
- <span class="hits">1</span>
1729
+ <li class="covered" data-hits="2" data-linenumber="89">
1730
+ <span class="hits">2</span>
1677
1731
 
1678
1732
  <code class="ruby"> if fr.match(/\.liquid$/)</code>
1679
1733
  </li>
1680
1734
 
1681
- <li class="covered" data-hits="1" data-linenumber="81">
1735
+ <li class="covered" data-hits="1" data-linenumber="90">
1682
1736
  <span class="hits">1</span>
1683
1737
 
1684
1738
  <code class="ruby"> require 'liquid'</code>
1685
1739
  </li>
1686
1740
 
1687
- <li class="covered" data-hits="1" data-linenumber="82">
1741
+ <li class="covered" data-hits="1" data-linenumber="91">
1688
1742
  <span class="hits">1</span>
1689
1743
 
1690
1744
  <code class="ruby"> oh.write Liquid::Template.parse(File.open(fr, 'r:utf-8').read).render(var)</code>
1691
1745
  </li>
1692
1746
 
1693
- <li class="never" data-hits="" data-linenumber="83">
1747
+ <li class="never" data-hits="" data-linenumber="92">
1694
1748
 
1695
1749
 
1696
1750
  <code class="ruby"> else</code>
1697
1751
  </li>
1698
1752
 
1699
- <li class="missed" data-hits="0" data-linenumber="84">
1700
-
1753
+ <li class="covered" data-hits="1" data-linenumber="93">
1754
+ <span class="hits">1</span>
1701
1755
 
1702
1756
  <code class="ruby"> tilt = Tilt.new(fr)</code>
1703
1757
  </li>
1704
1758
 
1705
- <li class="missed" data-hits="0" data-linenumber="85">
1706
-
1759
+ <li class="covered" data-hits="1" data-linenumber="94">
1760
+ <span class="hits">1</span>
1707
1761
 
1708
1762
  <code class="ruby"> oh.write tilt.render(OpenStruct.new(var))</code>
1709
1763
  </li>
1710
1764
 
1711
- <li class="never" data-hits="" data-linenumber="86">
1765
+ <li class="never" data-hits="" data-linenumber="95">
1712
1766
 
1713
1767
 
1714
1768
  <code class="ruby"> end</code>
1715
1769
  </li>
1716
1770
 
1717
- <li class="covered" data-hits="1" data-linenumber="87">
1718
- <span class="hits">1</span>
1771
+ <li class="covered" data-hits="2" data-linenumber="96">
1772
+ <span class="hits">2</span>
1719
1773
 
1720
1774
  <code class="ruby"> oh.close</code>
1721
1775
  </li>
1722
1776
 
1723
- <li class="never" data-hits="" data-linenumber="88">
1777
+ <li class="never" data-hits="" data-linenumber="97">
1724
1778
 
1725
1779
 
1726
1780
  <code class="ruby"> end</code>
1727
1781
  </li>
1728
1782
 
1729
- <li class="never" data-hits="" data-linenumber="89">
1783
+ <li class="never" data-hits="" data-linenumber="98">
1730
1784
 
1731
1785
 
1732
1786
  <code class="ruby"></code>
1733
1787
  </li>
1734
1788
 
1735
- <li class="never" data-hits="" data-linenumber="90">
1789
+ <li class="never" data-hits="" data-linenumber="99">
1736
1790
 
1737
1791
 
1738
1792
  <code class="ruby"> # get a list of stacked app object</code>
1739
1793
  </li>
1740
1794
 
1741
- <li class="covered" data-hits="1" data-linenumber="91">
1795
+ <li class="covered" data-hits="1" data-linenumber="100">
1742
1796
  <span class="hits">1</span>
1743
1797
 
1744
1798
  <code class="ruby"> def parse_stacks</code>
1745
1799
  </li>
1746
1800
 
1747
- <li class="covered" data-hits="7" data-linenumber="92">
1801
+ <li class="covered" data-hits="7" data-linenumber="101">
1748
1802
  <span class="hits">7</span>
1749
1803
 
1750
1804
  <code class="ruby"> @config.stack.each do |stk|</code>
1751
1805
  </li>
1752
1806
 
1753
- <li class="never" data-hits="" data-linenumber="93">
1807
+ <li class="never" data-hits="" data-linenumber="102">
1754
1808
 
1755
1809
 
1756
1810
  <code class="ruby"> case</code>
1757
1811
  </li>
1758
1812
 
1759
- <li class="covered" data-hits="7" data-linenumber="94">
1813
+ <li class="covered" data-hits="7" data-linenumber="103">
1760
1814
  <span class="hits">7</span>
1761
1815
 
1762
1816
  <code class="ruby"> when stk.is_a?(String) then @stacks &lt;&lt; load_stack(stk, ['default'])</code>
1763
1817
  </li>
1764
1818
 
1765
- <li class="never" data-hits="" data-linenumber="95">
1819
+ <li class="never" data-hits="" data-linenumber="104">
1766
1820
 
1767
1821
 
1768
1822
  <code class="ruby"> when stk.is_a?(Hash)</code>
1769
1823
  </li>
1770
1824
 
1771
- <li class="covered" data-hits="28" data-linenumber="96">
1825
+ <li class="covered" data-hits="28" data-linenumber="105">
1772
1826
  <span class="hits">28</span>
1773
1827
 
1774
1828
  <code class="ruby"> stk.each { |key, groups| @stacks &lt;&lt; load_stack(key, groups) }</code>
1775
1829
  </li>
1776
1830
 
1777
- <li class="never" data-hits="" data-linenumber="97">
1831
+ <li class="never" data-hits="" data-linenumber="106">
1778
1832
 
1779
1833
 
1780
1834
  <code class="ruby"> else</code>
1781
1835
  </li>
1782
1836
 
1783
- <li class="missed" data-hits="0" data-linenumber="98">
1837
+ <li class="missed" data-hits="0" data-linenumber="107">
1784
1838
 
1785
1839
 
1786
1840
  <code class="ruby"> raise 'stack must be a string or a hash, in ' + @conf_file</code>
1787
1841
  </li>
1788
1842
 
1789
- <li class="covered" data-hits="21" data-linenumber="99">
1843
+ <li class="covered" data-hits="21" data-linenumber="108">
1790
1844
  <span class="hits">21</span>
1791
1845
 
1792
1846
  <code class="ruby"> end</code>
1793
1847
  </li>
1794
1848
 
1795
- <li class="never" data-hits="" data-linenumber="100">
1849
+ <li class="never" data-hits="" data-linenumber="109">
1796
1850
 
1797
1851
 
1798
1852
  <code class="ruby"> end</code>
1799
1853
  </li>
1800
1854
 
1801
- <li class="never" data-hits="" data-linenumber="101">
1855
+ <li class="never" data-hits="" data-linenumber="110">
1802
1856
 
1803
1857
 
1804
1858
  <code class="ruby"> end</code>
1805
1859
  </li>
1806
1860
 
1807
- <li class="never" data-hits="" data-linenumber="102">
1861
+ <li class="never" data-hits="" data-linenumber="111">
1808
1862
 
1809
1863
 
1810
1864
  <code class="ruby"></code>
1811
1865
  </li>
1812
1866
 
1813
- <li class="never" data-hits="" data-linenumber="103">
1867
+ <li class="never" data-hits="" data-linenumber="112">
1814
1868
 
1815
1869
 
1816
1870
  <code class="ruby"> # read stack from list, set copy_list</code>
1817
1871
  </li>
1818
1872
 
1819
- <li class="covered" data-hits="1" data-linenumber="104">
1873
+ <li class="covered" data-hits="1" data-linenumber="113">
1820
1874
  <span class="hits">1</span>
1821
1875
 
1822
1876
  <code class="ruby"> def load_stack(stack_name, groups)</code>
1823
1877
  </li>
1824
1878
 
1825
- <li class="covered" data-hits="21" data-linenumber="105">
1879
+ <li class="covered" data-hits="21" data-linenumber="114">
1826
1880
  <span class="hits">21</span>
1827
1881
 
1828
1882
  <code class="ruby"> conf_base_name = File.basename(@conf_file)</code>
1829
1883
  </li>
1830
1884
 
1831
- <li class="covered" data-hits="21" data-linenumber="106">
1885
+ <li class="covered" data-hits="21" data-linenumber="115">
1832
1886
  <span class="hits">21</span>
1833
1887
 
1834
1888
  <code class="ruby"> stack_dir = Pathname.new(@config.stack_dir) + stack_name</code>
1835
1889
  </li>
1836
1890
 
1837
- <li class="covered" data-hits="21" data-linenumber="107">
1891
+ <li class="covered" data-hits="21" data-linenumber="116">
1838
1892
  <span class="hits">21</span>
1839
1893
 
1840
1894
  <code class="ruby"> stack = Config.new(stack_dir + conf_base_name)</code>
1841
1895
  </li>
1842
1896
 
1843
- <li class="covered" data-hits="21" data-linenumber="108">
1897
+ <li class="covered" data-hits="21" data-linenumber="117">
1844
1898
  <span class="hits">21</span>
1845
1899
 
1846
1900
  <code class="ruby"> fmodtime = File.mtime(stack_dir + conf_base_name)</code>
1847
1901
  </li>
1848
1902
 
1849
- <li class="covered" data-hits="21" data-linenumber="109">
1903
+ <li class="covered" data-hits="21" data-linenumber="118">
1850
1904
  <span class="hits">21</span>
1851
1905
 
1852
1906
  <code class="ruby"> @attr_last_mod = fmodtime if fmodtime &gt; @attr_last_mod # update file mod time</code>
1853
1907
  </li>
1854
1908
 
1855
- <li class="covered" data-hits="21" data-linenumber="110">
1909
+ <li class="covered" data-hits="21" data-linenumber="119">
1856
1910
  <span class="hits">21</span>
1857
1911
 
1858
1912
  <code class="ruby"> @attr_vars = @attr_vars.deep_merge stack.attr_vars</code>
1859
1913
  </li>
1860
1914
 
1861
- <li class="covered" data-hits="63" data-linenumber="111">
1915
+ <li class="covered" data-hits="63" data-linenumber="120">
1862
1916
  <span class="hits">63</span>
1863
1917
 
1864
1918
  <code class="ruby"> groups.each { |grp| stack.add_copy_list(grp) }</code>
1865
1919
  </li>
1866
1920
 
1867
- <li class="covered" data-hits="21" data-linenumber="112">
1921
+ <li class="covered" data-hits="21" data-linenumber="121">
1868
1922
  <span class="hits">21</span>
1869
1923
 
1870
1924
  <code class="ruby"> stack</code>
1871
1925
  </li>
1872
1926
 
1873
- <li class="never" data-hits="" data-linenumber="113">
1927
+ <li class="never" data-hits="" data-linenumber="122">
1874
1928
 
1875
1929
 
1876
1930
  <code class="ruby"> end</code>
1877
1931
  </li>
1878
1932
 
1879
- <li class="never" data-hits="" data-linenumber="114">
1933
+ <li class="never" data-hits="" data-linenumber="123">
1880
1934
 
1881
1935
 
1882
1936
  <code class="ruby"></code>
1883
1937
  </li>
1884
1938
 
1885
- <li class="never" data-hits="" data-linenumber="115">
1939
+ <li class="never" data-hits="" data-linenumber="124">
1886
1940
 
1887
1941
 
1888
1942
  <code class="ruby"> # if f1 newer than f2, or f2 not exits but f1 does.</code>
1889
1943
  </li>
1890
1944
 
1891
- <li class="covered" data-hits="1" data-linenumber="116">
1945
+ <li class="covered" data-hits="1" data-linenumber="125">
1892
1946
  <span class="hits">1</span>
1893
1947
 
1894
1948
  <code class="ruby"> def newer?(f1, f2)</code>
1895
1949
  </li>
1896
1950
 
1897
- <li class="covered" data-hits="84" data-linenumber="117">
1898
- <span class="hits">84</span>
1951
+ <li class="covered" data-hits="87" data-linenumber="126">
1952
+ <span class="hits">87</span>
1899
1953
 
1900
1954
  <code class="ruby"> return false unless File.exists?(f1)</code>
1901
1955
  </li>
1902
1956
 
1903
- <li class="covered" data-hits="45" data-linenumber="118">
1904
- <span class="hits">45</span>
1957
+ <li class="covered" data-hits="48" data-linenumber="127">
1958
+ <span class="hits">48</span>
1905
1959
 
1906
1960
  <code class="ruby"> return true unless File.exists?(f2)</code>
1907
1961
  </li>
1908
1962
 
1909
- <li class="covered" data-hits="6" data-linenumber="119">
1910
- <span class="hits">6</span>
1963
+ <li class="covered" data-hits="9" data-linenumber="128">
1964
+ <span class="hits">9</span>
1911
1965
 
1912
1966
  <code class="ruby"> File.mtime(f1) &gt; File.mtime(f2)</code>
1913
1967
  </li>
1914
1968
 
1915
- <li class="never" data-hits="" data-linenumber="120">
1969
+ <li class="never" data-hits="" data-linenumber="129">
1916
1970
 
1917
1971
 
1918
1972
  <code class="ruby"> end</code>
1919
1973
  </li>
1920
1974
 
1921
- <li class="never" data-hits="" data-linenumber="121">
1975
+ <li class="never" data-hits="" data-linenumber="130">
1922
1976
 
1923
1977
 
1924
1978
  <code class="ruby"></code>
1925
1979
  </li>
1926
1980
 
1927
- <li class="covered" data-hits="1" data-linenumber="122">
1981
+ <li class="covered" data-hits="1" data-linenumber="131">
1928
1982
  <span class="hits">1</span>
1929
1983
 
1930
1984
  <code class="ruby"> def attr_mod?(to)</code>
1931
1985
  </li>
1932
1986
 
1933
- <li class="missed" data-hits="0" data-linenumber="123">
1987
+ <li class="missed" data-hits="0" data-linenumber="132">
1934
1988
 
1935
1989
 
1936
1990
  <code class="ruby"> return true unless File.exists?(to)</code>
1937
1991
  </li>
1938
1992
 
1939
- <li class="missed" data-hits="0" data-linenumber="124">
1993
+ <li class="missed" data-hits="0" data-linenumber="133">
1940
1994
 
1941
1995
 
1942
1996
  <code class="ruby"> @attr_last_mod &gt; File.mtime(to)</code>
1943
1997
  </li>
1944
1998
 
1945
- <li class="never" data-hits="" data-linenumber="125">
1999
+ <li class="never" data-hits="" data-linenumber="134">
1946
2000
 
1947
2001
 
1948
2002
  <code class="ruby"> end</code>
1949
2003
  </li>
1950
2004
 
1951
- <li class="never" data-hits="" data-linenumber="126">
2005
+ <li class="never" data-hits="" data-linenumber="135">
1952
2006
 
1953
2007
 
1954
2008
  <code class="ruby"> end</code>
1955
2009
  </li>
1956
2010
 
1957
- <li class="never" data-hits="" data-linenumber="127">
2011
+ <li class="never" data-hits="" data-linenumber="136">
1958
2012
 
1959
2013
 
1960
2014
  <code class="ruby">end</code>
@@ -2299,8 +2353,8 @@
2299
2353
  <h3>spec/stackup_spec.rb</h3>
2300
2354
  <h4><span class="green">100.0 %</span> covered</h4>
2301
2355
  <div>
2302
- <b>12</b> relevant lines.
2303
- <span class="green"><b>12</b> lines covered</span> and
2356
+ <b>13</b> relevant lines.
2357
+ <span class="green"><b>13</b> lines covered</span> and
2304
2358
  <span class="red"><b>0</b> lines missed.</span>
2305
2359
  </div>
2306
2360
  </div>
@@ -2383,28 +2437,34 @@
2383
2437
  <li class="covered" data-hits="1" data-linenumber="13">
2384
2438
  <span class="hits">1</span>
2385
2439
 
2386
- <code class="ruby"> FileUtils.rm_rf 'spec/fixtures/sample_files/my_app'</code>
2440
+ <code class="ruby"> File.read('spec/fixtures/sample_files/my_app/local.conf').should eq(&quot;set to my_app\n&quot;)</code>
2387
2441
  </li>
2388
2442
 
2389
2443
  <li class="covered" data-hits="1" data-linenumber="14">
2390
2444
  <span class="hits">1</span>
2391
2445
 
2446
+ <code class="ruby"> FileUtils.rm_rf 'spec/fixtures/sample_files/my_app'</code>
2447
+ </li>
2448
+
2449
+ <li class="covered" data-hits="1" data-linenumber="15">
2450
+ <span class="hits">1</span>
2451
+
2392
2452
  <code class="ruby"> FileUtils.cp_r 'spec/fixtures/sample_files/my_app_back', 'spec/fixtures/sample_files/my_app'</code>
2393
2453
  </li>
2394
2454
 
2395
- <li class="never" data-hits="" data-linenumber="15">
2455
+ <li class="never" data-hits="" data-linenumber="16">
2396
2456
 
2397
2457
 
2398
2458
  <code class="ruby"> end</code>
2399
2459
  </li>
2400
2460
 
2401
- <li class="never" data-hits="" data-linenumber="16">
2461
+ <li class="never" data-hits="" data-linenumber="17">
2402
2462
 
2403
2463
 
2404
2464
  <code class="ruby"> end</code>
2405
2465
  </li>
2406
2466
 
2407
- <li class="never" data-hits="" data-linenumber="17">
2467
+ <li class="never" data-hits="" data-linenumber="18">
2408
2468
 
2409
2469
 
2410
2470
  <code class="ruby">end</code>
@@ -33,9 +33,7 @@ module AppStack
33
33
  else
34
34
  # render list
35
35
  tpl_file = nil
36
- @config.tpl_ext.each do |ext|
37
- tpl_file = fr + ext if File.exists?(fr + ext)
38
- end
36
+ @config.tpl_ext.each { |ext| tpl_file = fr + ext if File.exists?(fr + ext) }
39
37
 
40
38
  if tpl_file
41
39
  @render_list[to.to_s] = tpl_file if newer?(tpl_file, to) || attr_mod?(to)
@@ -44,7 +42,16 @@ module AppStack
44
42
  end
45
43
  end
46
44
  end
47
- @prepared = true
45
+ end
46
+
47
+ # render local templates
48
+ Find.find(@config.directory) do |fr|
49
+ next if File.directory? fr
50
+ tpl_file = nil
51
+ @config.tpl_ext.each { |ext| tpl_file = fr + ext if File.exists?(fr + ext) }
52
+ if tpl_file
53
+ @render_list[fr] = tpl_file if newer?(tpl_file, fr) || attr_mod?(fr)
54
+ end
48
55
  end
49
56
 
50
57
  if verbose
@@ -58,6 +65,8 @@ module AppStack
58
65
  puts ' to '.bold + to.to_s.gsub(@config.stack_dir, '')
59
66
  end
60
67
  end
68
+
69
+ @prepared = true
61
70
  end
62
71
 
63
72
  def merge!
@@ -2,5 +2,5 @@
2
2
 
3
3
  # AppStack module
4
4
  module AppStack
5
- VERSION = '1.2.0'
5
+ VERSION = '1.2.1'
6
6
  end
File without changes
@@ -0,0 +1 @@
1
+ set to <%= application_code %>
File without changes
@@ -0,0 +1 @@
1
+ set to <%= application_code %>
data/spec/stackup_spec.rb CHANGED
@@ -10,6 +10,7 @@ describe AppStack do
10
10
  File.exists?('spec/fixtures/sample_files/my_app/app/lib/sequence.rb').should be_true
11
11
  File.read('spec/fixtures/sample_files/my_app/Gemfile').should eq("Mod2: my_app\n")
12
12
  File.read('spec/fixtures/sample_files/my_app/doc/excluding.txt').should eq("from my_app\n")
13
+ File.read('spec/fixtures/sample_files/my_app/local.conf').should eq("set to my_app\n")
13
14
  FileUtils.rm_rf 'spec/fixtures/sample_files/my_app'
14
15
  FileUtils.cp_r 'spec/fixtures/sample_files/my_app_back', 'spec/fixtures/sample_files/my_app'
15
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_stack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -177,9 +177,13 @@ files:
177
177
  - spec/fixtures/sample_files/module_3/lib/libfile_2.rb
178
178
  - spec/fixtures/sample_files/my_app/app_stack.yml
179
179
  - spec/fixtures/sample_files/my_app/doc/excluding.txt
180
+ - spec/fixtures/sample_files/my_app/local.conf
181
+ - spec/fixtures/sample_files/my_app/local.conf.erb
180
182
  - spec/fixtures/sample_files/my_app/spec/config_spec.rb
181
183
  - spec/fixtures/sample_files/my_app_back/app_stack.yml
182
184
  - spec/fixtures/sample_files/my_app_back/doc/excluding.txt
185
+ - spec/fixtures/sample_files/my_app_back/local.conf
186
+ - spec/fixtures/sample_files/my_app_back/local.conf.erb
183
187
  - spec/fixtures/sample_files/my_app_back/spec/config_spec.rb
184
188
  - spec/merger_spec.rb
185
189
  - spec/spec_helper.rb