hebrew_date 1.0.21 → 1.0.22

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.
@@ -143,7 +143,7 @@
143
143
  </div>
144
144
 
145
145
  <div id="footer">
146
- Generated on Mon Jan 27 11:49:54 2014 by
146
+ Generated on Fri Sep 19 12:15:09 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>
@@ -123,6 +123,13 @@ except that they start with * instead of %:</p>
123
123
  <p><code>*e</code> - Hebrew day of month, blank-padded</p>
124
124
  </li></ul>
125
125
 
126
+ <p>There is an additional flag added which is of simple utility:</p>
127
+ <ul><li>
128
+ <p><code>%.b</code> - Gregorian day of month, followed by a period (.),
129
+ <em>except</em> for May,
130
+ which doesn&#39;t need one and is incorrect.</p>
131
+ </li></ul>
132
+
126
133
  <h1 id="label-Parsha">Parsha</h1>
127
134
 
128
135
  <p>You can get the parsha of the current day by calling the
@@ -164,7 +171,7 @@ by calling</p>
164
171
  </div></div>
165
172
 
166
173
  <div id="footer">
167
- Generated on Mon Jan 27 11:49:54 2014 by
174
+ Generated on Fri Sep 19 12:15:09 2014 by
168
175
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
169
176
  0.8.7.3 (ruby-2.0.0).
170
177
  </div>
@@ -123,6 +123,13 @@ except that they start with * instead of %:</p>
123
123
  <p><code>*e</code> - Hebrew day of month, blank-padded</p>
124
124
  </li></ul>
125
125
 
126
+ <p>There is an additional flag added which is of simple utility:</p>
127
+ <ul><li>
128
+ <p><code>%.b</code> - Gregorian day of month, followed by a period (.),
129
+ <em>except</em> for May,
130
+ which doesn&#39;t need one and is incorrect.</p>
131
+ </li></ul>
132
+
126
133
  <h1 id="label-Parsha">Parsha</h1>
127
134
 
128
135
  <p>You can get the parsha of the current day by calling the
@@ -164,7 +171,7 @@ by calling</p>
164
171
  </div></div>
165
172
 
166
173
  <div id="footer">
167
- Generated on Mon Jan 27 11:49:54 2014 by
174
+ Generated on Fri Sep 19 12:15:09 2014 by
168
175
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
169
176
  0.8.7.3 (ruby-2.0.0).
170
177
  </div>
@@ -47,6 +47,42 @@
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
+ <li class="r1 ">
63
+ <span class='object_link'><a href="HebrewDate.html#%3C%3D%3E-instance_method" title="HebrewDate#&lt;=&gt; (method)">#&lt;=&gt;</a></span>
64
+ <small>HebrewDate</small>
65
+ </li>
66
+
67
+
68
+ <li class="r2 ">
69
+ <span class='object_link'><a href="HebrewDate.html#__getobj__-instance_method" title="HebrewDate#__getobj__ (method)">#__getobj__</a></span>
70
+ <small>HebrewDate</small>
71
+ </li>
72
+
73
+
74
+ <li class="r1 ">
75
+ <span class='object_link'><a href="HebrewDate.html#__setobj__-instance_method" title="HebrewDate#__setobj__ (method)">#__setobj__</a></span>
76
+ <small>HebrewDate</small>
77
+ </li>
78
+
79
+
80
+ <li class="r2 ">
81
+ <span class='object_link'><a href="HebrewDate.html#abs_date-instance_method" title="HebrewDate#abs_date (method)">#abs_date</a></span>
82
+ <small>HebrewDate</small>
83
+ </li>
84
+
85
+
50
86
  <li class="r1 ">
51
87
  <span class='object_link'><a href="HebrewDate.html#ashkenaz-class_method" title="HebrewDate.ashkenaz (method)">ashkenaz</a></span>
52
88
  <small>HebrewDate</small>
@@ -66,19 +102,31 @@
66
102
 
67
103
 
68
104
  <li class="r2 ">
69
- <span class='object_link'><a href="HebrewDate.html#clone-instance_method" title="HebrewDate#clone (method)">#clone</a></span>
105
+ <span class='object_link'><a href="HebrewDate.html#date-instance_method" title="HebrewDate#date (method)">#date</a></span>
70
106
  <small>HebrewDate</small>
71
107
  </li>
72
108
 
73
109
 
74
110
  <li class="r1 ">
75
- <span class='object_link'><a href="HebrewDate.html#date-instance_method" title="HebrewDate#date (method)">#date</a></span>
111
+ <span class='object_link'><a href="HebrewDate.html#day-instance_method" title="HebrewDate#day (method)">#day</a></span>
76
112
  <small>HebrewDate</small>
77
113
  </li>
78
114
 
79
115
 
80
116
  <li class="r2 ">
81
- <span class='object_link'><a href="HebrewDate.html#day-instance_method" title="HebrewDate#day (method)">#day</a></span>
117
+ <span class='object_link'><a href="HebrewDate.html#day_name-class_method" title="HebrewDate.day_name (method)">day_name</a></span>
118
+ <small>HebrewDate</small>
119
+ </li>
120
+
121
+
122
+ <li class="r1 ">
123
+ <span class='object_link'><a href="HebrewDate.html#debug-class_method" title="HebrewDate.debug (method)">debug</a></span>
124
+ <small>HebrewDate</small>
125
+ </li>
126
+
127
+
128
+ <li class="r2 ">
129
+ <span class='object_link'><a href="HebrewDate.html#downto-instance_method" title="HebrewDate#downto (method)">#downto</a></span>
82
130
  <small>HebrewDate</small>
83
131
  </li>
84
132
 
@@ -162,25 +210,25 @@
162
210
 
163
211
 
164
212
  <li class="r2 ">
165
- <span class='object_link'><a href="HebrewDate.html#israeli-class_method" title="HebrewDate.israeli (method)">israeli</a></span>
213
+ <span class='object_link'><a href="HebrewDate.html#inspect-instance_method" title="HebrewDate#inspect (method)">#inspect</a></span>
166
214
  <small>HebrewDate</small>
167
215
  </li>
168
216
 
169
217
 
170
218
  <li class="r1 ">
171
- <span class='object_link'><a href="HebrewDate.html#last_day_of_hebrew_month-instance_method" title="HebrewDate#last_day_of_hebrew_month (method)">#last_day_of_hebrew_month</a></span>
219
+ <span class='object_link'><a href="HebrewDate.html#israeli-class_method" title="HebrewDate.israeli (method)">israeli</a></span>
172
220
  <small>HebrewDate</small>
173
221
  </li>
174
222
 
175
223
 
176
224
  <li class="r2 ">
177
- <span class='object_link'><a href="HebrewDate.html#last_day_of_month-instance_method" title="HebrewDate#last_day_of_month (method)">#last_day_of_month</a></span>
225
+ <span class='object_link'><a href="HebrewDate.html#last_day_of_hebrew_month-instance_method" title="HebrewDate#last_day_of_hebrew_month (method)">#last_day_of_hebrew_month</a></span>
178
226
  <small>HebrewDate</small>
179
227
  </li>
180
228
 
181
229
 
182
230
  <li class="r1 ">
183
- <span class='object_link'><a href="HebrewDate.html#last_month_of_hebrew_year-class_method" title="HebrewDate.last_month_of_hebrew_year (method)">last_month_of_hebrew_year</a></span>
231
+ <span class='object_link'><a href="HebrewDate.html#last_day_of_month-instance_method" title="HebrewDate#last_day_of_month (method)">#last_day_of_month</a></span>
184
232
  <small>HebrewDate</small>
185
233
  </li>
186
234
 
@@ -192,17 +240,29 @@
192
240
 
193
241
 
194
242
  <li class="r1 ">
195
- <span class='object_link'><a href="HebrewDate.html#month-instance_method" title="HebrewDate#month (method)">#month</a></span>
243
+ <span class='object_link'><a href="HebrewDate.html#last_month_of_hebrew_year-class_method" title="HebrewDate.last_month_of_hebrew_year (method)">last_month_of_hebrew_year</a></span>
196
244
  <small>HebrewDate</small>
197
245
  </li>
198
246
 
199
247
 
200
248
  <li class="r2 ">
249
+ <span class='object_link'><a href="HebrewDate.html#month-instance_method" title="HebrewDate#month (method)">#month</a></span>
250
+ <small>HebrewDate</small>
251
+ </li>
252
+
253
+
254
+ <li class="r1 ">
201
255
  <span class='object_link'><a href="HebrewDate.html#new_from_hebrew-class_method" title="HebrewDate.new_from_hebrew (method)">new_from_hebrew</a></span>
202
256
  <small>HebrewDate</small>
203
257
  </li>
204
258
 
205
259
 
260
+ <li class="r2 ">
261
+ <span class='object_link'><a href="HebrewDate.html#next-instance_method" title="HebrewDate#next (method)">#next</a></span>
262
+ <small>HebrewDate</small>
263
+ </li>
264
+
265
+
206
266
  <li class="r1 ">
207
267
  <span class='object_link'><a href="HebrewDateSupport/HolidayMethods.html#omer-instance_method" title="HebrewDateSupport::HolidayMethods#omer (method)">#omer</a></span>
208
268
  <small>HebrewDateSupport::HolidayMethods</small>
@@ -234,29 +294,53 @@
234
294
 
235
295
 
236
296
  <li class="r2 ">
297
+ <span class='object_link'><a href="HebrewDateSupport/HolidayMethods.html#second_day_yom_tov%3F-instance_method" title="HebrewDateSupport::HolidayMethods#second_day_yom_tov? (method)">#second_day_yom_tov?</a></span>
298
+ <small>HebrewDateSupport::HolidayMethods</small>
299
+ </li>
300
+
301
+
302
+ <li class="r1 ">
237
303
  <span class='object_link'><a href="HebrewDate.html#set_date-instance_method" title="HebrewDate#set_date (method)">#set_date</a></span>
238
304
  <small>HebrewDate</small>
239
305
  </li>
240
306
 
241
307
 
242
- <li class="r1 ">
308
+ <li class="r2 ">
243
309
  <span class='object_link'><a href="HebrewDate.html#set_hebrew_date-instance_method" title="HebrewDate#set_hebrew_date (method)">#set_hebrew_date</a></span>
244
310
  <small>HebrewDate</small>
245
311
  </li>
246
312
 
247
313
 
314
+ <li class="r1 ">
315
+ <span class='object_link'><a href="HebrewDate.html#shabbos%3F-instance_method" title="HebrewDate#shabbos? (method)">#shabbos?</a></span>
316
+ <small>HebrewDate</small>
317
+ </li>
318
+
319
+
248
320
  <li class="r2 ">
249
- <span class='object_link'><a href="HebrewDate.html#strftime-instance_method" title="HebrewDate#strftime (method)">#strftime</a></span>
321
+ <span class='object_link'><a href="HebrewDate.html#step-instance_method" title="HebrewDate#step (method)">#step</a></span>
250
322
  <small>HebrewDate</small>
251
323
  </li>
252
324
 
253
325
 
254
326
  <li class="r1 ">
327
+ <span class='object_link'><a href="HebrewDate.html#strftime-instance_method" title="HebrewDate#strftime (method)">#strftime</a></span>
328
+ <small>HebrewDate</small>
329
+ </li>
330
+
331
+
332
+ <li class="r2 ">
255
333
  <span class='object_link'><a href="HebrewDate.html#to_date-instance_method" title="HebrewDate#to_date (method)">#to_date</a></span>
256
334
  <small>HebrewDate</small>
257
335
  </li>
258
336
 
259
337
 
338
+ <li class="r1 ">
339
+ <span class='object_link'><a href="HebrewDate.html#upto-instance_method" title="HebrewDate#upto (method)">#upto</a></span>
340
+ <small>HebrewDate</small>
341
+ </li>
342
+
343
+
260
344
  <li class="r2 ">
261
345
  <span class='object_link'><a href="HebrewDate.html#year-instance_method" title="HebrewDate#year (method)">#year</a></span>
262
346
  <small>HebrewDate</small>
@@ -105,7 +105,7 @@
105
105
  </div>
106
106
 
107
107
  <div id="footer">
108
- Generated on Mon Jan 27 11:49:54 2014 by
108
+ Generated on Fri Sep 19 12:15:09 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>
@@ -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.21'
5
- s.date = '2014-07-26'
4
+ s.version = '1.0.22'
5
+ s.date = '2014-10-06'
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
@@ -57,7 +57,7 @@ module HebrewDateSupport
57
57
  when :PESACH_SHENI
58
58
  self.new_from_hebrew(year, 2, 15)
59
59
  when :YOM_HAZIKARON
60
- self.from_holiday(:YOM_HAATZMAUT).back
60
+ self.from_holiday(:YOM_HAATZMAUT, year).back
61
61
  when :YOM_HAATZMAUT
62
62
  date = self.new_from_hebrew(year, 2, 5)
63
63
  # Friday or Shabbat - move back to Thursday
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.21
4
+ version: 1.0.22
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-07-26 00:00:00.000000000 Z
11
+ date: 2014-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yard
@@ -54,8 +54,9 @@ files:
54
54
  - README.md
55
55
  - doc/HebrewDate.html
56
56
  - doc/HebrewDateSupport.html
57
- - doc/HebrewDateSupport/Holidays.html
58
- - doc/HebrewDateSupport/Parshiot.html
57
+ - doc/HebrewDateSupport/HolidayMethods.html
58
+ - doc/HebrewDateSupport/HolidayMethods/ClassMethods.html
59
+ - doc/HebrewDateSupport/ParshaMethods.html
59
60
  - doc/JqrHelpers/Rails.html
60
61
  - doc/_index.html
61
62
  - doc/class_list.html
@@ -1,436 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
- <title>
7
- Module: HebrewDateSupport::Parshiot
8
-
9
- &mdash; Documentation by YARD 0.8.7.3
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- hasFrames = window.top.frames.main ? true : false;
19
- relpath = '../';
20
- framesUrl = "../frames.html#!" + escape(window.location.href);
21
- </script>
22
-
23
-
24
- <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
-
26
- <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
-
28
-
29
- </head>
30
- <body>
31
- <div id="header">
32
- <div id="menu">
33
-
34
- <a href="../_index.html">Index (P)</a> &raquo;
35
- <span class='title'><span class='object_link'><a href="../HebrewDateSupport.html" title="HebrewDateSupport (module)">HebrewDateSupport</a></span></span>
36
- &raquo;
37
- <span class="title">Parshiot</span>
38
-
39
-
40
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
- </div>
42
-
43
- <div id="search">
44
-
45
- <a class="full_list_link" id="class_list_link"
46
- href="../class_list.html">
47
- Class List
48
- </a>
49
-
50
- <a class="full_list_link" id="method_list_link"
51
- href="../method_list.html">
52
- Method List
53
- </a>
54
-
55
- <a class="full_list_link" id="file_list_link"
56
- href="../file_list.html">
57
- File List
58
- </a>
59
-
60
- </div>
61
- <div class="clear"></div>
62
- </div>
63
-
64
- <iframe id="search_frame"></iframe>
65
-
66
- <div id="content"><h1>Module: HebrewDateSupport::Parshiot
67
-
68
-
69
-
70
- </h1>
71
-
72
- <dl class="box">
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
- <dt class="r1">Included in:</dt>
81
- <dd class="r1"><span class='object_link'><a href="../HebrewDate.html" title="HebrewDate (class)">HebrewDate</a></span></dd>
82
-
83
-
84
-
85
- <dt class="r2 last">Defined in:</dt>
86
- <dd class="r2 last">lib/support/parshiot.rb</dd>
87
-
88
- </dl>
89
- <div class="clear"></div>
90
-
91
-
92
- <h2>Constant Summary</h2>
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
- <h2>
103
- Instance Method Summary
104
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
105
- </h2>
106
-
107
- <ul class="summary">
108
-
109
- <li class="public ">
110
- <span class="summary_signature">
111
-
112
- <a href="#parsha-instance_method" title="#parsha (instance method)">- (String) <strong>parsha</strong>(skip_extra = false) </a>
113
-
114
-
115
-
116
- </span>
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
- <span class="summary_desc"><div class='inline'>
127
- <p>Returns today&#39;s parsha(ios) or an empty string if there are none.</p>
128
- </div></span>
129
-
130
- </li>
131
-
132
-
133
- </ul>
134
-
135
-
136
-
137
-
138
- <div id="instance_method_details" class="method_details_list">
139
- <h2>Instance Method Details</h2>
140
-
141
-
142
- <div class="method_details first">
143
- <h3 class="signature first" id="parsha-instance_method">
144
-
145
- - (<tt>String</tt>) <strong>parsha</strong>(skip_extra = false)
146
-
147
-
148
-
149
-
150
-
151
- </h3><div class="docstring">
152
- <div class="discussion">
153
-
154
- <p>Returns today&#39;s parsha(ios) or an empty string if there are none. names
155
- such as Zachor or Hagadol.</p>
156
-
157
-
158
- </div>
159
- </div>
160
- <div class="tags">
161
- <p class="tag_title">Parameters:</p>
162
- <ul class="param">
163
-
164
- <li>
165
-
166
- <span class='name'>skip_extra</span>
167
-
168
-
169
- <span class='type'>(<tt>Boolean</tt>)</span>
170
-
171
-
172
- <em class="default">(defaults to: <tt>false</tt>)</em>
173
-
174
-
175
- &mdash;
176
- <div class='inline'>
177
- <p>if true, do not return “extra” Parsha</p>
178
- </div>
179
-
180
- </li>
181
-
182
- </ul>
183
-
184
- <p class="tag_title">Returns:</p>
185
- <ul class="return">
186
-
187
- <li>
188
-
189
-
190
- <span class='type'>(<tt>String</tt>)</span>
191
-
192
-
193
-
194
- </li>
195
-
196
- </ul>
197
-
198
- </div><table class="source_code">
199
- <tr>
200
- <td>
201
- <pre class="lines">
202
-
203
-
204
- 180
205
- 181
206
- 182
207
- 183
208
- 184
209
- 185
210
- 186
211
- 187
212
- 188
213
- 189
214
- 190
215
- 191
216
- 192
217
- 193
218
- 194
219
- 195
220
- 196
221
- 197
222
- 198
223
- 199
224
- 200
225
- 201
226
- 202
227
- 203
228
- 204
229
- 205
230
- 206
231
- 207
232
- 208
233
- 209
234
- 210
235
- 211
236
- 212
237
- 213
238
- 214
239
- 215
240
- 216
241
- 217
242
- 218
243
- 219
244
- 220
245
- 221
246
- 222
247
- 223
248
- 224
249
- 225
250
- 226
251
- 227
252
- 228
253
- 229
254
- 230
255
- 231
256
- 232
257
- 233
258
- 234
259
- 235
260
- 236
261
- 237
262
- 238
263
- 239
264
- 240
265
- 241
266
- 242
267
- 243
268
- 244
269
- 245
270
- 246
271
- 247
272
- 248
273
- 249
274
- 250
275
- 251
276
- 252
277
- 253
278
- 254
279
- 255
280
- 256
281
- 257
282
- 258
283
- 259
284
- 260
285
- 261
286
- 262
287
- 263
288
- 264
289
- 265
290
- 266
291
- 267
292
- 268
293
- 269
294
- 270
295
- 271
296
- 272
297
- 273
298
- 274
299
- 275
300
- 276
301
- 277
302
- 278
303
- 279
304
- 280
305
- 281
306
- 282
307
- 283
308
- 284
309
- 285</pre>
310
- </td>
311
- <td>
312
- <pre class="code"><span class="info file"># File 'lib/support/parshiot.rb', line 180</span>
313
-
314
- <span class='kw'>def</span> <span class='id identifier rubyid_parsha'>parsha</span><span class='lparen'>(</span><span class='id identifier rubyid_skip_extra'>skip_extra</span><span class='op'>=</span><span class='kw'>false</span><span class='rparen'>)</span>
315
- <span class='comment'># if today is not Shabbos, then there is no normal parsha reading
316
- </span> <span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span> <span class='op'>!=</span> <span class='int'>7</span>
317
-
318
- <span class='comment'># kvia= whether a Hebrew year is short/regular/long (0/1/2)
319
- </span> <span class='comment'># rosh_hashana= Rosh Hashana of this Hebrew year
320
- </span> <span class='comment'># rosh_hashana_day= day of week Rosh Hashana was on this year
321
- </span> <span class='comment'># week= current week in Hebrew calendar from Rosh Hashana
322
- </span> <span class='comment'># array= the correct index array for this Hebrew year
323
- </span> <span class='comment'># index= the index number of the parsha name
324
- </span> <span class='id identifier rubyid_array'>array</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
325
- <span class='comment'># create a clone of this date
326
- </span> <span class='id identifier rubyid_rosh_hashana'>rosh_hashana</span> <span class='op'>=</span> <span class='const'>HebrewDate</span><span class='period'>.</span><span class='id identifier rubyid_new_from_hebrew'>new_from_hebrew</span><span class='lparen'>(</span><span class='ivar'>@hebrew_year</span><span class='comma'>,</span> <span class='int'>7</span><span class='comma'>,</span> <span class='int'>1</span><span class='rparen'>)</span>
327
-
328
- <span class='comment'># get day Rosh Hashana was on
329
- </span> <span class='id identifier rubyid_rosh_hashana_day'>rosh_hashana_day</span> <span class='op'>=</span> <span class='id identifier rubyid_rosh_hashana'>rosh_hashana</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span>
330
-
331
- <span class='comment'># week is the week since the first Shabbos on or after Rosh Hashana
332
- </span> <span class='id identifier rubyid_week'>week</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='ivar'>@abs_date</span> <span class='op'>-</span> <span class='id identifier rubyid_rosh_hashana'>rosh_hashana</span><span class='period'>.</span><span class='id identifier rubyid_abs_date'>abs_date</span><span class='rparen'>)</span> <span class='op'>-</span>
333
- <span class='lparen'>(</span><span class='int'>7</span> <span class='op'>-</span> <span class='id identifier rubyid_rosh_hashana_day'>rosh_hashana_day</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>/</span> <span class='float'>7.0</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
334
-
335
- <span class='comment'># get kvia
336
- </span> <span class='kw'>if</span> <span class='id identifier rubyid__cheshvan_long?'>_cheshvan_long?</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid__kislev_short?'>_kislev_short?</span>
337
- <span class='id identifier rubyid_kvia'>kvia</span> <span class='op'>=</span> <span class='int'>2</span>
338
- <span class='kw'>elsif</span> <span class='op'>!</span><span class='id identifier rubyid__cheshvan_long?'>_cheshvan_long?</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid__kislev_short?'>_kislev_short?</span>
339
- <span class='id identifier rubyid_kvia'>kvia</span> <span class='op'>=</span> <span class='int'>0</span>
340
- <span class='kw'>else</span>
341
- <span class='id identifier rubyid_kvia'>kvia</span> <span class='op'>=</span> <span class='int'>1</span>
342
- <span class='kw'>end</span>
343
-
344
- <span class='comment'># determine appropriate array
345
- </span> <span class='kw'>if</span> <span class='id identifier rubyid_hebrew_leap_year?'>hebrew_leap_year?</span>
346
- <span class='comment'># not leap year
347
- </span> <span class='kw'>case</span> <span class='id identifier rubyid_rosh_hashana_day'>rosh_hashana_day</span>
348
- <span class='kw'>when</span> <span class='int'>7</span> <span class='comment'># RH was on a Sat
349
- </span> <span class='kw'>if</span> <span class='id identifier rubyid_kvia'>kvia</span> <span class='op'>==</span> <span class='int'>0</span>
350
- <span class='id identifier rubyid_array'>array</span> <span class='op'>=</span> <span class='const'>SAT_SHORT_LEAP</span>
351
- <span class='kw'>elsif</span> <span class='id identifier rubyid_kvia'>kvia</span> <span class='op'>==</span> <span class='int'>2</span>
352
- <span class='id identifier rubyid_array'>array</span> <span class='op'>=</span> <span class='ivar'>@israeli</span> <span class='op'>?</span> <span class='const'>SAT_SHORT_LEAP</span> <span class='op'>:</span> <span class='const'>SAT_LONG_LEAP</span>
353
- <span class='kw'>end</span>
354
- <span class='kw'>when</span> <span class='int'>2</span> <span class='comment'># RH was on a Mon
355
- </span> <span class='kw'>if</span> <span class='id identifier rubyid_kvia'>kvia</span> <span class='op'>==</span> <span class='int'>0</span>
356
- <span class='id identifier rubyid_array'>array</span> <span class='op'>=</span> <span class='ivar'>@israeli</span> <span class='op'>?</span> <span class='const'>MON_SHORT_LEAP_ISRAEL</span> <span class='op'>:</span> <span class='const'>MON_SHORT_LEAP</span>
357
- <span class='kw'>elsif</span> <span class='id identifier rubyid_kvia'>kvia</span> <span class='op'>==</span> <span class='int'>2</span>
358
- <span class='id identifier rubyid_array'>array</span> <span class='op'>=</span> <span class='ivar'>@israeli</span> <span class='op'>?</span> <span class='const'>MON_LONG_LEAP_ISRAEL</span> <span class='op'>:</span> <span class='const'>MON_LONG_LEAP</span>
359
- <span class='kw'>end</span>
360
- <span class='kw'>when</span> <span class='int'>3</span> <span class='comment'># RH was on a Tue
361
- </span> <span class='kw'>if</span> <span class='id identifier rubyid_kvia'>kvia</span> <span class='op'>==</span> <span class='int'>1</span>
362
- <span class='id identifier rubyid_array'>array</span> <span class='op'>=</span> <span class='ivar'>@israeli</span> <span class='op'>?</span> <span class='const'>MON_LONG_LEAP_ISRAEL</span> <span class='op'>:</span> <span class='const'>MON_LONG_LEAP</span>
363
- <span class='kw'>end</span>
364
- <span class='kw'>when</span> <span class='int'>5</span> <span class='comment'># RH was on a Thu
365
- </span> <span class='kw'>if</span> <span class='id identifier rubyid_kvia'>kvia</span> <span class='op'>==</span> <span class='int'>0</span>
366
- <span class='id identifier rubyid_array'>array</span> <span class='op'>=</span> <span class='const'>THU_SHORT_LEAP</span>
367
- <span class='kw'>elsif</span> <span class='id identifier rubyid_kvia'>kvia</span> <span class='op'>==</span> <span class='int'>2</span>
368
- <span class='id identifier rubyid_array'>array</span> <span class='op'>=</span> <span class='const'>THU_LONG_LEAP</span>
369
- <span class='kw'>end</span>
370
- <span class='kw'>end</span>
371
- <span class='kw'>else</span>
372
- <span class='kw'>case</span> <span class='id identifier rubyid_rosh_hashana_day'>rosh_hashana_day</span>
373
- <span class='kw'>when</span> <span class='int'>7</span> <span class='comment'># RH was on a Saturday
374
- </span> <span class='kw'>if</span> <span class='id identifier rubyid_kvia'>kvia</span> <span class='op'>==</span> <span class='int'>0</span>
375
- <span class='id identifier rubyid_array'>array</span> <span class='op'>=</span> <span class='const'>SAT_SHORT</span>
376
- <span class='kw'>elsif</span> <span class='id identifier rubyid_kvia'>kvia</span> <span class='op'>==</span> <span class='int'>2</span>
377
- <span class='id identifier rubyid_array'>array</span> <span class='op'>=</span> <span class='const'>SAT_LONG</span>
378
- <span class='kw'>end</span>
379
- <span class='kw'>when</span> <span class='int'>2</span> <span class='comment'># RH was on a Monday
380
- </span> <span class='kw'>if</span> <span class='id identifier rubyid_kvia'>kvia</span> <span class='op'>==</span> <span class='int'>0</span>
381
- <span class='id identifier rubyid_array'>array</span> <span class='op'>=</span> <span class='const'>MON_SHORT</span>
382
- <span class='kw'>elsif</span> <span class='id identifier rubyid_kvia'>kvia</span> <span class='op'>==</span> <span class='int'>2</span>
383
- <span class='id identifier rubyid_array'>array</span> <span class='op'>=</span> <span class='ivar'>@israeli</span> <span class='op'>?</span> <span class='const'>MON_SHORT</span> <span class='op'>:</span> <span class='const'>MON_LONG</span>
384
- <span class='kw'>end</span>
385
- <span class='kw'>when</span> <span class='int'>3</span> <span class='comment'># RH was on a Tuesday
386
- </span> <span class='kw'>if</span> <span class='id identifier rubyid_kvia'>kvia</span> <span class='op'>==</span> <span class='int'>1</span>
387
- <span class='id identifier rubyid_array'>array</span> <span class='op'>=</span> <span class='ivar'>@israeli</span> <span class='op'>?</span> <span class='const'>MON_SHORT</span> <span class='op'>:</span> <span class='const'>MON_LONG</span>
388
- <span class='kw'>end</span>
389
- <span class='kw'>when</span> <span class='int'>5</span> <span class='comment'># RH was on a Thursday
390
- </span> <span class='kw'>if</span> <span class='id identifier rubyid_kvia'>kvia</span> <span class='op'>==</span> <span class='int'>1</span>
391
- <span class='id identifier rubyid_array'>array</span> <span class='op'>=</span> <span class='ivar'>@israeli</span> <span class='op'>?</span> <span class='const'>THU_NORMAL_ISRAEL</span> <span class='op'>:</span> <span class='const'>THU_NORMAL</span>
392
- <span class='kw'>elsif</span> <span class='id identifier rubyid_kvia'>kvia</span> <span class='op'>==</span> <span class='int'>2</span>
393
- <span class='id identifier rubyid_array'>array</span> <span class='op'>=</span> <span class='const'>THU_LONG</span>
394
- <span class='kw'>end</span>
395
- <span class='kw'>end</span>
396
- <span class='kw'>end</span>
397
-
398
- <span class='comment'># if something goes wrong
399
- </span> <span class='kw'>if</span> <span class='id identifier rubyid_array'>array</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>0</span>
400
- <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Was not able to set the index array to any of the known types.</span><span class='tstring_end'>&#39;</span></span>
401
- <span class='kw'>end</span>
402
-
403
- <span class='comment'># get index from array
404
- </span> <span class='id identifier rubyid_index'>index</span> <span class='op'>=</span> <span class='id identifier rubyid_array'>array</span><span class='lbracket'>[</span><span class='id identifier rubyid_week'>week</span><span class='rbracket'>]</span>
405
-
406
- <span class='comment'># If no Parsha this week
407
- </span> <span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>if</span> <span class='id identifier rubyid_index'>index</span> <span class='op'>&lt;</span> <span class='int'>0</span>
408
-
409
- <span class='comment'># if parsha this week
410
- </span> <span class='id identifier rubyid_subindex'>subindex</span> <span class='op'>=</span> <span class='ivar'>@ashkenaz</span> <span class='op'>?</span> <span class='int'>1</span> <span class='op'>:</span> <span class='int'>0</span>
411
-
412
- <span class='kw'>unless</span> <span class='id identifier rubyid_skip_extra'>skip_extra</span>
413
- <span class='id identifier rubyid_extra_parsha'>extra_parsha</span> <span class='op'>=</span> <span class='id identifier rubyid__extra_parsha'>_extra_parsha</span>
414
- <span class='kw'>if</span> <span class='id identifier rubyid_extra_parsha'>extra_parsha</span>
415
- <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='const'>PARSHA_NAMES</span><span class='lbracket'>[</span><span class='id identifier rubyid_index'>index</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_subindex'>subindex</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_extra_parsha'>extra_parsha</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
416
- <span class='kw'>end</span>
417
- <span class='kw'>end</span>
418
- <span class='const'>PARSHA_NAMES</span><span class='lbracket'>[</span><span class='id identifier rubyid_index'>index</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_subindex'>subindex</span><span class='rbracket'>]</span>
419
- <span class='kw'>end</span></pre>
420
- </td>
421
- </tr>
422
- </table>
423
- </div>
424
-
425
- </div>
426
-
427
- </div>
428
-
429
- <div id="footer">
430
- Generated on Thu Jan 16 19:44:44 2014 by
431
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
432
- 0.8.7.3 (ruby-2.0.0).
433
- </div>
434
-
435
- </body>
436
- </html>