lazier 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/doc/Lazier.html +86 -83
- data/doc/Lazier/Boolean.html +10 -8
- data/doc/Lazier/DateTime.html +58 -52
- data/doc/Lazier/DateTime/ClassMethods.html +91 -79
- data/doc/Lazier/Exceptions.html +2 -2
- data/doc/Lazier/Exceptions/Dump.html +2 -2
- data/doc/Lazier/Hash.html +20 -18
- data/doc/Lazier/Math.html +2 -2
- data/doc/Lazier/Math/ClassMethods.html +24 -22
- data/doc/Lazier/Object.html +109 -95
- data/doc/Lazier/Pathname.html +11 -10
- data/doc/Lazier/Settings.html +80 -70
- data/doc/Lazier/String.html +26 -22
- data/doc/Lazier/TimeZone.html +102 -90
- data/doc/Lazier/TimeZone/ClassMethods.html +79 -72
- data/doc/Lazier/Version.html +10 -6
- data/doc/_index.html +2 -2
- data/doc/file.README.html +5 -5
- data/doc/index.html +5 -5
- data/doc/top-level-namespace.html +2 -2
- data/lib/lazier/version.rb +1 -1
- data/spec/{cowtech-extensions → lazier}/boolean_spec.rb +0 -0
- data/spec/{cowtech-extensions → lazier}/datetime_spec.rb +0 -0
- data/spec/{cowtech-extensions → lazier}/hash_spec.rb +0 -0
- data/spec/{cowtech-extensions → lazier}/math_spec.rb +0 -0
- data/spec/{cowtech-extensions → lazier}/object_spec.rb +0 -0
- data/spec/{cowtech-extensions → lazier}/pathname_spec.rb +0 -0
- data/spec/{cowtech-extensions → lazier}/settings_spec.rb +0 -0
- data/spec/{cowtech-extensions → lazier}/string_spec.rb +0 -0
- metadata +20 -20
data/doc/Lazier.html
CHANGED
@@ -251,9 +251,10 @@ Licensed under the MIT license, which can be found at <a href="http://www.openso
|
|
251
251
|
<td>
|
252
252
|
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 30</span>
|
253
253
|
|
254
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='
|
255
|
-
<span class='
|
256
|
-
<span class='kw'>end</span
|
254
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_is_ruby_18? fid id'>is_ruby_18?</span>
|
255
|
+
<span class='rubyid_RUBY_VERSION constant id'>RUBY_VERSION</span> <span class='match op'>=~</span> <span class='regexp val'>/^1\.8/</span>
|
256
|
+
<span class='rubyid_end end kw'>end</span>
|
257
|
+
</pre>
|
257
258
|
</td>
|
258
259
|
</tr>
|
259
260
|
</table>
|
@@ -406,81 +407,82 @@ Licensed under the MIT license, which can be found at <a href="http://www.openso
|
|
406
407
|
<td>
|
407
408
|
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 52</span>
|
408
409
|
|
409
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='
|
410
|
-
<span class='
|
411
|
-
<span class='
|
412
|
-
|
413
|
-
<span class='comment'># Dependency resolving
|
414
|
-
|
415
|
-
<span class='
|
416
|
-
<span class='
|
417
|
-
|
418
|
-
<span class='kw'>if</span> <span class='
|
419
|
-
<span class='op'>::</span><span class='
|
420
|
-
<span class='
|
421
|
-
<span class='kw'>end</span>
|
422
|
-
<span class='kw'>end</span>
|
423
|
-
|
424
|
-
<span class='kw'>if</span> <span class='
|
425
|
-
<span class='op'>::</span><span class='
|
426
|
-
<span class='
|
427
|
-
<span class='
|
428
|
-
<span class='kw'>end</span>
|
429
|
-
|
430
|
-
<span class='op'>::</span><span class='
|
431
|
-
<span class='
|
432
|
-
<span class='
|
433
|
-
<span class='kw'>end</span>
|
434
|
-
<span class='kw'>end</span>
|
435
|
-
|
436
|
-
<span class='kw'>if</span> <span class='
|
437
|
-
<span class='op'>::</span><span class='
|
438
|
-
<span class='
|
439
|
-
<span class='kw'>end</span>
|
440
|
-
<span class='kw'>end</span>
|
441
|
-
|
442
|
-
<span class='kw'>if</span> <span class='
|
443
|
-
<span class='op'>::</span><span class='
|
444
|
-
<span class='
|
445
|
-
<span class='kw'>end</span>
|
446
|
-
<span class='kw'>end</span>
|
447
|
-
|
448
|
-
<span class='kw'>if</span> <span class='
|
449
|
-
<span class='op'>::</span><span class='
|
450
|
-
<span class='
|
451
|
-
<span class='kw'>end</span>
|
452
|
-
|
453
|
-
<span class='op'>::</span><span class='
|
454
|
-
<span class='
|
455
|
-
<span class='kw'>end</span>
|
456
|
-
|
457
|
-
<span class='op'>::</span><span class='
|
458
|
-
<span class='
|
459
|
-
<span class='kw'>end</span>
|
460
|
-
|
461
|
-
<span class='op'>::</span><span class='
|
462
|
-
<span class='
|
463
|
-
<span class='kw'>end</span>
|
464
|
-
<span class='kw'>end</span>
|
465
|
-
|
466
|
-
<span class='kw'>if</span> <span class='
|
467
|
-
<span class='op'>::</span><span class='
|
468
|
-
<span class='
|
469
|
-
<span class='kw'>end</span>
|
470
|
-
<span class='kw'>end</span>
|
471
|
-
|
472
|
-
<span class='kw'>if</span> <span class='
|
473
|
-
<span class='
|
474
|
-
|
475
|
-
<span class='op'>::</span><span class='
|
476
|
-
<span class='
|
477
|
-
<span class='kw'>end</span>
|
478
|
-
<span class='kw'>end</span>
|
479
|
-
|
480
|
-
<span class='kw'>yield</span> <span class='kw'>if</span> <span class='
|
481
|
-
|
482
|
-
<span class='op'>::</span><span class='
|
483
|
-
<span class='kw'>end</span
|
410
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_load! fid id'>load!</span><span class='lparen token'>(</span><span class='mult op'>*</span><span class='rubyid_what identifier id'>what</span><span class='rparen token'>)</span>
|
411
|
+
<span class='rubyid_what identifier id'>what</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='string val'>"object"</span><span class='comma token'>,</span> <span class='string val'>"boolean"</span><span class='comma token'>,</span> <span class='string val'>"string"</span><span class='comma token'>,</span> <span class='string val'>"hash"</span><span class='comma token'>,</span> <span class='string val'>"datetime"</span><span class='comma token'>,</span> <span class='string val'>"math"</span><span class='comma token'>,</span> <span class='string val'>"pathname"</span><span class='rbrack token'>]</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_what identifier id'>what</span><span class='dot token'>.</span><span class='rubyid_count identifier id'>count</span> <span class='eq op'>==</span> <span class='integer val'>0</span>
|
412
|
+
<span class='rubyid_what identifier id'>what</span><span class='dot token'>.</span><span class='rubyid_collect! fid id'>collect!</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='rubyid_w identifier id'>w</span><span class='bitor op'>|</span> <span class='rubyid_w identifier id'>w</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span> <span class='rbrace token'>}</span>
|
413
|
+
|
414
|
+
<span class='comment val'># Dependency resolving</span>
|
415
|
+
<span class='rubyid_what identifier id'>what</span> <span class='lshft op'><<</span> <span class='string val'>"object"</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_what identifier id'>what</span><span class='dot token'>.</span><span class='rubyid_include? fid id'>include?</span><span class='lparen token'>(</span><span class='string val'>"datetime"</span><span class='rparen token'>)</span>
|
416
|
+
<span class='rubyid_what identifier id'>what</span> <span class='lshft op'><<</span> <span class='string val'>"object"</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_what identifier id'>what</span><span class='dot token'>.</span><span class='rubyid_include? fid id'>include?</span><span class='lparen token'>(</span><span class='string val'>"math"</span><span class='rparen token'>)</span>
|
417
|
+
<span class='rubyid_what identifier id'>what</span><span class='dot token'>.</span><span class='rubyid_compact identifier id'>compact</span><span class='dot token'>.</span><span class='rubyid_uniq! fid id'>uniq!</span>
|
418
|
+
|
419
|
+
<span class='rubyid_if if kw'>if</span> <span class='rubyid_what identifier id'>what</span><span class='dot token'>.</span><span class='rubyid_include? fid id'>include?</span><span class='lparen token'>(</span><span class='string val'>"object"</span><span class='rparen token'>)</span> <span class='rubyid_then then kw'>then</span>
|
420
|
+
<span class='colon3 op'>::</span><span class='rubyid_Object constant id'>Object</span><span class='dot token'>.</span><span class='rubyid_class_eval identifier id'>class_eval</span> <span class='rubyid_do do kw'>do</span>
|
421
|
+
<span class='rubyid_include identifier id'>include</span> <span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='colon2 op'>::</span><span class='rubyid_Object constant id'>Object</span>
|
422
|
+
<span class='rubyid_end end kw'>end</span>
|
423
|
+
<span class='rubyid_end end kw'>end</span>
|
424
|
+
|
425
|
+
<span class='rubyid_if if kw'>if</span> <span class='rubyid_what identifier id'>what</span><span class='dot token'>.</span><span class='rubyid_include? fid id'>include?</span><span class='lparen token'>(</span><span class='string val'>"boolean"</span><span class='rparen token'>)</span> <span class='rubyid_then then kw'>then</span>
|
426
|
+
<span class='colon3 op'>::</span><span class='rubyid_TrueClass constant id'>TrueClass</span><span class='dot token'>.</span><span class='rubyid_class_eval identifier id'>class_eval</span> <span class='rubyid_do do kw'>do</span>
|
427
|
+
<span class='rubyid_include identifier id'>include</span> <span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='colon2 op'>::</span><span class='rubyid_Object constant id'>Object</span>
|
428
|
+
<span class='rubyid_include identifier id'>include</span> <span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='colon2 op'>::</span><span class='rubyid_Boolean constant id'>Boolean</span>
|
429
|
+
<span class='rubyid_end end kw'>end</span>
|
430
|
+
|
431
|
+
<span class='colon3 op'>::</span><span class='rubyid_FalseClass constant id'>FalseClass</span><span class='dot token'>.</span><span class='rubyid_class_eval identifier id'>class_eval</span> <span class='rubyid_do do kw'>do</span>
|
432
|
+
<span class='rubyid_include identifier id'>include</span> <span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='colon2 op'>::</span><span class='rubyid_Object constant id'>Object</span>
|
433
|
+
<span class='rubyid_include identifier id'>include</span> <span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='colon2 op'>::</span><span class='rubyid_Boolean constant id'>Boolean</span>
|
434
|
+
<span class='rubyid_end end kw'>end</span>
|
435
|
+
<span class='rubyid_end end kw'>end</span>
|
436
|
+
|
437
|
+
<span class='rubyid_if if kw'>if</span> <span class='rubyid_what identifier id'>what</span><span class='dot token'>.</span><span class='rubyid_include? fid id'>include?</span><span class='lparen token'>(</span><span class='string val'>"string"</span><span class='rparen token'>)</span> <span class='rubyid_then then kw'>then</span>
|
438
|
+
<span class='colon3 op'>::</span><span class='rubyid_String constant id'>String</span><span class='dot token'>.</span><span class='rubyid_class_eval identifier id'>class_eval</span> <span class='rubyid_do do kw'>do</span>
|
439
|
+
<span class='rubyid_include identifier id'>include</span> <span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='colon2 op'>::</span><span class='rubyid_String constant id'>String</span>
|
440
|
+
<span class='rubyid_end end kw'>end</span>
|
441
|
+
<span class='rubyid_end end kw'>end</span>
|
442
|
+
|
443
|
+
<span class='rubyid_if if kw'>if</span> <span class='rubyid_what identifier id'>what</span><span class='dot token'>.</span><span class='rubyid_include? fid id'>include?</span><span class='lparen token'>(</span><span class='string val'>"hash"</span><span class='rparen token'>)</span> <span class='rubyid_then then kw'>then</span>
|
444
|
+
<span class='colon3 op'>::</span><span class='rubyid_Hash constant id'>Hash</span><span class='dot token'>.</span><span class='rubyid_class_eval identifier id'>class_eval</span> <span class='rubyid_do do kw'>do</span>
|
445
|
+
<span class='rubyid_include identifier id'>include</span> <span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='colon2 op'>::</span><span class='rubyid_Hash constant id'>Hash</span>
|
446
|
+
<span class='rubyid_end end kw'>end</span>
|
447
|
+
<span class='rubyid_end end kw'>end</span>
|
448
|
+
|
449
|
+
<span class='rubyid_if if kw'>if</span> <span class='rubyid_what identifier id'>what</span><span class='dot token'>.</span><span class='rubyid_include? fid id'>include?</span><span class='lparen token'>(</span><span class='string val'>"datetime"</span><span class='rparen token'>)</span> <span class='rubyid_then then kw'>then</span>
|
450
|
+
<span class='colon3 op'>::</span><span class='rubyid_Time constant id'>Time</span><span class='dot token'>.</span><span class='rubyid_class_eval identifier id'>class_eval</span> <span class='rubyid_do do kw'>do</span>
|
451
|
+
<span class='rubyid_include identifier id'>include</span> <span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='colon2 op'>::</span><span class='rubyid_DateTime constant id'>DateTime</span>
|
452
|
+
<span class='rubyid_end end kw'>end</span>
|
453
|
+
|
454
|
+
<span class='colon3 op'>::</span><span class='rubyid_Date constant id'>Date</span><span class='dot token'>.</span><span class='rubyid_class_eval identifier id'>class_eval</span> <span class='rubyid_do do kw'>do</span>
|
455
|
+
<span class='rubyid_include identifier id'>include</span> <span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='colon2 op'>::</span><span class='rubyid_DateTime constant id'>DateTime</span>
|
456
|
+
<span class='rubyid_end end kw'>end</span>
|
457
|
+
|
458
|
+
<span class='colon3 op'>::</span><span class='rubyid_DateTime constant id'>DateTime</span><span class='dot token'>.</span><span class='rubyid_class_eval identifier id'>class_eval</span> <span class='rubyid_do do kw'>do</span>
|
459
|
+
<span class='rubyid_include identifier id'>include</span> <span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='colon2 op'>::</span><span class='rubyid_DateTime constant id'>DateTime</span>
|
460
|
+
<span class='rubyid_end end kw'>end</span>
|
461
|
+
|
462
|
+
<span class='colon3 op'>::</span><span class='rubyid_ActiveSupport constant id'>ActiveSupport</span><span class='colon2 op'>::</span><span class='rubyid_TimeZone constant id'>TimeZone</span><span class='dot token'>.</span><span class='rubyid_class_eval identifier id'>class_eval</span> <span class='rubyid_do do kw'>do</span>
|
463
|
+
<span class='rubyid_include identifier id'>include</span> <span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='colon2 op'>::</span><span class='rubyid_TimeZone constant id'>TimeZone</span>
|
464
|
+
<span class='rubyid_end end kw'>end</span>
|
465
|
+
<span class='rubyid_end end kw'>end</span>
|
466
|
+
|
467
|
+
<span class='rubyid_if if kw'>if</span> <span class='rubyid_what identifier id'>what</span><span class='dot token'>.</span><span class='rubyid_include? fid id'>include?</span><span class='lparen token'>(</span><span class='string val'>"math"</span><span class='rparen token'>)</span> <span class='rubyid_then then kw'>then</span>
|
468
|
+
<span class='colon3 op'>::</span><span class='rubyid_Math constant id'>Math</span><span class='dot token'>.</span><span class='rubyid_class_eval identifier id'>class_eval</span> <span class='rubyid_do do kw'>do</span>
|
469
|
+
<span class='rubyid_include identifier id'>include</span> <span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='colon2 op'>::</span><span class='rubyid_Math constant id'>Math</span>
|
470
|
+
<span class='rubyid_end end kw'>end</span>
|
471
|
+
<span class='rubyid_end end kw'>end</span>
|
472
|
+
|
473
|
+
<span class='rubyid_if if kw'>if</span> <span class='rubyid_what identifier id'>what</span><span class='dot token'>.</span><span class='rubyid_include? fid id'>include?</span><span class='lparen token'>(</span><span class='string val'>"pathname"</span><span class='rparen token'>)</span> <span class='rubyid_then then kw'>then</span>
|
474
|
+
<span class='rubyid_require identifier id'>require</span> <span class='string val'>"pathname"</span>
|
475
|
+
|
476
|
+
<span class='colon3 op'>::</span><span class='rubyid_Pathname constant id'>Pathname</span><span class='dot token'>.</span><span class='rubyid_class_eval identifier id'>class_eval</span> <span class='rubyid_do do kw'>do</span>
|
477
|
+
<span class='rubyid_include identifier id'>include</span> <span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='colon2 op'>::</span><span class='rubyid_Pathname constant id'>Pathname</span>
|
478
|
+
<span class='rubyid_end end kw'>end</span>
|
479
|
+
<span class='rubyid_end end kw'>end</span>
|
480
|
+
|
481
|
+
<span class='rubyid_yield yield kw'>yield</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_block_given? fid id'>block_given?</span>
|
482
|
+
|
483
|
+
<span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='colon2 op'>::</span><span class='rubyid_Settings constant id'>Settings</span><span class='dot token'>.</span><span class='rubyid_instance identifier id'>instance</span>
|
484
|
+
<span class='rubyid_end end kw'>end</span>
|
485
|
+
</pre>
|
484
486
|
</td>
|
485
487
|
</tr>
|
486
488
|
</table>
|
@@ -535,9 +537,10 @@ Licensed under the MIT license, which can be found at <a href="http://www.openso
|
|
535
537
|
<td>
|
536
538
|
<pre class="code"><span class="info file"># File 'lib/lazier.rb', line 37</span>
|
537
539
|
|
538
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='
|
539
|
-
<span class='op'>::</span><span class='
|
540
|
-
<span class='kw'>end</span
|
540
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_settings identifier id'>settings</span>
|
541
|
+
<span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='colon2 op'>::</span><span class='rubyid_Settings constant id'>Settings</span><span class='dot token'>.</span><span class='rubyid_instance identifier id'>instance</span>
|
542
|
+
<span class='rubyid_end end kw'>end</span>
|
543
|
+
</pre>
|
541
544
|
</td>
|
542
545
|
</tr>
|
543
546
|
</table>
|
@@ -548,9 +551,9 @@ Licensed under the MIT license, which can be found at <a href="http://www.openso
|
|
548
551
|
</div>
|
549
552
|
|
550
553
|
<div id="footer">
|
551
|
-
Generated on
|
554
|
+
Generated on Wed Aug 22 16:33:55 2012 by
|
552
555
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
553
|
-
0.8.2.1 (ruby-1.
|
556
|
+
0.8.2.1 (ruby-1.8.7).
|
554
557
|
</div>
|
555
558
|
|
556
559
|
</body>
|
data/doc/Lazier/Boolean.html
CHANGED
@@ -218,9 +218,10 @@
|
|
218
218
|
<td>
|
219
219
|
<pre class="code"><span class="info file"># File 'lib/lazier/boolean.rb', line 15</span>
|
220
220
|
|
221
|
-
<span class='kw'>def</span> <span class='
|
222
|
-
<span class='lparen'>(</span><span class='kw'>self</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='
|
223
|
-
<span class='kw'>end</span
|
221
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_to_i identifier id'>to_i</span>
|
222
|
+
<span class='lparen token'>(</span><span class='rubyid_self self kw'>self</span> <span class='eq op'>==</span> <span class='rubyid_true true kw'>true</span><span class='rparen token'>)</span> <span class='question op'>?</span> <span class='integer val'>1</span> <span class='colon op'>:</span> <span class='integer val'>0</span>
|
223
|
+
<span class='rubyid_end end kw'>end</span>
|
224
|
+
</pre>
|
224
225
|
</td>
|
225
226
|
</tr>
|
226
227
|
</table>
|
@@ -275,9 +276,10 @@
|
|
275
276
|
<td>
|
276
277
|
<pre class="code"><span class="info file"># File 'lib/lazier/boolean.rb', line 22</span>
|
277
278
|
|
278
|
-
<span class='kw'>def</span> <span class='
|
279
|
-
<span class='kw'>self</span>
|
280
|
-
<span class='kw'>end</span
|
279
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_value identifier id'>value</span>
|
280
|
+
<span class='rubyid_self self kw'>self</span>
|
281
|
+
<span class='rubyid_end end kw'>end</span>
|
282
|
+
</pre>
|
281
283
|
</td>
|
282
284
|
</tr>
|
283
285
|
</table>
|
@@ -288,9 +290,9 @@
|
|
288
290
|
</div>
|
289
291
|
|
290
292
|
<div id="footer">
|
291
|
-
Generated on
|
293
|
+
Generated on Wed Aug 22 16:33:56 2012 by
|
292
294
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
293
|
-
0.8.2.1 (ruby-1.
|
295
|
+
0.8.2.1 (ruby-1.8.7).
|
294
296
|
</div>
|
295
297
|
|
296
298
|
</body>
|
data/doc/Lazier/DateTime.html
CHANGED
@@ -284,9 +284,9 @@
|
|
284
284
|
<div class="discussion">
|
285
285
|
<p>Returns the number of months passed between the beginning of the base year and the current date.</p>
|
286
286
|
|
287
|
-
<pre class="code ruby"><code><span class='
|
288
|
-
<span class='comment'># => 18
|
289
|
-
</
|
287
|
+
<pre class="code ruby"><code><span class='rubyid_DateTime constant id'>DateTime</span><span class='dot token'>.</span><span class='rubyid_civil identifier id'>civil</span><span class='lparen token'>(</span><span class='integer val'>2012</span><span class='comma token'>,</span> <span class='integer val'>6</span><span class='comma token'>,</span> <span class='integer val'>1</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_in_months identifier id'>in_months</span><span class='lparen token'>(</span><span class='integer val'>2011</span><span class='rparen token'>)</span>
|
288
|
+
<span class='comment val'># => 18</span>
|
289
|
+
</code></pre>
|
290
290
|
|
291
291
|
|
292
292
|
</div>
|
@@ -346,10 +346,11 @@
|
|
346
346
|
<td>
|
347
347
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 193</span>
|
348
348
|
|
349
|
-
<span class='kw'>def</span> <span class='
|
350
|
-
<span class='
|
351
|
-
<span class='lparen'>(</span><span class='lparen'>(</span><span class='kw'>self</span><span class='
|
352
|
-
<span class='kw'>end</span
|
349
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_in_months identifier id'>in_months</span><span class='lparen token'>(</span><span class='rubyid_base identifier id'>base</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span><span class='rparen token'>)</span>
|
350
|
+
<span class='rubyid_base identifier id'>base</span> <span class='opasgn op'>||=</span> <span class='colon3 op'>::</span><span class='rubyid_Date constant id'>Date</span><span class='dot token'>.</span><span class='rubyid_today identifier id'>today</span><span class='dot token'>.</span><span class='rubyid_year identifier id'>year</span>
|
351
|
+
<span class='lparen token'>(</span><span class='lparen token'>(</span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_year identifier id'>year</span><span class='rparen token'>)</span> <span class='minus op'>-</span> <span class='rubyid_base identifier id'>base</span><span class='rparen token'>)</span> <span class='mult op'>*</span> <span class='integer val'>12</span> <span class='plus op'>+</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_month identifier id'>month</span>
|
352
|
+
<span class='rubyid_end end kw'>end</span>
|
353
|
+
</pre>
|
353
354
|
</td>
|
354
355
|
</tr>
|
355
356
|
</table>
|
@@ -432,9 +433,10 @@
|
|
432
433
|
<td>
|
433
434
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 254</span>
|
434
435
|
|
435
|
-
<span class='kw'>def</span> <span class='
|
436
|
-
<span class='lparen'>(</span><span class='kw'>self</span><span class='
|
437
|
-
<span class='kw'>end</span
|
436
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_local_lstrftime identifier id'>local_lstrftime</span><span class='lparen token'>(</span><span class='rubyid_format identifier id'>format</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span><span class='rparen token'>)</span>
|
437
|
+
<span class='lparen token'>(</span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_respond_to? fid id'>respond_to?</span><span class='lparen token'>(</span><span class='symbol val'>:in_time_zone</span><span class='rparen token'>)</span> <span class='question op'>?</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_in_time_zone identifier id'>in_time_zone</span> <span class='colon op'>:</span> <span class='rubyid_self self kw'>self</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_lstrftime identifier id'>lstrftime</span><span class='lparen token'>(</span><span class='rubyid_format identifier id'>format</span><span class='rparen token'>)</span>
|
438
|
+
<span class='rubyid_end end kw'>end</span>
|
439
|
+
</pre>
|
438
440
|
</td>
|
439
441
|
</tr>
|
440
442
|
</table>
|
@@ -510,9 +512,10 @@
|
|
510
512
|
<td>
|
511
513
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 245</span>
|
512
514
|
|
513
|
-
<span class='kw'>def</span> <span class='
|
514
|
-
<span class='lparen'>(</span><span class='kw'>self</span><span class='
|
515
|
-
<span class='kw'>end</span
|
515
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_local_strftime identifier id'>local_strftime</span><span class='lparen token'>(</span><span class='rubyid_format identifier id'>format</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span><span class='rparen token'>)</span>
|
516
|
+
<span class='lparen token'>(</span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_respond_to? fid id'>respond_to?</span><span class='lparen token'>(</span><span class='symbol val'>:in_time_zone</span><span class='rparen token'>)</span> <span class='question op'>?</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_in_time_zone identifier id'>in_time_zone</span> <span class='colon op'>:</span> <span class='rubyid_self self kw'>self</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_strftime identifier id'>strftime</span><span class='lparen token'>(</span><span class='colon3 op'>::</span><span class='rubyid_DateTime constant id'>DateTime</span><span class='dot token'>.</span><span class='rubyid_custom_format identifier id'>custom_format</span><span class='lparen token'>(</span><span class='rubyid_format identifier id'>format</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
|
517
|
+
<span class='rubyid_end end kw'>end</span>
|
518
|
+
</pre>
|
516
519
|
</td>
|
517
520
|
</tr>
|
518
521
|
</table>
|
@@ -622,36 +625,37 @@
|
|
622
625
|
<td>
|
623
626
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 210</span>
|
624
627
|
|
625
|
-
<span class='kw'>def</span> <span class='
|
626
|
-
<span class='
|
627
|
-
<span class='
|
628
|
-
|
629
|
-
<span class='
|
630
|
-
<span class='
|
631
|
-
|
632
|
-
<span class='comment'># Handling of %z is to fix ruby 1.8 bug in OSX: http://bugs.ruby-lang.org/issues/2396
|
633
|
-
|
634
|
-
<span class='kw'>case</span> <span class='
|
635
|
-
<span class='kw'>when</span> <span class='
|
636
|
-
<span class='
|
637
|
-
<span class='kw'>when</span> <span class='
|
638
|
-
<span class='
|
639
|
-
<span class='kw'>when</span> <span class='
|
640
|
-
<span class='
|
641
|
-
<span class='kw'>when</span> <span class='
|
642
|
-
<span class='
|
643
|
-
<span class='kw'>when</span> <span class='
|
644
|
-
<span class='
|
645
|
-
<span class='kw'>when</span> <span class='
|
646
|
-
<span class='
|
647
|
-
<span class='kw'>end</span>
|
648
|
-
<span class='kw'>end</span>
|
649
|
-
|
650
|
-
<span class='
|
651
|
-
<span class='kw'>end</span>
|
652
|
-
|
653
|
-
<span class='kw'>self</span><span class='
|
654
|
-
<span class='kw'>end</span
|
628
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_lstrftime identifier id'>lstrftime</span><span class='lparen token'>(</span><span class='rubyid_format identifier id'>format</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span><span class='rparen token'>)</span>
|
629
|
+
<span class='rubyid_rv identifier id'>rv</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span>
|
630
|
+
<span class='rubyid_names identifier id'>names</span> <span class='assign token'>=</span> <span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='dot token'>.</span><span class='rubyid_settings identifier id'>settings</span><span class='dot token'>.</span><span class='rubyid_date_names identifier id'>date_names</span>
|
631
|
+
|
632
|
+
<span class='rubyid_final_format identifier id'>final_format</span> <span class='assign token'>=</span> <span class='colon3 op'>::</span><span class='rubyid_DateTime constant id'>DateTime</span><span class='dot token'>.</span><span class='rubyid_custom_format identifier id'>custom_format</span><span class='lparen token'>(</span><span class='rubyid_format identifier id'>format</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_ensure_string identifier id'>ensure_string</span><span class='dot token'>.</span><span class='rubyid_gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='regexp val'>/(%{1,2}:?[abz])/i</span><span class='rparen token'>)</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_match identifier id'>match</span><span class='bitor op'>|</span>
|
633
|
+
<span class='rubyid_mrv identifier id'>mrv</span> <span class='assign token'>=</span> <span class='rubyid_match identifier id'>match</span>
|
634
|
+
|
635
|
+
<span class='comment val'># Handling of %z is to fix ruby 1.8 bug in OSX: http://bugs.ruby-lang.org/issues/2396</span>
|
636
|
+
<span class='rubyid_if if kw'>if</span> <span class='rubyid_match identifier id'>match</span> <span class='nmatch op'>!~</span> <span class='regexp val'>/^%%/</span> <span class='rubyid_then then kw'>then</span>
|
637
|
+
<span class='rubyid_case case kw'>case</span> <span class='rubyid_match identifier id'>match</span>
|
638
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"%a"</span>
|
639
|
+
<span class='rubyid_mrv identifier id'>mrv</span> <span class='assign token'>=</span> <span class='rubyid_names identifier id'>names</span><span class='lbrack token'>[</span><span class='symbol val'>:short_days</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_wday identifier id'>wday</span><span class='rbrack token'>]</span>
|
640
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"%A"</span>
|
641
|
+
<span class='rubyid_mrv identifier id'>mrv</span> <span class='assign token'>=</span> <span class='rubyid_names identifier id'>names</span><span class='lbrack token'>[</span><span class='symbol val'>:long_days</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_wday identifier id'>wday</span><span class='rbrack token'>]</span>
|
642
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"%b"</span>
|
643
|
+
<span class='rubyid_mrv identifier id'>mrv</span> <span class='assign token'>=</span> <span class='rubyid_names identifier id'>names</span><span class='lbrack token'>[</span><span class='symbol val'>:short_months</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_month identifier id'>month</span> <span class='minus op'>-</span> <span class='integer val'>1</span><span class='rbrack token'>]</span>
|
644
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"%B"</span>
|
645
|
+
<span class='rubyid_mrv identifier id'>mrv</span> <span class='assign token'>=</span> <span class='rubyid_names identifier id'>names</span><span class='lbrack token'>[</span><span class='symbol val'>:long_months</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_month identifier id'>month</span> <span class='minus op'>-</span> <span class='integer val'>1</span><span class='rbrack token'>]</span>
|
646
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"%z"</span>
|
647
|
+
<span class='rubyid_mrv identifier id'>mrv</span> <span class='assign token'>=</span> <span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='dot token'>.</span><span class='rubyid_is_ruby_18? fid id'>is_ruby_18?</span> <span class='integer val'>? </span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_formatted_offset identifier id'>formatted_offset</span><span class='lparen token'>(</span><span class='rubyid_false false kw'>false</span><span class='rparen token'>)</span> <span class='colon op'>:</span> <span class='rubyid_nil nil kw'>nil</span>
|
648
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"%:z"</span>
|
649
|
+
<span class='rubyid_mrv identifier id'>mrv</span> <span class='assign token'>=</span> <span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='dot token'>.</span><span class='rubyid_is_ruby_18? fid id'>is_ruby_18?</span> <span class='integer val'>? </span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_formatted_offset identifier id'>formatted_offset</span><span class='lparen token'>(</span><span class='rubyid_true true kw'>true</span><span class='rparen token'>)</span> <span class='colon op'>:</span> <span class='rubyid_nil nil kw'>nil</span>
|
650
|
+
<span class='rubyid_end end kw'>end</span>
|
651
|
+
<span class='rubyid_end end kw'>end</span>
|
652
|
+
|
653
|
+
<span class='rubyid_mrv identifier id'>mrv</span> <span class='integer val'>? </span><span class='rubyid_mrv identifier id'>mrv</span><span class='dot token'>.</span><span class='rubyid_sub identifier id'>sub</span><span class='lparen token'>(</span><span class='string val'>"%"</span><span class='comma token'>,</span> <span class='string val'>"%%"</span><span class='rparen token'>)</span> <span class='colon op'>:</span> <span class='rubyid_match identifier id'>match</span>
|
654
|
+
<span class='rubyid_end end kw'>end</span>
|
655
|
+
|
656
|
+
<span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_strftime identifier id'>strftime</span><span class='lparen token'>(</span><span class='rubyid_final_format identifier id'>final_format</span><span class='rparen token'>)</span>
|
657
|
+
<span class='rubyid_end end kw'>end</span>
|
658
|
+
</pre>
|
655
659
|
</td>
|
656
660
|
</tr>
|
657
661
|
</table>
|
@@ -706,9 +710,10 @@
|
|
706
710
|
<td>
|
707
711
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 201</span>
|
708
712
|
|
709
|
-
<span class='kw'>def</span> <span class='
|
710
|
-
<span class='kw'>self</span><span class='
|
711
|
-
<span class='kw'>end</span
|
713
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_padded_month identifier id'>padded_month</span>
|
714
|
+
<span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_month identifier id'>month</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span><span class='dot token'>.</span><span class='rubyid_rjust identifier id'>rjust</span><span class='lparen token'>(</span><span class='integer val'>2</span><span class='comma token'>,</span> <span class='string val'>"0"</span><span class='rparen token'>)</span>
|
715
|
+
<span class='rubyid_end end kw'>end</span>
|
716
|
+
</pre>
|
712
717
|
</td>
|
713
718
|
</tr>
|
714
719
|
</table>
|
@@ -764,10 +769,11 @@
|
|
764
769
|
<td>
|
765
770
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 179</span>
|
766
771
|
|
767
|
-
<span class='kw'>def</span> <span class='
|
768
|
-
<span class='
|
769
|
-
<span class='op'>::</span><span class='
|
770
|
-
<span class='kw'>end</span
|
772
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_utc_time identifier id'>utc_time</span>
|
773
|
+
<span class='rubyid_ua identifier id'>ua</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_respond_to? fid id'>respond_to?</span><span class='lparen token'>(</span><span class='symbol val'>:utc</span><span class='rparen token'>)</span> <span class='question op'>?</span> <span class='rubyid_self self kw'>self</span> <span class='colon op'>:</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_to_datetime identifier id'>to_datetime</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_utc identifier id'>utc</span>
|
774
|
+
<span class='colon3 op'>::</span><span class='rubyid_Time constant id'>Time</span><span class='dot token'>.</span><span class='rubyid_utc identifier id'>utc</span><span class='lparen token'>(</span><span class='rubyid_ua identifier id'>ua</span><span class='dot token'>.</span><span class='rubyid_year identifier id'>year</span><span class='comma token'>,</span> <span class='rubyid_ua identifier id'>ua</span><span class='dot token'>.</span><span class='rubyid_month identifier id'>month</span><span class='comma token'>,</span> <span class='rubyid_ua identifier id'>ua</span><span class='dot token'>.</span><span class='rubyid_day identifier id'>day</span><span class='comma token'>,</span> <span class='rubyid_ua identifier id'>ua</span><span class='dot token'>.</span><span class='rubyid_hour identifier id'>hour</span><span class='comma token'>,</span> <span class='rubyid_ua identifier id'>ua</span><span class='dot token'>.</span><span class='rubyid_min identifier id'>min</span><span class='comma token'>,</span> <span class='rubyid_ua identifier id'>ua</span><span class='dot token'>.</span><span class='rubyid_sec identifier id'>sec</span><span class='rparen token'>)</span>
|
775
|
+
<span class='rubyid_end end kw'>end</span>
|
776
|
+
</pre>
|
771
777
|
</td>
|
772
778
|
</tr>
|
773
779
|
</table>
|
@@ -778,9 +784,9 @@
|
|
778
784
|
</div>
|
779
785
|
|
780
786
|
<div id="footer">
|
781
|
-
Generated on
|
787
|
+
Generated on Wed Aug 22 16:33:56 2012 by
|
782
788
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
783
|
-
0.8.2.1 (ruby-1.
|
789
|
+
0.8.2.1 (ruby-1.8.7).
|
784
790
|
</div>
|
785
791
|
|
786
792
|
</body>
|
@@ -469,9 +469,10 @@
|
|
469
469
|
<td>
|
470
470
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 151</span>
|
471
471
|
|
472
|
-
<span class='kw'>def</span> <span class='
|
473
|
-
<span class='op'>::</span><span class='
|
474
|
-
<span class='kw'>end</span
|
472
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_custom_format identifier id'>custom_format</span><span class='lparen token'>(</span><span class='rubyid_key identifier id'>key</span><span class='rparen token'>)</span>
|
473
|
+
<span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='dot token'>.</span><span class='rubyid_settings identifier id'>settings</span><span class='dot token'>.</span><span class='rubyid_date_formats identifier id'>date_formats</span><span class='dot token'>.</span><span class='rubyid_fetch identifier id'>fetch</span><span class='lparen token'>(</span><span class='rubyid_key identifier id'>key</span><span class='dot token'>.</span><span class='rubyid_to_sym identifier id'>to_sym</span><span class='comma token'>,</span> <span class='rubyid_key identifier id'>key</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_ensure_string identifier id'>ensure_string</span>
|
474
|
+
<span class='rubyid_end end kw'>end</span>
|
475
|
+
</pre>
|
475
476
|
</td>
|
476
477
|
</tr>
|
477
478
|
</table>
|
@@ -558,13 +559,14 @@
|
|
558
559
|
<td>
|
559
560
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 19</span>
|
560
561
|
|
561
|
-
<span class='kw'>def</span> <span class='
|
562
|
-
<span class='
|
563
|
-
<span class='lparen'>(</span><span class='
|
564
|
-
<span class='lbrace'>{</span><span class='symbol'>:value</span> <span class='op'
|
565
|
-
<span class='rbrace'>}</span>
|
562
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_days identifier id'>days</span><span class='lparen token'>(</span><span class='rubyid_short identifier id'>short</span> <span class='assign token'>=</span> <span class='rubyid_true true kw'>true</span><span class='rparen token'>)</span>
|
563
|
+
<span class='rubyid_days identifier id'>days</span> <span class='assign token'>=</span> <span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='dot token'>.</span><span class='rubyid_settings identifier id'>settings</span><span class='dot token'>.</span><span class='rubyid_date_names identifier id'>date_names</span><span class='lbrack token'>[</span><span class='rubyid_short identifier id'>short</span> <span class='integer val'>? </span><span class='symbol val'>:short_days</span> <span class='colon op'>:</span> <span class='symbol val'>:long_days</span><span class='rbrack token'>]</span>
|
564
|
+
<span class='lparen token'>(</span><span class='float val'>1</span><span class='dot2 op'>..</span><span class='integer val'>7</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_to_a identifier id'>to_a</span><span class='dot token'>.</span><span class='rubyid_collect identifier id'>collect</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='rubyid_i identifier id'>i</span><span class='bitor op'>|</span>
|
565
|
+
<span class='lbrace token'>{</span><span class='symbol val'>:value</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='rubyid_i identifier id'>i</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span><span class='comma token'>,</span> <span class='symbol val'>:label=</span><span class='gt op'>></span> <span class='rubyid_days identifier id'>days</span><span class='lbrack token'>[</span><span class='rubyid_i identifier id'>i</span> <span class='minus op'>-</span> <span class='integer val'>1</span><span class='rbrack token'>]</span><span class='rbrace token'>}</span>
|
566
|
+
<span class='rbrace token'>}</span>
|
566
567
|
|
567
|
-
<span class='kw'>end</span
|
568
|
+
<span class='rubyid_end end kw'>end</span>
|
569
|
+
</pre>
|
568
570
|
</td>
|
569
571
|
</tr>
|
570
572
|
</table>
|
@@ -665,27 +667,28 @@
|
|
665
667
|
<td>
|
666
668
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 124</span>
|
667
669
|
|
668
|
-
<span class='kw'>def</span> <span class='
|
669
|
-
<span class='
|
670
|
-
|
671
|
-
<span class='comment'># Compute using Anonymouse Gregorian Algorithm: http://en.wikipedia.org/wiki/Computus#Anonymous_Gregorian_algorithm
|
672
|
-
|
673
|
-
<span class='
|
674
|
-
<span class='
|
675
|
-
<span class='
|
676
|
-
<span class='
|
677
|
-
<span class='
|
678
|
-
<span class='
|
679
|
-
<span class='
|
680
|
-
<span class='
|
681
|
-
<span class='
|
682
|
-
<span class='
|
683
|
-
<span class='
|
684
|
-
|
685
|
-
<span class='
|
686
|
-
<span class='
|
687
|
-
<span class='op'>::</span><span class='
|
688
|
-
<span class='kw'>end</span
|
670
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_easter identifier id'>easter</span><span class='lparen token'>(</span><span class='rubyid_year identifier id'>year</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span><span class='rparen token'>)</span>
|
671
|
+
<span class='rubyid_year identifier id'>year</span> <span class='assign token'>=</span> <span class='colon3 op'>::</span><span class='rubyid_Date constant id'>Date</span><span class='dot token'>.</span><span class='rubyid_today identifier id'>today</span><span class='dot token'>.</span><span class='rubyid_year identifier id'>year</span> <span class='rubyid_if if_mod kw'>if</span> <span class='notop op'>!</span><span class='rubyid_year identifier id'>year</span><span class='dot token'>.</span><span class='rubyid_is_integer? fid id'>is_integer?</span>
|
672
|
+
|
673
|
+
<span class='comment val'># Compute using Anonymouse Gregorian Algorithm: http://en.wikipedia.org/wiki/Computus#Anonymous_Gregorian_algorithm</span>
|
674
|
+
<span class='rubyid_a identifier id'>a</span> <span class='assign token'>=</span> <span class='rubyid_year identifier id'>year</span> <span class='mod op'>%</span> <span class='integer val'>19</span>
|
675
|
+
<span class='rubyid_b identifier id'>b</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='rubyid_year identifier id'>year</span> <span class='div op'>/</span> <span class='float val'>100.0</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_floor identifier id'>floor</span>
|
676
|
+
<span class='rubyid_c identifier id'>c</span> <span class='assign token'>=</span> <span class='rubyid_year identifier id'>year</span> <span class='mod op'>%</span> <span class='integer val'>100</span>
|
677
|
+
<span class='rubyid_d identifier id'>d</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='rubyid_b identifier id'>b</span> <span class='div op'>/</span> <span class='float val'>4.0</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_floor identifier id'>floor</span>
|
678
|
+
<span class='rubyid_e identifier id'>e</span> <span class='assign token'>=</span> <span class='rubyid_b identifier id'>b</span> <span class='mod op'>%</span> <span class='integer val'>4</span>
|
679
|
+
<span class='rubyid_f identifier id'>f</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='lparen token'>(</span><span class='rubyid_b identifier id'>b</span> <span class='plus op'>+</span> <span class='integer val'>8</span><span class='rparen token'>)</span> <span class='div op'>/</span> <span class='float val'>25.0</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_floor identifier id'>floor</span>
|
680
|
+
<span class='rubyid_g identifier id'>g</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='lparen token'>(</span><span class='rubyid_b identifier id'>b</span> <span class='minus op'>-</span> <span class='rubyid_f identifier id'>f</span> <span class='plus op'>+</span> <span class='integer val'>1</span><span class='rparen token'>)</span> <span class='div op'>/</span> <span class='float val'>3.0</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_floor identifier id'>floor</span>
|
681
|
+
<span class='rubyid_h identifier id'>h</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='lparen token'>(</span><span class='integer val'>19</span> <span class='mult op'>*</span> <span class='rubyid_a identifier id'>a</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='rubyid_b identifier id'>b</span> <span class='minus op'>-</span> <span class='rubyid_d identifier id'>d</span> <span class='minus op'>-</span> <span class='rubyid_g identifier id'>g</span> <span class='plus op'>+</span> <span class='integer val'>15</span><span class='rparen token'>)</span> <span class='mod op'>%</span> <span class='integer val'>30</span>
|
682
|
+
<span class='rubyid_i identifier id'>i</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='rubyid_c identifier id'>c</span> <span class='div op'>/</span> <span class='float val'>4.0</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_floor identifier id'>floor</span>
|
683
|
+
<span class='rubyid_k identifier id'>k</span> <span class='assign token'>=</span> <span class='rubyid_c identifier id'>c</span> <span class='mod op'>%</span> <span class='integer val'>4</span>
|
684
|
+
<span class='rubyid_l identifier id'>l</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='integer val'>32</span> <span class='plus op'>+</span> <span class='lparen token'>(</span><span class='integer val'>2</span> <span class='mult op'>*</span> <span class='rubyid_e identifier id'>e</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='lparen token'>(</span><span class='integer val'>2</span> <span class='mult op'>*</span> <span class='rubyid_i identifier id'>i</span><span class='rparen token'>)</span> <span class='minus op'>-</span> <span class='rubyid_h identifier id'>h</span> <span class='minus op'>-</span> <span class='rubyid_k identifier id'>k</span><span class='rparen token'>)</span> <span class='mod op'>%</span> <span class='integer val'>7</span>
|
685
|
+
<span class='rubyid_m identifier id'>m</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='lparen token'>(</span><span class='rubyid_a identifier id'>a</span> <span class='plus op'>+</span> <span class='lparen token'>(</span><span class='integer val'>11</span> <span class='mult op'>*</span> <span class='rubyid_h identifier id'>h</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='lparen token'>(</span><span class='integer val'>22</span> <span class='mult op'>*</span> <span class='rubyid_l identifier id'>l</span><span class='rparen token'>)</span><span class='rparen token'>)</span> <span class='div op'>/</span> <span class='float val'>451.0</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_floor identifier id'>floor</span>
|
686
|
+
|
687
|
+
<span class='rubyid_day identifier id'>day</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='lparen token'>(</span><span class='rubyid_h identifier id'>h</span> <span class='plus op'>+</span> <span class='rubyid_l identifier id'>l</span> <span class='minus op'>-</span> <span class='lparen token'>(</span><span class='integer val'>7</span> <span class='mult op'>*</span> <span class='rubyid_m identifier id'>m</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='integer val'>114</span><span class='rparen token'>)</span> <span class='mod op'>%</span> <span class='integer val'>31</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='integer val'>1</span>
|
688
|
+
<span class='rubyid_month identifier id'>month</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='lparen token'>(</span><span class='rubyid_h identifier id'>h</span> <span class='plus op'>+</span> <span class='rubyid_l identifier id'>l</span> <span class='minus op'>-</span> <span class='lparen token'>(</span><span class='integer val'>7</span> <span class='mult op'>*</span> <span class='rubyid_m identifier id'>m</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='integer val'>114</span><span class='rparen token'>)</span> <span class='div op'>/</span> <span class='float val'>31.0</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_floor identifier id'>floor</span>
|
689
|
+
<span class='colon3 op'>::</span><span class='rubyid_Date constant id'>Date</span><span class='dot token'>.</span><span class='rubyid_civil identifier id'>civil</span><span class='lparen token'>(</span><span class='rubyid_year identifier id'>year</span><span class='comma token'>,</span> <span class='rubyid_month identifier id'>month</span><span class='comma token'>,</span> <span class='rubyid_day identifier id'>day</span><span class='rparen token'>)</span>
|
690
|
+
<span class='rubyid_end end kw'>end</span>
|
691
|
+
</pre>
|
689
692
|
</td>
|
690
693
|
</tr>
|
691
694
|
</table>
|
@@ -778,9 +781,10 @@
|
|
778
781
|
<td>
|
779
782
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 83</span>
|
780
783
|
|
781
|
-
<span class='kw'>def</span> <span class='
|
782
|
-
<span class='op'>::</span><span class='
|
783
|
-
<span class='kw'>end</span
|
784
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_find_timezone identifier id'>find_timezone</span><span class='lparen token'>(</span><span class='rubyid_name identifier id'>name</span> <span class='assign token'>=</span> <span class='rubyid_true true kw'>true</span><span class='comma token'>,</span> <span class='rubyid_dst_label identifier id'>dst_label</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span><span class='rparen token'>)</span>
|
785
|
+
<span class='colon3 op'>::</span><span class='rubyid_ActiveSupport constant id'>ActiveSupport</span><span class='colon2 op'>::</span><span class='rubyid_TimeZone constant id'>TimeZone</span><span class='dot token'>.</span><span class='rubyid_find identifier id'>find</span><span class='lparen token'>(</span><span class='rubyid_name identifier id'>name</span><span class='comma token'>,</span> <span class='rubyid_dst_label identifier id'>dst_label</span><span class='rparen token'>)</span>
|
786
|
+
<span class='rubyid_end end kw'>end</span>
|
787
|
+
</pre>
|
784
788
|
</td>
|
785
789
|
</tr>
|
786
790
|
</table>
|
@@ -888,19 +892,20 @@
|
|
888
892
|
<td>
|
889
893
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 161</span>
|
890
894
|
|
891
|
-
<span class='kw'>def</span> <span class='
|
892
|
-
<span class='
|
895
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_is_valid? fid id'>is_valid?</span><span class='lparen token'>(</span><span class='rubyid_value identifier id'>value</span><span class='comma token'>,</span> <span class='rubyid_format identifier id'>format</span> <span class='assign token'>=</span> <span class='string val'>"%F %T"</span><span class='rparen token'>)</span>
|
896
|
+
<span class='rubyid_rv identifier id'>rv</span> <span class='assign token'>=</span> <span class='rubyid_true true kw'>true</span>
|
893
897
|
|
894
|
-
<span class='
|
898
|
+
<span class='rubyid_format identifier id'>format</span> <span class='assign token'>=</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_custom_format identifier id'>custom_format</span><span class='lparen token'>(</span><span class='rubyid_format identifier id'>format</span><span class='rparen token'>)</span>
|
895
899
|
|
896
|
-
<span class='kw'>begin</span>
|
897
|
-
<span class='op'>::</span><span class='
|
898
|
-
<span class='kw'>rescue</span> <span class='op'
|
899
|
-
<span class='
|
900
|
-
<span class='kw'>end</span>
|
900
|
+
<span class='rubyid_begin begin kw'>begin</span>
|
901
|
+
<span class='colon3 op'>::</span><span class='rubyid_DateTime constant id'>DateTime</span><span class='dot token'>.</span><span class='rubyid_strptime identifier id'>strptime</span><span class='lparen token'>(</span><span class='rubyid_value identifier id'>value</span><span class='dot token'>.</span><span class='rubyid_ensure_string identifier id'>ensure_string</span><span class='comma token'>,</span> <span class='rubyid_format identifier id'>format</span><span class='rparen token'>)</span>
|
902
|
+
<span class='rubyid_rescue rescue kw'>rescue</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='rubyid_e identifier id'>e</span>
|
903
|
+
<span class='rubyid_rv identifier id'>rv</span> <span class='assign token'>=</span> <span class='rubyid_false false kw'>false</span>
|
904
|
+
<span class='rubyid_end end kw'>end</span>
|
901
905
|
|
902
|
-
<span class='
|
903
|
-
<span class='kw'>end</span
|
906
|
+
<span class='rubyid_rv identifier id'>rv</span>
|
907
|
+
<span class='rubyid_end end kw'>end</span>
|
908
|
+
</pre>
|
904
909
|
</td>
|
905
910
|
</tr>
|
906
911
|
</table>
|
@@ -993,9 +998,10 @@
|
|
993
998
|
<td>
|
994
999
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 74</span>
|
995
1000
|
|
996
|
-
<span class='kw'>def</span> <span class='
|
997
|
-
<span class='op'>::</span><span class='
|
998
|
-
<span class='kw'>end</span
|
1001
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_list_timezones identifier id'>list_timezones</span><span class='lparen token'>(</span><span class='rubyid_with_dst identifier id'>with_dst</span> <span class='assign token'>=</span> <span class='rubyid_true true kw'>true</span><span class='comma token'>,</span> <span class='rubyid_dst_label identifier id'>dst_label</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span><span class='rparen token'>)</span>
|
1002
|
+
<span class='colon3 op'>::</span><span class='rubyid_ActiveSupport constant id'>ActiveSupport</span><span class='colon2 op'>::</span><span class='rubyid_TimeZone constant id'>TimeZone</span><span class='dot token'>.</span><span class='rubyid_list_all identifier id'>list_all</span><span class='lparen token'>(</span><span class='rubyid_with_dst identifier id'>with_dst</span><span class='comma token'>,</span> <span class='rubyid_dst_label identifier id'>dst_label</span><span class='rparen token'>)</span>
|
1003
|
+
<span class='rubyid_end end kw'>end</span>
|
1004
|
+
</pre>
|
999
1005
|
</td>
|
1000
1006
|
</tr>
|
1001
1007
|
</table>
|
@@ -1081,12 +1087,13 @@
|
|
1081
1087
|
<td>
|
1082
1088
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 32</span>
|
1083
1089
|
|
1084
|
-
<span class='kw'>def</span> <span class='
|
1085
|
-
<span class='
|
1086
|
-
<span class='lparen'>(</span><span class='
|
1087
|
-
<span class='lbrace'>{</span><span class='symbol'>:value</span> <span class='op'
|
1088
|
-
<span class='rbrace'>}</span>
|
1089
|
-
<span class='kw'>end</span
|
1090
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_months identifier id'>months</span><span class='lparen token'>(</span><span class='rubyid_short identifier id'>short</span> <span class='assign token'>=</span> <span class='rubyid_true true kw'>true</span><span class='rparen token'>)</span>
|
1091
|
+
<span class='rubyid_months identifier id'>months</span> <span class='assign token'>=</span> <span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='dot token'>.</span><span class='rubyid_settings identifier id'>settings</span><span class='dot token'>.</span><span class='rubyid_date_names identifier id'>date_names</span><span class='lbrack token'>[</span><span class='rubyid_short identifier id'>short</span> <span class='integer val'>? </span><span class='symbol val'>:short_months</span> <span class='colon op'>:</span> <span class='symbol val'>:long_months</span><span class='rbrack token'>]</span>
|
1092
|
+
<span class='lparen token'>(</span><span class='float val'>1</span><span class='dot2 op'>..</span><span class='integer val'>12</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_collect identifier id'>collect</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='rubyid_i identifier id'>i</span><span class='bitor op'>|</span>
|
1093
|
+
<span class='lbrace token'>{</span><span class='symbol val'>:value</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='rubyid_i identifier id'>i</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span><span class='dot token'>.</span><span class='rubyid_rjust identifier id'>rjust</span><span class='lparen token'>(</span><span class='integer val'>2</span><span class='comma token'>,</span> <span class='string val'>"0"</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='symbol val'>:label=</span><span class='gt op'>></span> <span class='rubyid_months identifier id'>months</span><span class='dot token'>.</span><span class='rubyid_at identifier id'>at</span><span class='lparen token'>(</span><span class='rubyid_i identifier id'>i</span> <span class='minus op'>-</span> <span class='integer val'>1</span><span class='rparen token'>)</span><span class='rbrace token'>}</span>
|
1094
|
+
<span class='rbrace token'>}</span>
|
1095
|
+
<span class='rubyid_end end kw'>end</span>
|
1096
|
+
</pre>
|
1090
1097
|
</td>
|
1091
1098
|
</tr>
|
1092
1099
|
</table>
|
@@ -1105,9 +1112,9 @@
|
|
1105
1112
|
<div class="discussion">
|
1106
1113
|
<p>Returns a string representation of a timezone.</p>
|
1107
1114
|
|
1108
|
-
<pre class="code ruby"><code><span class='
|
1109
|
-
<span class='comment'># => "-0800@pacific-time-us-canada"
|
1110
|
-
</
|
1115
|
+
<pre class="code ruby"><code><span class='rubyid_DateTime constant id'>DateTime</span><span class='dot token'>.</span><span class='rubyid_parameterize_zone identifier id'>parameterize_zone</span><span class='lparen token'>(</span><span class='rubyid_ActiveSupport constant id'>ActiveSupport</span><span class='colon2 op'>::</span><span class='rubyid_TimeZone constant id'>TimeZone</span><span class='lbrack token'>[</span><span class='string val'>"Pacific Time (US & Canada)"</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
|
1116
|
+
<span class='comment val'># => "-0800@pacific-time-us-canada"</span>
|
1117
|
+
</code></pre>
|
1111
1118
|
|
1112
1119
|
|
1113
1120
|
</div>
|
@@ -1181,9 +1188,10 @@
|
|
1181
1188
|
<td>
|
1182
1189
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 96</span>
|
1183
1190
|
|
1184
|
-
<span class='kw'>def</span> <span class='
|
1185
|
-
<span class='op'>::</span><span class='
|
1186
|
-
<span class='kw'>end</span
|
1191
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_parameterize_zone identifier id'>parameterize_zone</span><span class='lparen token'>(</span><span class='rubyid_tz identifier id'>tz</span><span class='comma token'>,</span> <span class='rubyid_with_offset identifier id'>with_offset</span> <span class='assign token'>=</span> <span class='rubyid_true true kw'>true</span><span class='rparen token'>)</span>
|
1192
|
+
<span class='colon3 op'>::</span><span class='rubyid_ActiveSupport constant id'>ActiveSupport</span><span class='colon2 op'>::</span><span class='rubyid_TimeZone constant id'>TimeZone</span><span class='colon2 op'>::</span><span class='rubyid_parameterize_zone identifier id'>parameterize_zone</span><span class='lparen token'>(</span><span class='rubyid_tz identifier id'>tz</span><span class='comma token'>,</span> <span class='rubyid_with_offset identifier id'>with_offset</span><span class='rparen token'>)</span>
|
1193
|
+
<span class='rubyid_end end kw'>end</span>
|
1194
|
+
</pre>
|
1187
1195
|
</td>
|
1188
1196
|
</tr>
|
1189
1197
|
</table>
|
@@ -1257,9 +1265,10 @@
|
|
1257
1265
|
<td>
|
1258
1266
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 115</span>
|
1259
1267
|
|
1260
|
-
<span class='kw'>def</span> <span class='
|
1261
|
-
<span class='op'>::</span><span class='
|
1262
|
-
<span class='kw'>end</span
|
1268
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_rationalize_offset identifier id'>rationalize_offset</span><span class='lparen token'>(</span><span class='rubyid_offset identifier id'>offset</span><span class='rparen token'>)</span>
|
1269
|
+
<span class='colon3 op'>::</span><span class='rubyid_ActiveSupport constant id'>ActiveSupport</span><span class='colon2 op'>::</span><span class='rubyid_TimeZone constant id'>TimeZone</span><span class='dot token'>.</span><span class='rubyid_rationalize_offset identifier id'>rationalize_offset</span><span class='lparen token'>(</span><span class='rubyid_offset identifier id'>offset</span><span class='rparen token'>)</span>
|
1270
|
+
<span class='rubyid_end end kw'>end</span>
|
1271
|
+
</pre>
|
1263
1272
|
</td>
|
1264
1273
|
</tr>
|
1265
1274
|
</table>
|
@@ -1314,9 +1323,10 @@
|
|
1314
1323
|
<td>
|
1315
1324
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 65</span>
|
1316
1325
|
|
1317
|
-
<span class='kw'>def</span> <span class='
|
1318
|
-
<span class='op'>::</span><span class='
|
1319
|
-
<span class='kw'>end</span
|
1326
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_timezones identifier id'>timezones</span>
|
1327
|
+
<span class='colon3 op'>::</span><span class='rubyid_ActiveSupport constant id'>ActiveSupport</span><span class='colon2 op'>::</span><span class='rubyid_TimeZone constant id'>TimeZone</span><span class='dot token'>.</span><span class='rubyid_all identifier id'>all</span>
|
1328
|
+
<span class='rubyid_end end kw'>end</span>
|
1329
|
+
</pre>
|
1320
1330
|
</td>
|
1321
1331
|
</tr>
|
1322
1332
|
</table>
|
@@ -1431,9 +1441,10 @@
|
|
1431
1441
|
<td>
|
1432
1442
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 107</span>
|
1433
1443
|
|
1434
|
-
<span class='kw'>def</span> <span class='
|
1435
|
-
<span class='op'>::</span><span class='
|
1436
|
-
<span class='kw'>end</span
|
1444
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_unparameterize_zone identifier id'>unparameterize_zone</span><span class='lparen token'>(</span><span class='rubyid_tz identifier id'>tz</span><span class='comma token'>,</span> <span class='rubyid_as_string identifier id'>as_string</span> <span class='assign token'>=</span> <span class='rubyid_false false kw'>false</span><span class='comma token'>,</span> <span class='rubyid_dst_label identifier id'>dst_label</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span><span class='rparen token'>)</span>
|
1445
|
+
<span class='colon3 op'>::</span><span class='rubyid_ActiveSupport constant id'>ActiveSupport</span><span class='colon2 op'>::</span><span class='rubyid_TimeZone constant id'>TimeZone</span><span class='colon2 op'>::</span><span class='rubyid_unparameterize_zone identifier id'>unparameterize_zone</span><span class='lparen token'>(</span><span class='rubyid_tz identifier id'>tz</span><span class='comma token'>,</span> <span class='rubyid_as_string identifier id'>as_string</span><span class='comma token'>,</span> <span class='rubyid_dst_label identifier id'>dst_label</span><span class='rparen token'>)</span>
|
1446
|
+
<span class='rubyid_end end kw'>end</span>
|
1447
|
+
</pre>
|
1437
1448
|
</td>
|
1438
1449
|
</tr>
|
1439
1450
|
</table>
|
@@ -1452,13 +1463,13 @@
|
|
1452
1463
|
<div class="discussion">
|
1453
1464
|
<p>Returns a range of years.</p>
|
1454
1465
|
|
1455
|
-
<pre class="code ruby"><code><span class='
|
1456
|
-
<span class='comment'># => [2007, 2008, 2009, 2010]
|
1457
|
-
</
|
1466
|
+
<pre class="code ruby"><code><span class='rubyid_Date constant id'>Date</span><span class='dot token'>.</span><span class='rubyid_years identifier id'>years</span><span class='lparen token'>(</span><span class='integer val'>3</span><span class='comma token'>,</span> <span class='rubyid_false false kw'>false</span><span class='comma token'>,</span> <span class='integer val'>2010</span><span class='rparen token'>)</span>
|
1467
|
+
<span class='comment val'># => [2007, 2008, 2009, 2010]</span>
|
1468
|
+
</code></pre>
|
1458
1469
|
|
1459
|
-
<pre class="code ruby"><code><span class='
|
1460
|
-
<span class='comment'># => [{:value=>2009, :label=>2009}, {:value=>2010, :label=>2010}, {:value=>2011, :label=>2011}]
|
1461
|
-
</
|
1470
|
+
<pre class="code ruby"><code><span class='rubyid_Date constant id'>Date</span><span class='dot token'>.</span><span class='rubyid_years identifier id'>years</span><span class='lparen token'>(</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='rubyid_true true kw'>true</span><span class='comma token'>,</span> <span class='integer val'>2010</span><span class='comma token'>,</span> <span class='rubyid_true true kw'>true</span><span class='rparen token'>)</span>
|
1471
|
+
<span class='comment val'># => [{:value=>2009, :label=>2009}, {:value=>2010, :label=>2010}, {:value=>2011, :label=>2011}]</span>
|
1472
|
+
</code></pre>
|
1462
1473
|
|
1463
1474
|
|
1464
1475
|
</div>
|
@@ -1569,10 +1580,11 @@
|
|
1569
1580
|
<td>
|
1570
1581
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 57</span>
|
1571
1582
|
|
1572
|
-
<span class='kw'>def</span> <span class='
|
1573
|
-
<span class='
|
1574
|
-
<span class='lparen'>(</span><span class='
|
1575
|
-
<span class='kw'>end</span
|
1583
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_years identifier id'>years</span><span class='lparen token'>(</span><span class='rubyid_offset identifier id'>offset</span> <span class='assign token'>=</span> <span class='integer val'>10</span><span class='comma token'>,</span> <span class='rubyid_also_future identifier id'>also_future</span> <span class='assign token'>=</span> <span class='rubyid_true true kw'>true</span><span class='comma token'>,</span> <span class='rubyid_reference identifier id'>reference</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span><span class='comma token'>,</span> <span class='rubyid_as_objects identifier id'>as_objects</span> <span class='assign token'>=</span> <span class='rubyid_false false kw'>false</span><span class='rparen token'>)</span>
|
1584
|
+
<span class='rubyid_y identifier id'>y</span> <span class='assign token'>=</span> <span class='rubyid_reference identifier id'>reference</span> <span class='orop op'>||</span> <span class='colon3 op'>::</span><span class='rubyid_Date constant id'>Date</span><span class='dot token'>.</span><span class='rubyid_today identifier id'>today</span><span class='dot token'>.</span><span class='rubyid_year identifier id'>year</span>
|
1585
|
+
<span class='lparen token'>(</span><span class='rubyid_y identifier id'>y</span> <span class='minus op'>-</span> <span class='rubyid_offset identifier id'>offset</span><span class='dot2 op'>..</span><span class='lparen token'>(</span><span class='rubyid_also_future identifier id'>also_future</span> <span class='integer val'>? </span><span class='rubyid_y identifier id'>y</span> <span class='plus op'>+</span> <span class='rubyid_offset identifier id'>offset</span> <span class='colon op'>:</span> <span class='rubyid_y identifier id'>y</span><span class='rparen token'>)</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_collect identifier id'>collect</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='rubyid_year identifier id'>year</span><span class='bitor op'>|</span> <span class='rubyid_as_objects identifier id'>as_objects</span> <span class='integer val'>? </span><span class='lbrace token'>{</span><span class='symbol val'>:value</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='rubyid_year identifier id'>year</span><span class='comma token'>,</span> <span class='symbol val'>:label</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='rubyid_year identifier id'>year</span><span class='rbrace token'>}</span> <span class='colon op'>:</span> <span class='rubyid_year identifier id'>year</span> <span class='rbrace token'>}</span>
|
1586
|
+
<span class='rubyid_end end kw'>end</span>
|
1587
|
+
</pre>
|
1576
1588
|
</td>
|
1577
1589
|
</tr>
|
1578
1590
|
</table>
|
@@ -1583,9 +1595,9 @@
|
|
1583
1595
|
</div>
|
1584
1596
|
|
1585
1597
|
<div id="footer">
|
1586
|
-
Generated on
|
1598
|
+
Generated on Wed Aug 22 16:33:57 2012 by
|
1587
1599
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1588
|
-
0.8.2.1 (ruby-1.
|
1600
|
+
0.8.2.1 (ruby-1.8.7).
|
1589
1601
|
</div>
|
1590
1602
|
|
1591
1603
|
</body>
|