hebrew_date 1.0.3 → 1.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 24e654aa92dc0e36e925d44324f6b240690c899c
4
- data.tar.gz: cb50cff9217cafce06dfce01080ea7e90e2b4162
3
+ metadata.gz: 39a4dbf5551c93ded677f56801766459f5d1ab47
4
+ data.tar.gz: 75019841deb32f9269035df4220ae81b97a494cc
5
5
  SHA512:
6
- metadata.gz: e713b4b77fb877bb1ab40ed8a0ba7c1ac2c6df341763ea20e356c711cc8346c230be75ba46af4bf4c41cfcd3d90644b491a24df73a8e541d689b46a1a66940c4
7
- data.tar.gz: 3d2a8a61c26f7afe575a9ef14fe3a124ce4e3e8bee6dd27d1585dcc9a6dd14b054b21939e573678e5b6b6ccd47982057b503541d19029efefe983c3aa3acbe34
6
+ metadata.gz: 3c355b53de7f533d352ec0eeab52643c20ff36cb8cf057d62092b589f8d8dea88af6b4198b4f522be9673b639fa8195e5bbc02fa4cac802d5675fff8b1d06c07
7
+ data.tar.gz: be21b1c297e43de7baf02d1c068ab9819bcf8ab59e76e067adce0aa586b6269d64bb25f933b096a457454835ecfaa749ec4dee91ac0e2c484f7df2aeb38532a1
data/doc/HebrewDate.html CHANGED
@@ -189,6 +189,34 @@ it should respond accordingly.</p>
189
189
  <p>Whether to use Israeli parsha/holiday scheme.</p>
190
190
  </div></span>
191
191
 
192
+ </li>
193
+
194
+
195
+ <li class="public ">
196
+ <span class="summary_signature">
197
+
198
+ <a href="#replace_saturday-class_method" title="replace_saturday (class method)">+ (Boolean) <strong>replace_saturday</strong> </a>
199
+
200
+
201
+
202
+ </span>
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+ <span class="summary_desc"><div class='inline'>
216
+ <p>If true, replaces “Saturday” or “Sat” in <span class='object_link'><a href="#strftime-instance_method" title="HebrewDate#strftime (method)">#strftime</a></span> with “Shabbat” or
217
+ “Shabbos” depending on the #ashkenaz value.</p>
218
+ </div></span>
219
+
192
220
  </li>
193
221
 
194
222
 
@@ -492,54 +520,6 @@ it should respond accordingly.</p>
492
520
  <li class="public ">
493
521
  <span class="summary_signature">
494
522
 
495
- <a href="#%2B-instance_method" title="#+ (instance method)">- (HebrewDate) <strong>+</strong>(other_date) </a>
496
-
497
-
498
-
499
- </span>
500
-
501
-
502
-
503
-
504
-
505
-
506
-
507
-
508
-
509
- <span class="summary_desc"><div class='inline'>
510
- <p>Add the dates specified (in days).</p>
511
- </div></span>
512
-
513
- </li>
514
-
515
-
516
- <li class="public ">
517
- <span class="summary_signature">
518
-
519
- <a href="#--instance_method" title="#- (instance method)">- (HebrewDate) <strong>-</strong>(other_date) </a>
520
-
521
-
522
-
523
- </span>
524
-
525
-
526
-
527
-
528
-
529
-
530
-
531
-
532
-
533
- <span class="summary_desc"><div class='inline'>
534
- <p>Subtract the dates specified (in days).</p>
535
- </div></span>
536
-
537
- </li>
538
-
539
-
540
- <li class="public ">
541
- <span class="summary_signature">
542
-
543
523
  <a href="#back-instance_method" title="#back (instance method)">- (HebrewDate) <strong>back</strong> </a>
544
524
 
545
525
 
@@ -616,6 +596,8 @@ it should respond accordingly.</p>
616
596
 
617
597
 
618
598
 
599
+ (also: #next, #succ)
600
+
619
601
  </span>
620
602
 
621
603
 
@@ -941,10 +923,6 @@ it should respond accordingly.</p>
941
923
  <pre class="lines">
942
924
 
943
925
 
944
- 60
945
- 61
946
- 62
947
- 63
948
926
  64
949
927
  65
950
928
  66
@@ -959,10 +937,14 @@ it should respond accordingly.</p>
959
937
  75
960
938
  76
961
939
  77
962
- 78</pre>
940
+ 78
941
+ 79
942
+ 80
943
+ 81
944
+ 82</pre>
963
945
  </td>
964
946
  <td>
965
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 60</span>
947
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 64</span>
966
948
 
967
949
  <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_year_or_date_object'>year_or_date_object</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_month'>month</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_date'>date</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
968
950
  <span class='ivar'>@abs_date</span> <span class='op'>=</span> <span class='int'>0</span>
@@ -1115,6 +1097,69 @@ it should respond accordingly.</p>
1115
1097
  </table>
1116
1098
  </div>
1117
1099
 
1100
+
1101
+ <span id="replace_saturday=-class_method"></span>
1102
+ <div class="method_details ">
1103
+ <h3 class="signature " id="replace_saturday-class_method">
1104
+
1105
+ + (<tt>Boolean</tt>) <strong>replace_saturday</strong>
1106
+
1107
+
1108
+
1109
+
1110
+
1111
+ </h3><div class="docstring">
1112
+ <div class="discussion">
1113
+
1114
+ <p>Returns If true, replaces “Saturday” or “Sat” in <span class='object_link'><a href="#strftime-instance_method" title="HebrewDate#strftime (method)">#strftime</a></span> with “Shabbat”
1115
+ or “Shabbos” depending on the #ashkenaz value.</p>
1116
+
1117
+
1118
+ </div>
1119
+ </div>
1120
+ <div class="tags">
1121
+
1122
+ <p class="tag_title">Returns:</p>
1123
+ <ul class="return">
1124
+
1125
+ <li>
1126
+
1127
+
1128
+ <span class='type'>(<tt>Boolean</tt>)</span>
1129
+
1130
+
1131
+
1132
+ &mdash;
1133
+ <div class='inline'>
1134
+ <p>If true, replaces “Saturday” or “Sat” in <span class='object_link'><a href="#strftime-instance_method" title="HebrewDate#strftime (method)">#strftime</a></span> with “Shabbat” or
1135
+ “Shabbos” depending on the #ashkenaz value.</p>
1136
+ </div>
1137
+
1138
+ </li>
1139
+
1140
+ </ul>
1141
+
1142
+ </div><table class="source_code">
1143
+ <tr>
1144
+ <td>
1145
+ <pre class="lines">
1146
+
1147
+
1148
+ 36
1149
+ 37
1150
+ 38</pre>
1151
+ </td>
1152
+ <td>
1153
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 36</span>
1154
+
1155
+ <span class='kw'>def</span> <span class='id identifier rubyid_replace_saturday'>replace_saturday</span>
1156
+ <span class='ivar'>@replace_saturday</span>
1157
+ <span class='kw'>end</span></pre>
1158
+ </td>
1159
+ </tr>
1160
+ </table>
1161
+ </div>
1162
+
1118
1163
  </div>
1119
1164
 
1120
1165
  <div id="instance_attr_details" class="attr_details">
@@ -1166,12 +1211,12 @@ it should respond accordingly.</p>
1166
1211
  <pre class="lines">
1167
1212
 
1168
1213
 
1169
- 46
1170
- 47
1171
- 48</pre>
1214
+ 50
1215
+ 51
1216
+ 52</pre>
1172
1217
  </td>
1173
1218
  <td>
1174
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 46</span>
1219
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 50</span>
1175
1220
 
1176
1221
  <span class='kw'>def</span> <span class='id identifier rubyid_date'>date</span>
1177
1222
  <span class='ivar'>@date</span>
@@ -1227,12 +1272,12 @@ it should respond accordingly.</p>
1227
1272
  <pre class="lines">
1228
1273
 
1229
1274
 
1230
- 55
1231
- 56
1232
- 57</pre>
1275
+ 59
1276
+ 60
1277
+ 61</pre>
1233
1278
  </td>
1234
1279
  <td>
1235
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 55</span>
1280
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 59</span>
1236
1281
 
1237
1282
  <span class='kw'>def</span> <span class='id identifier rubyid_hebrew_date'>hebrew_date</span>
1238
1283
  <span class='ivar'>@hebrew_date</span>
@@ -1288,12 +1333,12 @@ it should respond accordingly.</p>
1288
1333
  <pre class="lines">
1289
1334
 
1290
1335
 
1291
- 52
1292
- 53
1293
- 54</pre>
1336
+ 56
1337
+ 57
1338
+ 58</pre>
1294
1339
  </td>
1295
1340
  <td>
1296
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 52</span>
1341
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 56</span>
1297
1342
 
1298
1343
  <span class='kw'>def</span> <span class='id identifier rubyid_hebrew_month'>hebrew_month</span>
1299
1344
  <span class='ivar'>@hebrew_month</span>
@@ -1349,12 +1394,12 @@ it should respond accordingly.</p>
1349
1394
  <pre class="lines">
1350
1395
 
1351
1396
 
1352
- 49
1353
- 50
1354
- 51</pre>
1397
+ 53
1398
+ 54
1399
+ 55</pre>
1355
1400
  </td>
1356
1401
  <td>
1357
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 49</span>
1402
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 53</span>
1358
1403
 
1359
1404
  <span class='kw'>def</span> <span class='id identifier rubyid_hebrew_year'>hebrew_year</span>
1360
1405
  <span class='ivar'>@hebrew_year</span>
@@ -1410,12 +1455,12 @@ it should respond accordingly.</p>
1410
1455
  <pre class="lines">
1411
1456
 
1412
1457
 
1413
- 43
1414
- 44
1415
- 45</pre>
1458
+ 47
1459
+ 48
1460
+ 49</pre>
1416
1461
  </td>
1417
1462
  <td>
1418
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 43</span>
1463
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 47</span>
1419
1464
 
1420
1465
  <span class='kw'>def</span> <span class='id identifier rubyid_month'>month</span>
1421
1466
  <span class='ivar'>@month</span>
@@ -1471,12 +1516,12 @@ it should respond accordingly.</p>
1471
1516
  <pre class="lines">
1472
1517
 
1473
1518
 
1474
- 40
1475
- 41
1476
- 42</pre>
1519
+ 44
1520
+ 45
1521
+ 46</pre>
1477
1522
  </td>
1478
1523
  <td>
1479
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 40</span>
1524
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 44</span>
1480
1525
 
1481
1526
  <span class='kw'>def</span> <span class='id identifier rubyid_year'>year</span>
1482
1527
  <span class='ivar'>@year</span>
@@ -1552,12 +1597,12 @@ it should respond accordingly.</p>
1552
1597
  <pre class="lines">
1553
1598
 
1554
1599
 
1555
- 347
1556
- 348
1557
- 349</pre>
1600
+ 355
1601
+ 356
1602
+ 357</pre>
1558
1603
  </td>
1559
1604
  <td>
1560
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 347</span>
1605
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 355</span>
1561
1606
 
1562
1607
  <span class='kw'>def</span> <span class='id identifier rubyid_hebrew_leap_year?'>hebrew_leap_year?</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='rparen'>)</span>
1563
1608
  <span class='lparen'>(</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='int'>7</span> <span class='op'>*</span> <span class='id identifier rubyid_year'>year</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='int'>1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_remainder'>remainder</span><span class='lparen'>(</span><span class='int'>19</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>&lt;</span> <span class='int'>7</span>
@@ -1593,16 +1638,16 @@ it should respond accordingly.</p>
1593
1638
  <pre class="lines">
1594
1639
 
1595
1640
 
1641
+ 276
1596
1642
  277
1597
1643
  278
1598
1644
  279
1599
1645
  280
1600
1646
  281
1601
- 282
1602
- 283</pre>
1647
+ 282</pre>
1603
1648
  </td>
1604
1649
  <td>
1605
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 277</span>
1650
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 276</span>
1606
1651
 
1607
1652
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_hebrew_month_to_s'>hebrew_month_to_s</span><span class='lparen'>(</span><span class='id identifier rubyid_month'>month</span><span class='rparen'>)</span>
1608
1653
  <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='const'>HEBREW_MONTH_NAMES</span><span class='lbracket'>[</span><span class='id identifier rubyid_month'>month</span> <span class='op'>-</span> <span class='int'>1</span><span class='rbracket'>]</span>
@@ -1675,12 +1720,12 @@ it should respond accordingly.</p>
1675
1720
  <pre class="lines">
1676
1721
 
1677
1722
 
1678
- 354
1679
- 355
1680
- 356</pre>
1723
+ 362
1724
+ 363
1725
+ 364</pre>
1681
1726
  </td>
1682
1727
  <td>
1683
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 354</span>
1728
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 362</span>
1684
1729
 
1685
1730
  <span class='kw'>def</span> <span class='id identifier rubyid_last_month_of_hebrew_year'>last_month_of_hebrew_year</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='rparen'>)</span>
1686
1731
  <span class='id identifier rubyid_hebrew_leap_year?'>hebrew_leap_year?</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='int'>13</span> <span class='op'>:</span> <span class='int'>12</span>
@@ -1768,14 +1813,14 @@ it should respond accordingly.</p>
1768
1813
  <pre class="lines">
1769
1814
 
1770
1815
 
1771
- 121
1772
- 122
1773
- 123
1774
- 124
1775
- 125</pre>
1816
+ 117
1817
+ 118
1818
+ 119
1819
+ 120
1820
+ 121</pre>
1776
1821
  </td>
1777
1822
  <td>
1778
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 121</span>
1823
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 117</span>
1779
1824
 
1780
1825
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_new_from_hebrew'>new_from_hebrew</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='id identifier rubyid_month'>month</span><span class='comma'>,</span> <span class='id identifier rubyid_date'>date</span><span class='rparen'>)</span>
1781
1826
  <span class='id identifier rubyid_d'>d</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
@@ -1794,159 +1839,7 @@ it should respond accordingly.</p>
1794
1839
 
1795
1840
 
1796
1841
  <div class="method_details first">
1797
- <h3 class="signature first" id="+-instance_method">
1798
-
1799
- - (<tt><span class='object_link'><a href="" title="HebrewDate (class)">HebrewDate</a></span></tt>) <strong>+</strong>(other_date)
1800
-
1801
-
1802
-
1803
-
1804
-
1805
- </h3><div class="docstring">
1806
- <div class="discussion">
1807
-
1808
- <p>Add the dates specified (in days).</p>
1809
-
1810
-
1811
- </div>
1812
- </div>
1813
- <div class="tags">
1814
- <p class="tag_title">Parameters:</p>
1815
- <ul class="param">
1816
-
1817
- <li>
1818
-
1819
- <span class='name'>other_date</span>
1820
-
1821
-
1822
- <span class='type'>(<tt>Fixnum</tt>)</span>
1823
-
1824
-
1825
-
1826
- &mdash;
1827
- <div class='inline'>
1828
- <p>the days to add.</p>
1829
- </div>
1830
-
1831
- </li>
1832
-
1833
- </ul>
1834
-
1835
- <p class="tag_title">Returns:</p>
1836
- <ul class="return">
1837
-
1838
- <li>
1839
-
1840
-
1841
- <span class='type'>(<tt><span class='object_link'><a href="" title="HebrewDate (class)">HebrewDate</a></span></tt>)</span>
1842
-
1843
-
1844
-
1845
- </li>
1846
-
1847
- </ul>
1848
-
1849
- </div><table class="source_code">
1850
- <tr>
1851
- <td>
1852
- <pre class="lines">
1853
-
1854
-
1855
- 88
1856
- 89
1857
- 90
1858
- 91</pre>
1859
- </td>
1860
- <td>
1861
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 88</span>
1862
-
1863
- <span class='kw'>def</span> <span class='op'>+</span><span class='lparen'>(</span><span class='id identifier rubyid_other_date'>other_date</span><span class='rparen'>)</span>
1864
- <span class='id identifier rubyid_date'>date</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_date'>to_date</span> <span class='op'>+</span> <span class='id identifier rubyid_other_date'>other_date</span>
1865
- <span class='const'>HebrewDate</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_month'>month</span><span class='comma'>,</span> <span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span><span class='rparen'>)</span>
1866
- <span class='kw'>end</span></pre>
1867
- </td>
1868
- </tr>
1869
- </table>
1870
- </div>
1871
-
1872
- <div class="method_details ">
1873
- <h3 class="signature " id="--instance_method">
1874
-
1875
- - (<tt><span class='object_link'><a href="" title="HebrewDate (class)">HebrewDate</a></span></tt>) <strong>-</strong>(other_date)
1876
-
1877
-
1878
-
1879
-
1880
-
1881
- </h3><div class="docstring">
1882
- <div class="discussion">
1883
-
1884
- <p>Subtract the dates specified (in days).</p>
1885
-
1886
-
1887
- </div>
1888
- </div>
1889
- <div class="tags">
1890
- <p class="tag_title">Parameters:</p>
1891
- <ul class="param">
1892
-
1893
- <li>
1894
-
1895
- <span class='name'>other_date</span>
1896
-
1897
-
1898
- <span class='type'>(<tt>Fixnum</tt>)</span>
1899
-
1900
-
1901
-
1902
- &mdash;
1903
- <div class='inline'>
1904
- <p>the days to subtract.</p>
1905
- </div>
1906
-
1907
- </li>
1908
-
1909
- </ul>
1910
-
1911
- <p class="tag_title">Returns:</p>
1912
- <ul class="return">
1913
-
1914
- <li>
1915
-
1916
-
1917
- <span class='type'>(<tt><span class='object_link'><a href="" title="HebrewDate (class)">HebrewDate</a></span></tt>)</span>
1918
-
1919
-
1920
-
1921
- </li>
1922
-
1923
- </ul>
1924
-
1925
- </div><table class="source_code">
1926
- <tr>
1927
- <td>
1928
- <pre class="lines">
1929
-
1930
-
1931
- 96
1932
- 97
1933
- 98
1934
- 99</pre>
1935
- </td>
1936
- <td>
1937
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 96</span>
1938
-
1939
- <span class='kw'>def</span> <span class='op'>-</span><span class='lparen'>(</span><span class='id identifier rubyid_other_date'>other_date</span><span class='rparen'>)</span>
1940
- <span class='id identifier rubyid_date'>date</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_date'>to_date</span> <span class='op'>-</span> <span class='id identifier rubyid_other_date'>other_date</span>
1941
- <span class='const'>HebrewDate</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_month'>month</span><span class='comma'>,</span> <span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span><span class='rparen'>)</span>
1942
- <span class='kw'>end</span></pre>
1943
- </td>
1944
- </tr>
1945
- </table>
1946
- </div>
1947
-
1948
- <div class="method_details ">
1949
- <h3 class="signature " id="back-instance_method">
1842
+ <h3 class="signature first" id="back-instance_method">
1950
1843
 
1951
1844
  - (<tt><span class='object_link'><a href="" title="HebrewDate (class)">HebrewDate</a></span></tt>) <strong>back</strong>
1952
1845
 
@@ -1989,6 +1882,7 @@ it should respond accordingly.</p>
1989
1882
  <pre class="lines">
1990
1883
 
1991
1884
 
1885
+ 232
1992
1886
  233
1993
1887
  234
1994
1888
  235
@@ -2023,11 +1917,10 @@ it should respond accordingly.</p>
2023
1917
  264
2024
1918
  265
2025
1919
  266
2026
- 267
2027
- 268</pre>
1920
+ 267</pre>
2028
1921
  </td>
2029
1922
  <td>
2030
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 233</span>
1923
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 232</span>
2031
1924
 
2032
1925
  <span class='kw'>def</span> <span class='id identifier rubyid_back'>back</span>
2033
1926
  <span class='comment'># Change Gregorian date
@@ -2109,12 +2002,12 @@ it should respond accordingly.</p>
2109
2002
  <pre class="lines">
2110
2003
 
2111
2004
 
2112
- 113
2113
- 114
2114
- 115</pre>
2005
+ 109
2006
+ 110
2007
+ 111</pre>
2115
2008
  </td>
2116
2009
  <td>
2117
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 113</span>
2010
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 109</span>
2118
2011
 
2119
2012
  <span class='kw'>def</span> <span class='id identifier rubyid_clone'>clone</span>
2120
2013
  <span class='const'>HebrewDate</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_date'>to_date</span><span class='rparen'>)</span>
@@ -2168,12 +2061,12 @@ it should respond accordingly.</p>
2168
2061
  <pre class="lines">
2169
2062
 
2170
2063
 
2171
- 319
2172
- 320
2173
- 321</pre>
2064
+ 327
2065
+ 328
2066
+ 329</pre>
2174
2067
  </td>
2175
2068
  <td>
2176
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 319</span>
2069
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 327</span>
2177
2070
 
2178
2071
  <span class='kw'>def</span> <span class='id identifier rubyid_day'>day</span>
2179
2072
  <span class='id identifier rubyid_to_date'>to_date</span><span class='period'>.</span><span class='id identifier rubyid_strftime'>strftime</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>%w</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'>+</span> <span class='int'>1</span>
@@ -2190,6 +2083,10 @@ it should respond accordingly.</p>
2190
2083
 
2191
2084
 
2192
2085
 
2086
+ <span class="aliases">Also known as:
2087
+ <span class="names"><span id='next-instance_method'>next</span>, <span id='succ-instance_method'>succ</span></span>
2088
+ </span>
2089
+
2193
2090
 
2194
2091
 
2195
2092
  </h3><div class="docstring">
@@ -2227,6 +2124,10 @@ it should respond accordingly.</p>
2227
2124
  <pre class="lines">
2228
2125
 
2229
2126
 
2127
+ 184
2128
+ 185
2129
+ 186
2130
+ 187
2230
2131
  188
2231
2132
  189
2232
2133
  190
@@ -2264,14 +2165,10 @@ it should respond accordingly.</p>
2264
2165
  222
2265
2166
  223
2266
2167
  224
2267
- 225
2268
- 226
2269
- 227
2270
- 228
2271
- 229</pre>
2168
+ 225</pre>
2272
2169
  </td>
2273
2170
  <td>
2274
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 188</span>
2171
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 184</span>
2275
2172
 
2276
2173
  <span class='kw'>def</span> <span class='id identifier rubyid_forward'>forward</span>
2277
2174
  <span class='comment'># Change Gregorian date
@@ -2359,12 +2256,12 @@ it should respond accordingly.</p>
2359
2256
  <pre class="lines">
2360
2257
 
2361
2258
 
2362
- 368
2363
- 369
2364
- 370</pre>
2259
+ 376
2260
+ 377
2261
+ 378</pre>
2365
2262
  </td>
2366
2263
  <td>
2367
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 368</span>
2264
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 376</span>
2368
2265
 
2369
2266
  <span class='kw'>def</span> <span class='id identifier rubyid_hebrew_leap_year?'>hebrew_leap_year?</span>
2370
2267
  <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_hebrew_leap_year?'>hebrew_leap_year?</span><span class='lparen'>(</span><span class='ivar'>@hebrew_year</span><span class='rparen'>)</span>
@@ -2413,12 +2310,12 @@ it should respond accordingly.</p>
2413
2310
  <pre class="lines">
2414
2311
 
2415
2312
 
2313
+ 271
2416
2314
  272
2417
- 273
2418
- 274</pre>
2315
+ 273</pre>
2419
2316
  </td>
2420
2317
  <td>
2421
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 272</span>
2318
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 271</span>
2422
2319
 
2423
2320
  <span class='kw'>def</span> <span class='id identifier rubyid_hebrew_month_to_s'>hebrew_month_to_s</span>
2424
2321
  <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_hebrew_month_to_s'>hebrew_month_to_s</span><span class='lparen'>(</span><span class='ivar'>@hebrew_month</span><span class='rparen'>)</span>
@@ -2489,24 +2386,24 @@ it should respond accordingly.</p>
2489
2386
  <pre class="lines">
2490
2387
 
2491
2388
 
2492
- 375
2493
- 376
2494
- 377
2495
- 378
2496
- 379
2497
- 380
2498
- 381
2499
- 382
2500
2389
  383
2501
2390
  384
2502
2391
  385
2503
2392
  386
2504
2393
  387
2505
2394
  388
2506
- 389</pre>
2395
+ 389
2396
+ 390
2397
+ 391
2398
+ 392
2399
+ 393
2400
+ 394
2401
+ 395
2402
+ 396
2403
+ 397</pre>
2507
2404
  </td>
2508
2405
  <td>
2509
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 375</span>
2406
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 383</span>
2510
2407
 
2511
2408
  <span class='kw'>def</span> <span class='id identifier rubyid_last_day_of_hebrew_month'>last_day_of_hebrew_month</span><span class='lparen'>(</span><span class='id identifier rubyid_month'>month</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
2512
2409
  <span class='id identifier rubyid_month'>month</span> <span class='op'>||=</span> <span class='ivar'>@hebrew_month</span>
@@ -2589,14 +2486,6 @@ it should respond accordingly.</p>
2589
2486
  <pre class="lines">
2590
2487
 
2591
2488
 
2592
- 326
2593
- 327
2594
- 328
2595
- 329
2596
- 330
2597
- 331
2598
- 332
2599
- 333
2600
2489
  334
2601
2490
  335
2602
2491
  336
@@ -2604,10 +2493,18 @@ it should respond accordingly.</p>
2604
2493
  338
2605
2494
  339
2606
2495
  340
2607
- 341</pre>
2496
+ 341
2497
+ 342
2498
+ 343
2499
+ 344
2500
+ 345
2501
+ 346
2502
+ 347
2503
+ 348
2504
+ 349</pre>
2608
2505
  </td>
2609
2506
  <td>
2610
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 326</span>
2507
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 334</span>
2611
2508
 
2612
2509
  <span class='kw'>def</span> <span class='id identifier rubyid_last_day_of_month'>last_day_of_month</span><span class='lparen'>(</span><span class='id identifier rubyid_month'>month</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
2613
2510
  <span class='id identifier rubyid_month'>month</span> <span class='op'>||=</span> <span class='ivar'>@month</span>
@@ -2669,12 +2566,12 @@ it should respond accordingly.</p>
2669
2566
  <pre class="lines">
2670
2567
 
2671
2568
 
2672
- 362
2673
- 363
2674
- 364</pre>
2569
+ 370
2570
+ 371
2571
+ 372</pre>
2675
2572
  </td>
2676
2573
  <td>
2677
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 362</span>
2574
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 370</span>
2678
2575
 
2679
2576
  <span class='kw'>def</span> <span class='id identifier rubyid_last_month_of_hebrew_year'>last_month_of_hebrew_year</span>
2680
2577
  <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_last_month_of_hebrew_year'>last_month_of_hebrew_year</span><span class='lparen'>(</span><span class='ivar'>@hebrew_year</span><span class='rparen'>)</span>
@@ -2762,6 +2659,10 @@ it should respond accordingly.</p>
2762
2659
  <pre class="lines">
2763
2660
 
2764
2661
 
2662
+ 128
2663
+ 129
2664
+ 130
2665
+ 131
2765
2666
  132
2766
2667
  133
2767
2668
  134
@@ -2776,14 +2677,10 @@ it should respond accordingly.</p>
2776
2677
  143
2777
2678
  144
2778
2679
  145
2779
- 146
2780
- 147
2781
- 148
2782
- 149
2783
- 150</pre>
2680
+ 146</pre>
2784
2681
  </td>
2785
2682
  <td>
2786
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 132</span>
2683
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 128</span>
2787
2684
 
2788
2685
  <span class='kw'>def</span> <span class='id identifier rubyid_set_date'>set_date</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='id identifier rubyid_month'>month</span><span class='comma'>,</span> <span class='id identifier rubyid_date'>date</span><span class='rparen'>)</span>
2789
2686
  <span class='comment'># precond should be 1-&gt;12 anyways, but just in case...
@@ -2887,6 +2784,10 @@ it should respond accordingly.</p>
2887
2784
  <pre class="lines">
2888
2785
 
2889
2786
 
2787
+ 153
2788
+ 154
2789
+ 155
2790
+ 156
2890
2791
  157
2891
2792
  158
2892
2793
  159
@@ -2904,14 +2805,10 @@ it should respond accordingly.</p>
2904
2805
  171
2905
2806
  172
2906
2807
  173
2907
- 174
2908
- 175
2909
- 176
2910
- 177
2911
- 178</pre>
2808
+ 174</pre>
2912
2809
  </td>
2913
2810
  <td>
2914
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 157</span>
2811
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 153</span>
2915
2812
 
2916
2813
  <span class='kw'>def</span> <span class='id identifier rubyid_set_hebrew_date'>set_hebrew_date</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='id identifier rubyid_month'>month</span><span class='comma'>,</span> <span class='id identifier rubyid_date'>date</span><span class='rparen'>)</span>
2917
2814
  <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Illegal value for Hebrew year: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_year'>year</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_year'>year</span> <span class='op'>&lt;</span> <span class='int'>0</span>
@@ -2953,7 +2850,9 @@ it should respond accordingly.</p>
2953
2850
  <div class="discussion">
2954
2851
 
2955
2852
  <p>Extend the Date strftime method by replacing Hebrew fields. You can denote
2956
- Hebrew fields by using the * flag. Supported flags are:</p>
2853
+ Hebrew fields by using the * flag. Also note that ::replace_saturday will
2854
+ replace the %A, %^A, %a and %^a flags with Shabbat/Shabbos. Supported flags
2855
+ are:</p>
2957
2856
 
2958
2857
  <pre class="code ruby"><code class="ruby">* *Y - Hebrew year
2959
2858
  * *m - Hebrew month, zero-padded
@@ -3008,7 +2907,6 @@ Hebrew fields by using the * flag. Supported flags are:</p>
3008
2907
  <pre class="lines">
3009
2908
 
3010
2909
 
3011
- 301
3012
2910
  302
3013
2911
  303
3014
2912
  304
@@ -3022,10 +2920,18 @@ Hebrew fields by using the * flag. Supported flags are:</p>
3022
2920
  312
3023
2921
  313
3024
2922
  314
3025
- 315</pre>
2923
+ 315
2924
+ 316
2925
+ 317
2926
+ 318
2927
+ 319
2928
+ 320
2929
+ 321
2930
+ 322
2931
+ 323</pre>
3026
2932
  </td>
3027
2933
  <td>
3028
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 301</span>
2934
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 302</span>
3029
2935
 
3030
2936
  <span class='kw'>def</span> <span class='id identifier rubyid_strftime'>strftime</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span>
3031
2937
  <span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='id identifier rubyid_format'>format</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>*Y</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='ivar'>@hebrew_year</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span><span class='period'>
@@ -3040,6 +2946,13 @@ Hebrew fields by using the * flag. Supported flags are:</p>
3040
2946
  </span><span class='id identifier rubyid_ .gsub'> .gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>*d</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='ivar'>@hebrew_date</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_rjust'>rjust</span><span class='lparen'>(</span><span class='int'>2</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>0</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>
3041
2947
  </span><span class='id identifier rubyid_ .gsub'> .gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>*-d</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='ivar'>@hebrew_date</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span><span class='period'>
3042
2948
  </span><span class='id identifier rubyid_ .gsub'> .gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>*e</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='ivar'>@hebrew_date</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_rjust'>rjust</span><span class='lparen'>(</span><span class='int'>2</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'> </span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
2949
+ <span class='kw'>if</span> <span class='const'>HebrewDate</span><span class='period'>.</span><span class='id identifier rubyid_replace_saturday'>replace_saturday</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@hebrew_date</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span> <span class='op'>==</span> <span class='int'>7</span>
2950
+ <span class='id identifier rubyid_shab_name'>shab_name</span> <span class='op'>=</span> <span class='const'>HebrewDate</span><span class='period'>.</span><span class='id identifier rubyid_ashkenaz'>ashkenaz</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Shabbos</span><span class='tstring_end'>&#39;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Shabbat</span><span class='tstring_end'>&#39;</span></span>
2951
+ <span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='id identifier rubyid_format'>format</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>%A</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_shab_name'>shab_name</span><span class='rparen'>)</span><span class='period'>
2952
+ </span><span class='id identifier rubyid_ .gsub'> .gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>%^A</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_shab_name'>shab_name</span><span class='period'>.</span><span class='id identifier rubyid_upcase'>upcase</span><span class='rparen'>)</span><span class='period'>
2953
+ </span><span class='id identifier rubyid_ .gsub'> .gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>%a</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_shab_name'>shab_name</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>2</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>
2954
+ </span><span class='id identifier rubyid_ .gsub'> .gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>%^a</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_shab_name'>shab_name</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>2</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_upcase'>upcase</span><span class='rparen'>)</span>
2955
+ <span class='kw'>end</span>
3043
2956
  <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span>
3044
2957
  <span class='kw'>end</span></pre>
3045
2958
  </td>
@@ -3086,12 +2999,12 @@ Hebrew fields by using the * flag. Supported flags are:</p>
3086
2999
  <pre class="lines">
3087
3000
 
3088
3001
 
3089
- 182
3090
- 183
3091
- 184</pre>
3002
+ 178
3003
+ 179
3004
+ 180</pre>
3092
3005
  </td>
3093
3006
  <td>
3094
- <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 182</span>
3007
+ <pre class="code"><span class="info file"># File 'lib/hebrew_date.rb', line 178</span>
3095
3008
 
3096
3009
  <span class='kw'>def</span> <span class='id identifier rubyid_to_date'>to_date</span>
3097
3010
  <span class='const'>Date</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@year</span><span class='comma'>,</span> <span class='ivar'>@month</span><span class='comma'>,</span> <span class='ivar'>@date</span><span class='rparen'>)</span>
@@ -3106,7 +3019,7 @@ Hebrew fields by using the * flag. Supported flags are:</p>
3106
3019
  </div>
3107
3020
 
3108
3021
  <div id="footer">
3109
- Generated on Sun Jan 26 12:16:13 2014 by
3022
+ Generated on Mon Jan 27 11:49:55 2014 by
3110
3023
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
3111
3024
  0.8.7.3 (ruby-2.0.0).
3112
3025
  </div>
@@ -108,7 +108,7 @@
108
108
  </div>
109
109
 
110
110
  <div id="footer">
111
- Generated on Sun Jan 26 12:16:13 2014 by
111
+ Generated on Mon Jan 27 11:49:54 2014 by
112
112
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
113
113
  0.8.7.3 (ruby-2.0.0).
114
114
  </div>
data/doc/_index.html CHANGED
@@ -143,7 +143,7 @@
143
143
  </div>
144
144
 
145
145
  <div id="footer">
146
- Generated on Sun Jan 26 12:16:13 2014 by
146
+ Generated on Mon Jan 27 11:49:54 2014 by
147
147
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
148
148
  0.8.7.3 (ruby-2.0.0).
149
149
  </div>
data/doc/file.README.html CHANGED
@@ -164,7 +164,7 @@ by calling</p>
164
164
  </div></div>
165
165
 
166
166
  <div id="footer">
167
- Generated on Sun Jan 26 12:16:13 2014 by
167
+ Generated on Mon Jan 27 11:49:54 2014 by
168
168
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
169
169
  0.8.7.3 (ruby-2.0.0).
170
170
  </div>
data/doc/index.html CHANGED
@@ -164,7 +164,7 @@ by calling</p>
164
164
  </div></div>
165
165
 
166
166
  <div id="footer">
167
- Generated on Sun Jan 26 12:16:13 2014 by
167
+ Generated on Mon Jan 27 11:49:54 2014 by
168
168
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
169
169
  0.8.7.3 (ruby-2.0.0).
170
170
  </div>
data/doc/method_list.html CHANGED
@@ -47,18 +47,6 @@
47
47
  <ul id="full_list" class="method">
48
48
 
49
49
 
50
- <li class="r1 ">
51
- <span class='object_link'><a href="HebrewDate.html#%2B-instance_method" title="HebrewDate#+ (method)">#+</a></span>
52
- <small>HebrewDate</small>
53
- </li>
54
-
55
-
56
- <li class="r2 ">
57
- <span class='object_link'><a href="HebrewDate.html#--instance_method" title="HebrewDate#- (method)">#-</a></span>
58
- <small>HebrewDate</small>
59
- </li>
60
-
61
-
62
50
  <li class="r1 ">
63
51
  <span class='object_link'><a href="HebrewDate.html#ashkenaz-class_method" title="HebrewDate.ashkenaz (method)">ashkenaz</a></span>
64
52
  <small>HebrewDate</small>
@@ -144,13 +132,13 @@
144
132
 
145
133
 
146
134
  <li class="r1 ">
147
- <span class='object_link'><a href="HebrewDate.html#hebrew_month_to_s-class_method" title="HebrewDate.hebrew_month_to_s (method)">hebrew_month_to_s</a></span>
135
+ <span class='object_link'><a href="HebrewDate.html#hebrew_month_to_s-instance_method" title="HebrewDate#hebrew_month_to_s (method)">#hebrew_month_to_s</a></span>
148
136
  <small>HebrewDate</small>
149
137
  </li>
150
138
 
151
139
 
152
140
  <li class="r2 ">
153
- <span class='object_link'><a href="HebrewDate.html#hebrew_month_to_s-instance_method" title="HebrewDate#hebrew_month_to_s (method)">#hebrew_month_to_s</a></span>
141
+ <span class='object_link'><a href="HebrewDate.html#hebrew_month_to_s-class_method" title="HebrewDate.hebrew_month_to_s (method)">hebrew_month_to_s</a></span>
154
142
  <small>HebrewDate</small>
155
143
  </li>
156
144
 
@@ -234,36 +222,42 @@
234
222
 
235
223
 
236
224
  <li class="r2 ">
225
+ <span class='object_link'><a href="HebrewDate.html#replace_saturday-class_method" title="HebrewDate.replace_saturday (method)">replace_saturday</a></span>
226
+ <small>HebrewDate</small>
227
+ </li>
228
+
229
+
230
+ <li class="r1 ">
237
231
  <span class='object_link'><a href="HebrewDateSupport/HolidayMethods.html#rosh_chodesh%3F-instance_method" title="HebrewDateSupport::HolidayMethods#rosh_chodesh? (method)">#rosh_chodesh?</a></span>
238
232
  <small>HebrewDateSupport::HolidayMethods</small>
239
233
  </li>
240
234
 
241
235
 
242
- <li class="r1 ">
236
+ <li class="r2 ">
243
237
  <span class='object_link'><a href="HebrewDate.html#set_date-instance_method" title="HebrewDate#set_date (method)">#set_date</a></span>
244
238
  <small>HebrewDate</small>
245
239
  </li>
246
240
 
247
241
 
248
- <li class="r2 ">
242
+ <li class="r1 ">
249
243
  <span class='object_link'><a href="HebrewDate.html#set_hebrew_date-instance_method" title="HebrewDate#set_hebrew_date (method)">#set_hebrew_date</a></span>
250
244
  <small>HebrewDate</small>
251
245
  </li>
252
246
 
253
247
 
254
- <li class="r1 ">
248
+ <li class="r2 ">
255
249
  <span class='object_link'><a href="HebrewDate.html#strftime-instance_method" title="HebrewDate#strftime (method)">#strftime</a></span>
256
250
  <small>HebrewDate</small>
257
251
  </li>
258
252
 
259
253
 
260
- <li class="r2 ">
254
+ <li class="r1 ">
261
255
  <span class='object_link'><a href="HebrewDate.html#to_date-instance_method" title="HebrewDate#to_date (method)">#to_date</a></span>
262
256
  <small>HebrewDate</small>
263
257
  </li>
264
258
 
265
259
 
266
- <li class="r1 ">
260
+ <li class="r2 ">
267
261
  <span class='object_link'><a href="HebrewDate.html#year-instance_method" title="HebrewDate#year (method)">#year</a></span>
268
262
  <small>HebrewDate</small>
269
263
  </li>
@@ -105,7 +105,7 @@
105
105
  </div>
106
106
 
107
107
  <div id="footer">
108
- Generated on Sun Jan 26 12:16:13 2014 by
108
+ Generated on Mon Jan 27 11:49:54 2014 by
109
109
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
110
110
  0.8.7.3 (ruby-2.0.0).
111
111
  </div>
data/hebrew_date.gemspec CHANGED
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'hebrew_date'
3
3
  s.require_paths = %w(. lib)
4
- s.version = '1.0.3'
5
- s.date = '2014-01-26'
4
+ s.version = '1.0.4'
5
+ s.date = '2014-01-27'
6
6
  s.summary = 'Hebrew/Jewish dates, times, and holidays.'
7
7
  s.description = <<-EOF
8
8
  hebrew_date is a library designed to provide information about the Jewish
data/lib/hebrew_date.rb CHANGED
@@ -14,7 +14,7 @@ require_relative 'support/parshiot.rb'
14
14
  class HebrewDate < Delegator
15
15
  include HebrewDateSupport::ParshaMethods
16
16
  include HebrewDateSupport::HolidayMethods
17
- # @!parse extend HebrewDateSupport::HolidayMethods::ClassMethods
17
+ extend HebrewDateSupport::HolidayMethods::ClassMethods
18
18
 
19
19
  # @private
20
20
  HEBREW_EPOCH = -1373429
@@ -31,6 +31,10 @@ class HebrewDate < Delegator
31
31
  # @return [Boolean] Whether to use Israeli parsha/holiday scheme.
32
32
  attr_accessor :israeli
33
33
 
34
+ # @return [Boolean] If true, replaces "Saturday" or "Sat" in {#strftime}
35
+ # with "Shabbat" or "Shabbos" depending on the #ashkenaz value.
36
+ attr_accessor :replace_saturday
37
+
34
38
  # @private
35
39
  attr_accessor :debug
36
40
 
@@ -82,20 +86,12 @@ class HebrewDate < Delegator
82
86
  strftime('*Y-*-m-*-d (%Y-%-m-%-d)')
83
87
  end
84
88
 
85
- # Add the dates specified (in days).
86
- # @param [Fixnum] other_date the days to add.
87
- # @return [HebrewDate]
88
- def +(other_date)
89
- date = self.to_date + other_date
90
- HebrewDate.new(date.year, date.month, date.day)
91
- end
92
-
93
- # Subtract the dates specified (in days).
94
- # @param [Fixnum] other_date the days to subtract.
95
- # @return [HebrewDate]
96
- def -(other_date)
97
- date = self.to_date - other_date
98
- HebrewDate.new(date.year, date.month, date.day)
89
+ [:+, :-, :<<, :>>, :gregorian, :england, :italy, :julian, :new_start,
90
+ :next_month, :next_year, :prev_day, :prev_month,
91
+ :prev_year].each do |method_name|
92
+ define_method(method_name) do |*args|
93
+ HebrewDate.new(self.to_date.send(method_name, *args))
94
+ end
99
95
  end
100
96
 
101
97
  # @private
@@ -228,6 +224,9 @@ class HebrewDate < Delegator
228
224
  self
229
225
  end
230
226
 
227
+ alias_method :next, :forward
228
+ alias_method :succ, :forward
229
+
231
230
  # Move back one day.
232
231
  # @return [HebrewDate] the same HebrewDate object again, for chaining.
233
232
  def back
@@ -283,7 +282,9 @@ class HebrewDate < Delegator
283
282
  end
284
283
 
285
284
  # Extend the Date strftime method by replacing Hebrew fields. You can denote
286
- # Hebrew fields by using the * flag. Supported flags are:
285
+ # Hebrew fields by using the * flag. Also note that ::replace_saturday will
286
+ # replace the %A, %^A, %a and %^a flags with Shabbat/Shabbos.
287
+ # Supported flags are:
287
288
  # * *Y - Hebrew year
288
289
  # * *m - Hebrew month, zero-padded
289
290
  # * *_m - Hebrew month, blank-padded
@@ -311,6 +312,13 @@ class HebrewDate < Delegator
311
312
  .gsub('*d', @hebrew_date.to_s.rjust(2, '0'))
312
313
  .gsub('*-d', @hebrew_date.to_s)
313
314
  .gsub('*e', @hebrew_date.to_s.rjust(2, ' '))
315
+ if HebrewDate.replace_saturday && @hebrew_date.day == 7
316
+ shab_name = HebrewDate.ashkenaz ? 'Shabbos' : 'Shabbat'
317
+ format = format.gsub('%A', shab_name)
318
+ .gsub('%^A', shab_name.upcase)
319
+ .gsub('%a', shab_name[0..2])
320
+ .gsub('%^a', shab_name[0..2].upcase)
321
+ end
314
322
  super(format)
315
323
  end
316
324
 
@@ -383,9 +383,5 @@ module HebrewDateSupport
383
383
  end
384
384
  end
385
385
 
386
- def self.included(base)
387
- base.extend(ClassMethods)
388
- end
389
-
390
386
  end
391
387
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hebrew_date
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-26 00:00:00.000000000 Z
11
+ date: 2014-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yard