lazier 1.0.7 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -1
- data/README.md +5 -2
- data/doc/Lazier.html +472 -174
- data/doc/Lazier/Boolean.html +9 -11
- data/doc/Lazier/DateTime.html +59 -113
- data/doc/Lazier/DateTime/ClassMethods.html +87 -121
- data/doc/Lazier/Exceptions.html +3 -3
- data/doc/Lazier/Exceptions/Dump.html +3 -3
- data/doc/Lazier/Hash.html +17 -19
- data/doc/Lazier/Math.html +3 -3
- data/doc/Lazier/Math/ClassMethods.html +14 -48
- data/doc/Lazier/Object.html +127 -139
- data/doc/Lazier/Pathname.html +11 -12
- data/doc/Lazier/Settings.html +189 -169
- data/doc/Lazier/String.html +23 -27
- data/doc/Lazier/TimeZone.html +202 -249
- data/doc/Lazier/TimeZone/ClassMethods.html +110 -137
- data/doc/Lazier/Version.html +7 -11
- data/doc/_index.html +4 -4
- data/doc/file.README.html +12 -9
- data/doc/frames.html +1 -1
- data/doc/index.html +12 -9
- data/doc/method_list.html +72 -24
- data/doc/top-level-namespace.html +3 -3
- data/lazier.gemspec +8 -8
- data/lib/lazier.rb +55 -59
- data/lib/lazier/datetime.rb +74 -88
- data/lib/lazier/math.rb +2 -18
- data/lib/lazier/object.rb +14 -13
- data/lib/lazier/settings.rb +8 -25
- data/lib/lazier/version.rb +2 -2
- data/spec/lazier/datetime_spec.rb +12 -20
- data/spec/lazier/hash_spec.rb +1 -1
- data/spec/lazier/object_spec.rb +3 -3
- data/spec/lazier/settings_spec.rb +3 -3
- data/spec/lazier_spec.rb +1 -19
- metadata +145 -160
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Lazier::TimeZone::ClassMethods
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.3
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -355,21 +355,20 @@
|
|
355
355
|
<pre class="lines">
|
356
356
|
|
357
357
|
|
358
|
-
377
|
359
|
-
378
|
360
358
|
379
|
361
359
|
380
|
362
|
-
381
|
360
|
+
381
|
361
|
+
382
|
362
|
+
383</pre>
|
363
363
|
</td>
|
364
364
|
<td>
|
365
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
366
|
-
|
367
|
-
<span class='
|
368
|
-
<span class='
|
369
|
-
<span class='
|
370
|
-
<span class='
|
371
|
-
<span class='
|
372
|
-
</pre>
|
365
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 379</span>
|
366
|
+
|
367
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_compare'>compare</span><span class='lparen'>(</span><span class='id identifier rubyid_left'>left</span><span class='comma'>,</span> <span class='id identifier rubyid_right'>right</span><span class='rparen'>)</span>
|
368
|
+
<span class='id identifier rubyid_left'>left</span> <span class='op'>=</span> <span class='id identifier rubyid_left'>left</span><span class='period'>.</span><span class='id identifier rubyid_to_str'>to_str</span> <span class='kw'>if</span> <span class='id identifier rubyid_left'>left</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>TimeZone</span><span class='rparen'>)</span>
|
369
|
+
<span class='id identifier rubyid_right'>right</span> <span class='op'>=</span> <span class='id identifier rubyid_right'>right</span><span class='period'>.</span><span class='id identifier rubyid_to_str'>to_str</span> <span class='kw'>if</span> <span class='id identifier rubyid_right'>right</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>TimeZone</span><span class='rparen'>)</span>
|
370
|
+
<span class='id identifier rubyid_left'>left</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='int'>2</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'><=></span> <span class='id identifier rubyid_right'>right</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='int'>2</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
|
371
|
+
<span class='kw'>end</span></pre>
|
373
372
|
</td>
|
374
373
|
</tr>
|
375
374
|
</table>
|
@@ -453,33 +452,32 @@
|
|
453
452
|
<pre class="lines">
|
454
453
|
|
455
454
|
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
455
|
+
301
|
456
|
+
302
|
457
|
+
303
|
458
|
+
304
|
459
|
+
305
|
460
|
+
306
|
461
|
+
307
|
462
|
+
308
|
463
|
+
309
|
464
|
+
310
|
465
|
+
311</pre>
|
467
466
|
</td>
|
468
467
|
<td>
|
469
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
470
|
-
|
471
|
-
<span class='
|
472
|
-
<span class='
|
473
|
-
<span class='
|
474
|
-
<span class='
|
475
|
-
<span class='
|
476
|
-
<span class='
|
477
|
-
<span class='
|
478
|
-
|
479
|
-
<span class='
|
480
|
-
<span class='
|
481
|
-
<span class='
|
482
|
-
</pre>
|
468
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 301</span>
|
469
|
+
|
470
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_dst_label'>dst_label</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
471
|
+
<span class='id identifier rubyid_catch'>catch</span><span class='lparen'>(</span><span class='symbol'>:zone</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
472
|
+
<span class='op'>::</span><span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>TimeZone</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_zone'>zone</span><span class='op'>|</span>
|
473
|
+
<span class='id identifier rubyid_zone'>zone</span><span class='period'>.</span><span class='id identifier rubyid_aliases'>aliases</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_zone_alias'>zone_alias</span><span class='op'>|</span>
|
474
|
+
<span class='id identifier rubyid_throw'>throw</span><span class='lparen'>(</span><span class='symbol'>:zone</span><span class='comma'>,</span> <span class='id identifier rubyid_zone'>zone</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='lbracket'>[</span><span class='id identifier rubyid_zone'>zone</span><span class='period'>.</span><span class='id identifier rubyid_to_str'>to_str</span><span class='lparen'>(</span><span class='id identifier rubyid_zone_alias'>zone_alias</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_zone'>zone</span><span class='period'>.</span><span class='id identifier rubyid_to_str_with_dst'>to_str_with_dst</span><span class='lparen'>(</span><span class='id identifier rubyid_dst_label'>dst_label</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_zone_alias'>zone_alias</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
475
|
+
<span class='kw'>end</span>
|
476
|
+
<span class='kw'>end</span>
|
477
|
+
|
478
|
+
<span class='kw'>nil</span>
|
479
|
+
<span class='kw'>end</span>
|
480
|
+
<span class='kw'>end</span></pre>
|
483
481
|
</td>
|
484
482
|
</tr>
|
485
483
|
</table>
|
@@ -563,19 +561,18 @@
|
|
563
561
|
<pre class="lines">
|
564
562
|
|
565
563
|
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
564
|
+
291
|
565
|
+
292
|
566
|
+
293
|
567
|
+
294</pre>
|
570
568
|
</td>
|
571
569
|
<td>
|
572
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
570
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 291</span>
|
573
571
|
|
574
|
-
<span class='
|
575
|
-
<span class='
|
576
|
-
<span class='
|
577
|
-
<span class='
|
578
|
-
</pre>
|
572
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_format_offset'>format_offset</span><span class='lparen'>(</span><span class='id identifier rubyid_offset'>offset</span><span class='comma'>,</span> <span class='id identifier rubyid_colon'>colon</span> <span class='op'>=</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
573
|
+
<span class='id identifier rubyid_offset'>offset</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_offset'>offset</span> <span class='op'>*</span> <span class='int'>86400</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='kw'>if</span> <span class='id identifier rubyid_offset'>offset</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Rational</span><span class='rparen'>)</span>
|
574
|
+
<span class='id identifier rubyid_offset'>offset</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Fixnum</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_seconds_to_utc_offset'>seconds_to_utc_offset</span><span class='lparen'>(</span><span class='id identifier rubyid_offset'>offset</span><span class='comma'>,</span> <span class='id identifier rubyid_colon'>colon</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='kw'>nil</span>
|
575
|
+
<span class='kw'>end</span></pre>
|
579
576
|
</td>
|
580
577
|
</tr>
|
581
578
|
</table>
|
@@ -661,18 +658,6 @@
|
|
661
658
|
<pre class="lines">
|
662
659
|
|
663
660
|
|
664
|
-
306
|
665
|
-
307
|
666
|
-
308
|
667
|
-
309
|
668
|
-
310
|
669
|
-
311
|
670
|
-
312
|
671
|
-
313
|
672
|
-
314
|
673
|
-
315
|
674
|
-
316
|
675
|
-
317
|
676
661
|
318
|
677
662
|
319
|
678
663
|
320
|
@@ -680,32 +665,23 @@
|
|
680
665
|
322
|
681
666
|
323
|
682
667
|
324
|
683
|
-
325
|
668
|
+
325
|
669
|
+
326
|
670
|
+
327</pre>
|
684
671
|
</td>
|
685
672
|
<td>
|
686
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
687
|
-
|
688
|
-
<span class='
|
689
|
-
<span class='
|
690
|
-
|
691
|
-
<span class='
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
<span class='rubyid_@zones_names ivar id'>@zones_names</span><span class='lbrack token'>[</span><span class='rubyid_dst_key identifier id'>dst_key</span><span class='rbrack token'>]</span> <span class='lshft op'><<</span> <span class='rubyid_zone identifier id'>zone</span><span class='dot token'>.</span><span class='rubyid_to_str identifier id'>to_str</span><span class='lparen token'>(</span><span class='rubyid_zone_alias identifier id'>zone_alias</span><span class='rparen token'>)</span>
|
699
|
-
<span class='rubyid_@zones_names ivar id'>@zones_names</span><span class='lbrack token'>[</span><span class='rubyid_dst_key identifier id'>dst_key</span><span class='rbrack token'>]</span> <span class='lshft op'><<</span> <span class='rubyid_zone identifier id'>zone</span><span class='dot token'>.</span><span class='rubyid_to_str_with_dst identifier id'>to_str_with_dst</span><span class='lparen token'>(</span><span class='rubyid_dst_label identifier id'>dst_label</span><span class='comma token'>,</span> <span class='rubyid_nil nil kw'>nil</span><span class='comma token'>,</span> <span class='rubyid_zone_alias identifier id'>zone_alias</span><span class='rparen token'>)</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_zone identifier id'>zone</span><span class='dot token'>.</span><span class='rubyid_uses_dst? fid id'>uses_dst?</span> <span class='andop op'>&&</span> <span class='rubyid_zone_alias identifier id'>zone_alias</span> <span class='nmatch op'>!~</span> <span class='dregexp node'>/(#{Regexp.quote(dst_label)})$/</span>
|
700
|
-
<span class='rubyid_end end kw'>end</span>
|
701
|
-
<span class='rubyid_end end kw'>end</span>
|
702
|
-
|
703
|
-
<span class='rubyid_@zones_names ivar id'>@zones_names</span><span class='lbrack token'>[</span><span class='rubyid_dst_key identifier id'>dst_key</span><span class='rbrack token'>]</span><span class='assign token'>=</span> <span class='rubyid_@zones_names ivar id'>@zones_names</span><span class='lbrack token'>[</span><span class='rubyid_dst_key identifier id'>dst_key</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='rubyid_uniq identifier id'>uniq</span><span class='dot token'>.</span><span class='rubyid_compact identifier id'>compact</span><span class='dot token'>.</span><span class='rubyid_sort identifier id'>sort</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='rubyid_a identifier id'>a</span><span class='comma token'>,</span><span class='rubyid_b identifier id'>b</span><span class='bitor op'>|</span> <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_compare identifier id'>compare</span><span class='lparen token'>(</span><span class='rubyid_a identifier id'>a</span><span class='comma token'>,</span> <span class='rubyid_b identifier id'>b</span><span class='rparen token'>)</span> <span class='rbrace token'>}</span> <span class='comment val'># Sort by name</span>
|
704
|
-
<span class='rubyid_end end kw'>end</span>
|
705
|
-
|
706
|
-
<span class='rubyid_@zones_names ivar id'>@zones_names</span><span class='lbrack token'>[</span><span class='rubyid_with_dst identifier id'>with_dst</span> <span class='integer val'>? </span><span class='rubyid_dst_key identifier id'>dst_key</span> <span class='colon op'>:</span> <span class='string val'>"STANDARD"</span><span class='rbrack token'>]</span>
|
707
|
-
<span class='rubyid_end end kw'>end</span>
|
708
|
-
</pre>
|
673
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 318</span>
|
674
|
+
|
675
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_list_all'>list_all</span><span class='lparen'>(</span><span class='id identifier rubyid_with_dst'>with_dst</span> <span class='op'>=</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='id identifier rubyid_dst_label'>dst_label</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
676
|
+
<span class='id identifier rubyid_dst_label'>dst_label</span> <span class='op'>||=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>(DST)</span><span class='tstring_end'>"</span></span>
|
677
|
+
|
678
|
+
<span class='ivar'>@zones_names</span> <span class='op'>||=</span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>STANDARD</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='op'>::</span><span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>TimeZone</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:to_s</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
679
|
+
<span class='ivar'>@zones_names</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>DST[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_dst_label'>dst_label</span><span class='rbrace'>}</span><span class='tstring_content'>]-STANDARD</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='op'>::</span><span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>TimeZone</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_zone'>zone</span><span class='op'>|</span>
|
680
|
+
<span class='id identifier rubyid_zone'>zone</span><span class='period'>.</span><span class='id identifier rubyid_aliases'>aliases</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_zone_alias'>zone_alias</span><span class='op'>|</span> <span class='lbracket'>[</span><span class='id identifier rubyid_zone'>zone</span><span class='period'>.</span><span class='id identifier rubyid_to_str'>to_str</span><span class='lparen'>(</span><span class='id identifier rubyid_zone_alias'>zone_alias</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='id identifier rubyid_zone'>zone</span><span class='period'>.</span><span class='id identifier rubyid_uses_dst?'>uses_dst?</span> <span class='op'>&&</span> <span class='id identifier rubyid_zone_alias'>zone_alias</span> <span class='op'>!~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_quote'>quote</span><span class='lparen'>(</span><span class='id identifier rubyid_dst_label'>dst_label</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>)$</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_zone'>zone</span><span class='period'>.</span><span class='id identifier rubyid_to_str_with_dst'>to_str_with_dst</span><span class='lparen'>(</span><span class='id identifier rubyid_dst_label'>dst_label</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_zone_alias'>zone_alias</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='kw'>nil</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
|
681
|
+
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_uniq'>uniq</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_a'>a</span><span class='comma'>,</span><span class='id identifier rubyid_b'>b</span><span class='op'>|</span> <span class='op'>::</span><span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>TimeZone</span><span class='period'>.</span><span class='id identifier rubyid_compare'>compare</span><span class='lparen'>(</span><span class='id identifier rubyid_a'>a</span><span class='comma'>,</span> <span class='id identifier rubyid_b'>b</span><span class='rparen'>)</span> <span class='rbrace'>}</span> <span class='comment'># Sort by name
|
682
|
+
</span>
|
683
|
+
<span class='ivar'>@zones_names</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_with_dst'>with_dst</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>DST[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_dst_label'>dst_label</span><span class='rbrace'>}</span><span class='tstring_content'>]-</span><span class='tstring_end'>"</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span><span class='tstring_content'>STANDARD</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span>
|
684
|
+
<span class='kw'>end</span></pre>
|
709
685
|
</td>
|
710
686
|
</tr>
|
711
687
|
</table>
|
@@ -724,9 +700,9 @@
|
|
724
700
|
<div class="discussion">
|
725
701
|
<p>Returns a string representation of a timezone.</p>
|
726
702
|
|
727
|
-
<pre class="code ruby"><code><span class='
|
728
|
-
<span class='comment
|
729
|
-
</code></pre>
|
703
|
+
<pre class="code ruby"><code><span class='const'>DateTime</span><span class='period'>.</span><span class='id identifier rubyid_parameterize_zone'>parameterize_zone</span><span class='lparen'>(</span><span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>TimeZone</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Pacific Time (US & Canada)</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
704
|
+
<span class='comment'># => "-0800@pacific-time-us-canada"
|
705
|
+
</span></code></pre>
|
730
706
|
|
731
707
|
|
732
708
|
</div>
|
@@ -793,8 +769,6 @@
|
|
793
769
|
<pre class="lines">
|
794
770
|
|
795
771
|
|
796
|
-
336
|
797
|
-
337
|
798
772
|
338
|
799
773
|
339
|
800
774
|
340
|
@@ -803,23 +777,24 @@
|
|
803
777
|
343
|
804
778
|
344
|
805
779
|
345
|
806
|
-
346
|
780
|
+
346
|
781
|
+
347
|
782
|
+
348</pre>
|
807
783
|
</td>
|
808
784
|
<td>
|
809
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
810
|
-
|
811
|
-
<span class='
|
812
|
-
<span class='
|
813
|
-
|
814
|
-
<span class='
|
815
|
-
<span class='
|
816
|
-
<span class='
|
817
|
-
<span class='
|
818
|
-
<span class='
|
819
|
-
<span class='
|
820
|
-
<span class='
|
821
|
-
<span class='
|
822
|
-
</pre>
|
785
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 338</span>
|
786
|
+
|
787
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_parameterize_zone'>parameterize_zone</span><span class='lparen'>(</span><span class='id identifier rubyid_tz'>tz</span><span class='comma'>,</span> <span class='id identifier rubyid_with_offset'>with_offset</span> <span class='op'>=</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
788
|
+
<span class='id identifier rubyid_tz'>tz</span> <span class='op'>=</span> <span class='id identifier rubyid_tz'>tz</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_tz'>tz</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>String</span><span class='rparen'>)</span>
|
789
|
+
|
790
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_tz'>tz</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^(\([a-z]+([+-])(\d{2})(:?)(\d{2})\)\s(.+))$</span><span class='regexp_end'>/i</span></span> <span class='kw'>then</span>
|
791
|
+
<span class='id identifier rubyid_with_offset'>with_offset</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='backref'>$2</span><span class='rbrace'>}</span><span class='embexpr_beg'>#{</span><span class='backref'>$3</span><span class='rbrace'>}</span><span class='embexpr_beg'>#{</span><span class='backref'>$5</span><span class='rbrace'>}</span><span class='tstring_content'>@</span><span class='embexpr_beg'>#{</span><span class='backref'>$6</span><span class='period'>.</span><span class='id identifier rubyid_parameterize'>parameterize</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span> <span class='op'>:</span> <span class='backref'>$6</span><span class='period'>.</span><span class='id identifier rubyid_parameterize'>parameterize</span>
|
792
|
+
<span class='kw'>elsif</span> <span class='op'>!</span><span class='id identifier rubyid_with_offset'>with_offset</span> <span class='kw'>then</span>
|
793
|
+
<span class='id identifier rubyid_tz'>tz</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^([+-]?(\d{2})(:?)(\d{2})@)</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
794
|
+
<span class='kw'>else</span>
|
795
|
+
<span class='id identifier rubyid_tz'>tz</span><span class='period'>.</span><span class='id identifier rubyid_parameterize'>parameterize</span>
|
796
|
+
<span class='kw'>end</span>
|
797
|
+
<span class='kw'>end</span></pre>
|
823
798
|
</td>
|
824
799
|
</tr>
|
825
800
|
</table>
|
@@ -886,19 +861,18 @@
|
|
886
861
|
<pre class="lines">
|
887
862
|
|
888
863
|
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
864
|
+
281
|
865
|
+
282
|
866
|
+
283
|
867
|
+
284</pre>
|
893
868
|
</td>
|
894
869
|
<td>
|
895
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
870
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 281</span>
|
896
871
|
|
897
|
-
<span class='
|
898
|
-
<span class='
|
899
|
-
<span class='
|
900
|
-
<span class='
|
901
|
-
</pre>
|
872
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_rationalize_offset'>rationalize_offset</span><span class='lparen'>(</span><span class='id identifier rubyid_offset'>offset</span><span class='rparen'>)</span>
|
873
|
+
<span class='id identifier rubyid_offset'>offset</span> <span class='op'>=</span> <span class='id identifier rubyid_offset'>offset</span><span class='period'>.</span><span class='id identifier rubyid_try'>try</span><span class='lparen'>(</span><span class='symbol'>:offset</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_offset'>offset</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Fixnum</span><span class='rparen'>)</span>
|
874
|
+
<span class='op'>::</span><span class='const'>TZInfo</span><span class='op'>::</span><span class='const'>OffsetRationals</span><span class='period'>.</span><span class='id identifier rubyid_rational_for_offset'>rational_for_offset</span><span class='lparen'>(</span><span class='id identifier rubyid_offset'>offset</span><span class='period'>.</span><span class='id identifier rubyid_to_integer'>to_integer</span><span class='rparen'>)</span>
|
875
|
+
<span class='kw'>end</span></pre>
|
902
876
|
</td>
|
903
877
|
</tr>
|
904
878
|
</table>
|
@@ -1006,8 +980,6 @@
|
|
1006
980
|
<pre class="lines">
|
1007
981
|
|
1008
982
|
|
1009
|
-
355
|
1010
|
-
356
|
1011
983
|
357
|
1012
984
|
358
|
1013
985
|
359
|
@@ -1021,28 +993,29 @@
|
|
1021
993
|
367
|
1022
994
|
368
|
1023
995
|
369
|
1024
|
-
370
|
996
|
+
370
|
997
|
+
371
|
998
|
+
372</pre>
|
1025
999
|
</td>
|
1026
1000
|
<td>
|
1027
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
1028
|
-
|
1029
|
-
<span class='
|
1030
|
-
<span class='
|
1031
|
-
<span class='
|
1032
|
-
<span class='
|
1033
|
-
<span class='
|
1034
|
-
<span class='
|
1035
|
-
|
1036
|
-
<span class='
|
1037
|
-
<span class='
|
1038
|
-
|
1039
|
-
<span class='
|
1040
|
-
<span class='lparen
|
1041
|
-
<span class='
|
1042
|
-
<span class='
|
1043
|
-
<span class='
|
1044
|
-
<span class='
|
1045
|
-
</pre>
|
1001
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 357</span>
|
1002
|
+
|
1003
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_unparameterize_zone'>unparameterize_zone</span><span class='lparen'>(</span><span class='id identifier rubyid_tz'>tz</span><span class='comma'>,</span> <span class='id identifier rubyid_as_string'>as_string</span> <span class='op'>=</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='id identifier rubyid_dst_label'>dst_label</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
1004
|
+
<span class='id identifier rubyid_tz'>tz</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parameterize_zone'>parameterize_zone</span><span class='lparen'>(</span><span class='id identifier rubyid_tz'>tz</span><span class='comma'>,</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
1005
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_catch'>catch</span><span class='lparen'>(</span><span class='symbol'>:zone</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
1006
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_list_all'>list_all</span><span class='lparen'>(</span><span class='kw'>true</span><span class='comma'>,</span> <span class='id identifier rubyid_dst_label'>dst_label</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_zone'>zone</span><span class='op'>|</span>
|
1007
|
+
<span class='id identifier rubyid_throw'>throw</span><span class='lparen'>(</span><span class='symbol'>:zone</span><span class='comma'>,</span> <span class='id identifier rubyid_zone'>zone</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parameterize_zone'>parameterize_zone</span><span class='lparen'>(</span><span class='id identifier rubyid_zone'>zone</span><span class='comma'>,</span> <span class='kw'>false</span><span class='rparen'>)</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_quote'>quote</span><span class='lparen'>(</span><span class='id identifier rubyid_tz'>tz</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>)$</span><span class='regexp_end'>/</span></span>
|
1008
|
+
<span class='kw'>end</span>
|
1009
|
+
|
1010
|
+
<span class='kw'>nil</span>
|
1011
|
+
<span class='kw'>end</span>
|
1012
|
+
|
1013
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_rv'>rv</span> <span class='kw'>then</span>
|
1014
|
+
<span class='lparen'>(</span><span class='id identifier rubyid_as_string'>as_string</span> <span class='op'>?</span> <span class='id identifier rubyid_rv'>rv</span> <span class='op'>:</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='id identifier rubyid_rv'>rv</span><span class='comma'>,</span> <span class='id identifier rubyid_dst_label'>dst_label</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
1015
|
+
<span class='kw'>else</span>
|
1016
|
+
<span class='kw'>nil</span>
|
1017
|
+
<span class='kw'>end</span>
|
1018
|
+
<span class='kw'>end</span></pre>
|
1046
1019
|
</td>
|
1047
1020
|
</tr>
|
1048
1021
|
</table>
|
@@ -1053,9 +1026,9 @@
|
|
1053
1026
|
</div>
|
1054
1027
|
|
1055
1028
|
<div id="footer">
|
1056
|
-
Generated on
|
1029
|
+
Generated on Mon Jan 28 20:23:46 2013 by
|
1057
1030
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1058
|
-
0.8.
|
1031
|
+
0.8.3 (ruby-1.9.3).
|
1059
1032
|
</div>
|
1060
1033
|
|
1061
1034
|
</body>
|
data/doc/Lazier/Version.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Lazier::Version
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.3
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -119,8 +119,7 @@
|
|
119
119
|
|
120
120
|
</div>
|
121
121
|
</dt>
|
122
|
-
<dd><pre class="code"><span class='
|
123
|
-
</pre></dd>
|
122
|
+
<dd><pre class="code"><span class='int'>2</span></pre></dd>
|
124
123
|
|
125
124
|
<dt id="MINOR-constant" class="">MINOR =
|
126
125
|
<div class="docstring">
|
@@ -135,8 +134,7 @@
|
|
135
134
|
|
136
135
|
</div>
|
137
136
|
</dt>
|
138
|
-
<dd><pre class="code"><span class='
|
139
|
-
</pre></dd>
|
137
|
+
<dd><pre class="code"><span class='int'>0</span></pre></dd>
|
140
138
|
|
141
139
|
<dt id="PATCH-constant" class="">PATCH =
|
142
140
|
<div class="docstring">
|
@@ -151,8 +149,7 @@
|
|
151
149
|
|
152
150
|
</div>
|
153
151
|
</dt>
|
154
|
-
<dd><pre class="code"><span class='
|
155
|
-
</pre></dd>
|
152
|
+
<dd><pre class="code"><span class='int'>0</span></pre></dd>
|
156
153
|
|
157
154
|
<dt id="STRING-constant" class="">STRING =
|
158
155
|
<div class="docstring">
|
@@ -167,8 +164,7 @@
|
|
167
164
|
|
168
165
|
</div>
|
169
166
|
</dt>
|
170
|
-
<dd><pre class="code"><span class='
|
171
|
-
</pre></dd>
|
167
|
+
<dd><pre class="code"><span class='lbracket'>[</span><span class='const'>MAJOR</span><span class='comma'>,</span> <span class='const'>MINOR</span><span class='comma'>,</span> <span class='const'>PATCH</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span></pre></dd>
|
172
168
|
|
173
169
|
</dl>
|
174
170
|
|
@@ -184,9 +180,9 @@
|
|
184
180
|
</div>
|
185
181
|
|
186
182
|
<div id="footer">
|
187
|
-
Generated on
|
183
|
+
Generated on Mon Jan 28 20:23:46 2013 by
|
188
184
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
189
|
-
0.8.
|
185
|
+
0.8.3 (ruby-1.9.3).
|
190
186
|
</div>
|
191
187
|
|
192
188
|
</body>
|
data/doc/_index.html
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
<head>
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
6
|
<title>
|
7
|
-
Documentation by YARD 0.8.
|
7
|
+
Documentation by YARD 0.8.3
|
8
8
|
|
9
9
|
</title>
|
10
10
|
|
@@ -56,7 +56,7 @@
|
|
56
56
|
|
57
57
|
<iframe id="search_frame"></iframe>
|
58
58
|
|
59
|
-
<div id="content"><h1 class="noborder title">Documentation by YARD 0.8.
|
59
|
+
<div id="content"><h1 class="noborder title">Documentation by YARD 0.8.3</h1>
|
60
60
|
<div id="listing">
|
61
61
|
<h1 class="alphaindex">Alphabetic Index</h1>
|
62
62
|
|
@@ -297,9 +297,9 @@
|
|
297
297
|
</div>
|
298
298
|
|
299
299
|
<div id="footer">
|
300
|
-
Generated on
|
300
|
+
Generated on Mon Jan 28 20:23:45 2013 by
|
301
301
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
302
|
-
0.8.
|
302
|
+
0.8.3 (ruby-1.9.3).
|
303
303
|
</div>
|
304
304
|
|
305
305
|
</body>
|
data/doc/file.README.html
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
4
|
<head>
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII" />
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.3
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -69,12 +69,14 @@
|
|
69
69
|
|
70
70
|
<p>Several Ruby object enhancements.</p>
|
71
71
|
|
72
|
-
<p><a href="http://
|
72
|
+
<p><a href="http://sw.cow.tc/lazier">http://sw.cow.tc/lazier</a></p>
|
73
|
+
|
74
|
+
<p><a href="http://rdoc.info/gems/lazier">http://rdoc.info/gems/lazier</a></p>
|
73
75
|
|
74
76
|
<h2>Usage</h2>
|
75
77
|
|
76
|
-
<pre class="code ruby"><code><span class='
|
77
|
-
<span class='
|
78
|
+
<pre class="code ruby"><code><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>lazier</span><span class='tstring_end'>"</span></span>
|
79
|
+
<span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_load!'>load!</span>
|
78
80
|
</code></pre>
|
79
81
|
|
80
82
|
<p>That's all!
|
@@ -94,14 +96,15 @@ See documentation for more informations.</p>
|
|
94
96
|
|
95
97
|
<h2>Copyright</h2>
|
96
98
|
|
97
|
-
<p>Copyright (C) 2013 and above Shogun <shogun_panda@me.com
|
98
|
-
|
99
|
+
<p>Copyright (C) 2013 and above Shogun (<a href="mailto:shogun_panda@me.com">shogun_panda@me.com</a>).</p>
|
100
|
+
|
101
|
+
<p>Licensed under the MIT license, which can be found at <a href="http://www.opensource.org/licenses/mit-license.php">http://www.opensource.org/licenses/mit-license.php</a>.</p>
|
99
102
|
</div></div>
|
100
103
|
|
101
104
|
<div id="footer">
|
102
|
-
Generated on
|
105
|
+
Generated on Mon Jan 28 20:23:45 2013 by
|
103
106
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
104
|
-
0.8.
|
107
|
+
0.8.3 (ruby-1.9.3).
|
105
108
|
</div>
|
106
109
|
|
107
110
|
</body>
|