cowtech-extensions 2.5.0 → 2.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/doc/Cowtech.html +2 -2
- data/doc/Cowtech/Extensions.html +101 -88
- data/doc/Cowtech/Extensions/Boolean.html +10 -8
- data/doc/Cowtech/Extensions/DateTime.html +58 -52
- data/doc/Cowtech/Extensions/DateTime/ClassMethods.html +91 -79
- data/doc/Cowtech/Extensions/Exceptions.html +2 -2
- data/doc/Cowtech/Extensions/Exceptions/Dump.html +2 -2
- data/doc/Cowtech/Extensions/Hash.html +20 -18
- data/doc/Cowtech/Extensions/Math.html +2 -2
- data/doc/Cowtech/Extensions/Math/ClassMethods.html +24 -22
- data/doc/Cowtech/Extensions/Object.html +95 -81
- data/doc/Cowtech/Extensions/Pathname.html +11 -10
- data/doc/Cowtech/Extensions/Settings.html +80 -70
- data/doc/Cowtech/Extensions/String.html +26 -22
- data/doc/Cowtech/Extensions/TimeZone.html +61 -52
- data/doc/Cowtech/Extensions/TimeZone/ClassMethods.html +65 -59
- data/doc/Cowtech/Extensions/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/cowtech-extensions.rb +7 -1
- data/lib/cowtech-extensions/settings.rb +6 -6
- data/lib/cowtech-extensions/version.rb +8 -8
- data/spec/cowtech-extensions/settings_spec.rb +17 -0
- metadata +138 -120
@@ -431,12 +431,13 @@
|
|
431
431
|
<td>
|
432
432
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/settings.rb', line 31</span>
|
433
433
|
|
434
|
-
<span class='kw'>def</span> <span class='
|
435
|
-
<span class='kw'>self</span><span class='
|
436
|
-
<span class='kw'>self</span><span class='
|
437
|
-
<span class='kw'>self</span><span class='
|
438
|
-
<span class='kw'>self</span><span class='
|
439
|
-
<span class='kw'>end</span
|
434
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_initialize identifier id'>initialize</span>
|
435
|
+
<span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_setup_format_number identifier id'>setup_format_number</span><span class='lparen token'>(</span><span class='rparen token'>)</span>
|
436
|
+
<span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_setup_boolean_names identifier id'>setup_boolean_names</span><span class='lparen token'>(</span><span class='rparen token'>)</span>
|
437
|
+
<span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_setup_date_formats identifier id'>setup_date_formats</span><span class='lparen token'>(</span><span class='rparen token'>)</span>
|
438
|
+
<span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_setup_date_names identifier id'>setup_date_names</span><span class='lparen token'>(</span><span class='rparen token'>)</span>
|
439
|
+
<span class='rubyid_end end kw'>end</span>
|
440
|
+
</pre>
|
440
441
|
</td>
|
441
442
|
</tr>
|
442
443
|
</table>
|
@@ -481,9 +482,10 @@
|
|
481
482
|
<td>
|
482
483
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/settings.rb', line 15</span>
|
483
484
|
|
484
|
-
<span class='kw'>def</span> <span class='
|
485
|
-
<span class='ivar'>@boolean_names</span>
|
486
|
-
<span class='kw'>end</span
|
485
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_boolean_names identifier id'>boolean_names</span>
|
486
|
+
<span class='rubyid_@boolean_names ivar id'>@boolean_names</span>
|
487
|
+
<span class='rubyid_end end kw'>end</span>
|
488
|
+
</pre>
|
487
489
|
</td>
|
488
490
|
</tr>
|
489
491
|
</table>
|
@@ -523,9 +525,10 @@
|
|
523
525
|
<td>
|
524
526
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/settings.rb', line 21</span>
|
525
527
|
|
526
|
-
<span class='kw'>def</span> <span class='
|
527
|
-
<span class='ivar'>@date_formats</span>
|
528
|
-
<span class='kw'>end</span
|
528
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_date_formats identifier id'>date_formats</span>
|
529
|
+
<span class='rubyid_@date_formats ivar id'>@date_formats</span>
|
530
|
+
<span class='rubyid_end end kw'>end</span>
|
531
|
+
</pre>
|
529
532
|
</td>
|
530
533
|
</tr>
|
531
534
|
</table>
|
@@ -565,9 +568,10 @@
|
|
565
568
|
<td>
|
566
569
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/settings.rb', line 18</span>
|
567
570
|
|
568
|
-
<span class='kw'>def</span> <span class='
|
569
|
-
<span class='ivar'>@date_names</span>
|
570
|
-
<span class='kw'>end</span
|
571
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_date_names identifier id'>date_names</span>
|
572
|
+
<span class='rubyid_@date_names ivar id'>@date_names</span>
|
573
|
+
<span class='rubyid_end end kw'>end</span>
|
574
|
+
</pre>
|
571
575
|
</td>
|
572
576
|
</tr>
|
573
577
|
</table>
|
@@ -607,9 +611,10 @@
|
|
607
611
|
<td>
|
608
612
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/settings.rb', line 12</span>
|
609
613
|
|
610
|
-
<span class='kw'>def</span> <span class='
|
611
|
-
<span class='ivar'>@format_number</span>
|
612
|
-
<span class='kw'>end</span
|
614
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_format_number identifier id'>format_number</span>
|
615
|
+
<span class='rubyid_@format_number ivar id'>@format_number</span>
|
616
|
+
<span class='rubyid_end end kw'>end</span>
|
617
|
+
</pre>
|
613
618
|
</td>
|
614
619
|
</tr>
|
615
620
|
</table>
|
@@ -671,9 +676,10 @@
|
|
671
676
|
<td>
|
672
677
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/settings.rb', line 26</span>
|
673
678
|
|
674
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='
|
675
|
-
<span class='ivar'>@instance</span> <span class='op'>||=</span> <span class='kw'>self</span><span class='
|
676
|
-
<span class='kw'>end</span
|
679
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_instance identifier id'>instance</span>
|
680
|
+
<span class='rubyid_@instance ivar id'>@instance</span> <span class='opasgn op'>||=</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rparen token'>)</span>
|
681
|
+
<span class='rubyid_end end kw'>end</span>
|
682
|
+
</pre>
|
677
683
|
</td>
|
678
684
|
</tr>
|
679
685
|
</table>
|
@@ -781,11 +787,12 @@
|
|
781
787
|
<td>
|
782
788
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/settings.rb', line 61</span>
|
783
789
|
|
784
|
-
<span class='kw'>def</span> <span class='
|
785
|
-
<span class='
|
786
|
-
<span class='
|
787
|
-
<span class='ivar'>@boolean_names</span> <span class='
|
788
|
-
<span class='kw'>end</span
|
790
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_setup_boolean_names identifier id'>setup_boolean_names</span><span class='lparen token'>(</span><span class='rubyid_true_name identifier id'>true_name</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span><span class='comma token'>,</span> <span class='rubyid_false_name identifier id'>false_name</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span><span class='rparen token'>)</span>
|
791
|
+
<span class='rubyid_true_name identifier id'>true_name</span> <span class='opasgn op'>||=</span> <span class='string val'>"Yes"</span>
|
792
|
+
<span class='rubyid_false_name identifier id'>false_name</span> <span class='opasgn op'>||=</span> <span class='string val'>"No"</span>
|
793
|
+
<span class='rubyid_@boolean_names ivar id'>@boolean_names</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span><span class='rubyid_true true kw'>true</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='rubyid_true_name identifier id'>true_name</span><span class='comma token'>,</span> <span class='rubyid_false false kw'>false</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='rubyid_false_name identifier id'>false_name</span><span class='rbrace token'>}</span>
|
794
|
+
<span class='rubyid_end end kw'>end</span>
|
795
|
+
</pre>
|
789
796
|
</td>
|
790
797
|
</tr>
|
791
798
|
</table>
|
@@ -903,27 +910,28 @@
|
|
903
910
|
<td>
|
904
911
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/settings.rb', line 73</span>
|
905
912
|
|
906
|
-
<span class='kw'>def</span> <span class='
|
907
|
-
<span class='
|
908
|
-
<span class='symbol'>:ct_date</span> <span class='
|
909
|
-
<span class='symbol'>:ct_time</span> <span class='
|
910
|
-
<span class='symbol'>:ct_date_time</span> <span class='
|
911
|
-
<span class='symbol'>:ct_iso_8601</span> <span class='
|
912
|
-
<span class='rbrace'>}</span> <span class='kw'>if</span> <span class='
|
913
|
-
|
914
|
-
<span class='kw'>if</span> <span class='
|
915
|
-
<span class='kw'>if</span> <span class='op'>!</span><span class='
|
916
|
-
<span class='ivar'>@date_formats</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
917
|
-
<span class='ivar'>@date_formats</span><span class='
|
918
|
-
<span class='kw'>else</span>
|
919
|
-
<span class='ivar'>@date_formats</span> <span class='
|
920
|
-
<span class='kw'>end</span>
|
921
|
-
|
922
|
-
<span class='ivar'>@date_formats</span><span class='
|
923
|
-
<span class='kw'>end</span>
|
924
|
-
|
925
|
-
<span class='ivar'>@date_formats</span>
|
926
|
-
<span class='kw'>end</span
|
913
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_setup_date_formats identifier id'>setup_date_formats</span><span class='lparen token'>(</span><span class='rubyid_formats identifier id'>formats</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span><span class='comma token'>,</span> <span class='rubyid_replace identifier id'>replace</span> <span class='assign token'>=</span> <span class='rubyid_false false kw'>false</span><span class='rparen token'>)</span>
|
914
|
+
<span class='rubyid_formats identifier id'>formats</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span>
|
915
|
+
<span class='symbol val'>:ct_date</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"%Y-%m-%d"</span><span class='comma token'>,</span>
|
916
|
+
<span class='symbol val'>:ct_time</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"%H:%M:%S"</span><span class='comma token'>,</span>
|
917
|
+
<span class='symbol val'>:ct_date_time</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"%F %T"</span><span class='comma token'>,</span>
|
918
|
+
<span class='symbol val'>:ct_iso_8601</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"%FT%T%z"</span>
|
919
|
+
<span class='rbrace token'>}</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_formats identifier id'>formats</span><span class='dot token'>.</span><span class='rubyid_blank? fid id'>blank?</span>
|
920
|
+
|
921
|
+
<span class='rubyid_if if kw'>if</span> <span class='rubyid_formats identifier id'>formats</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='colon3 op'>::</span><span class='rubyid_Hash constant id'>Hash</span><span class='rparen token'>)</span> <span class='rubyid_then then kw'>then</span>
|
922
|
+
<span class='rubyid_if if kw'>if</span> <span class='notop op'>!</span><span class='rubyid_replace identifier id'>replace</span> <span class='rubyid_then then kw'>then</span>
|
923
|
+
<span class='rubyid_@date_formats ivar id'>@date_formats</span> <span class='opasgn op'>||=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span>
|
924
|
+
<span class='rubyid_@date_formats ivar id'>@date_formats</span><span class='dot token'>.</span><span class='rubyid_merge! fid id'>merge!</span><span class='lparen token'>(</span><span class='rubyid_formats identifier id'>formats</span><span class='rparen token'>)</span>
|
925
|
+
<span class='rubyid_else else kw'>else</span>
|
926
|
+
<span class='rubyid_@date_formats ivar id'>@date_formats</span> <span class='assign token'>=</span> <span class='rubyid_formats identifier id'>formats</span>
|
927
|
+
<span class='rubyid_end end kw'>end</span>
|
928
|
+
|
929
|
+
<span class='rubyid_@date_formats ivar id'>@date_formats</span><span class='dot token'>.</span><span class='rubyid_each_pair identifier id'>each_pair</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_k identifier id'>k</span><span class='comma token'>,</span> <span class='rubyid_v identifier id'>v</span><span class='bitor op'>|</span> <span class='colon3 op'>::</span><span class='rubyid_Time constant id'>Time</span><span class='colon2 op'>::</span><span class='rubyid_DATE_FORMATS constant id'>DATE_FORMATS</span><span class='lbrack token'>[</span><span class='rubyid_k identifier id'>k</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='rubyid_v identifier id'>v</span> <span class='rubyid_end end kw'>end</span>
|
930
|
+
<span class='rubyid_end end kw'>end</span>
|
931
|
+
|
932
|
+
<span class='rubyid_@date_formats ivar id'>@date_formats</span>
|
933
|
+
<span class='rubyid_end end kw'>end</span>
|
934
|
+
</pre>
|
927
935
|
</td>
|
928
936
|
</tr>
|
929
937
|
</table>
|
@@ -1071,19 +1079,20 @@
|
|
1071
1079
|
<td>
|
1072
1080
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/settings.rb', line 105</span>
|
1073
1081
|
|
1074
|
-
<span class='kw'>def</span> <span class='
|
1075
|
-
<span class='
|
1076
|
-
<span class='
|
1077
|
-
<span class='
|
1078
|
-
<span class='
|
1079
|
-
|
1080
|
-
<span class='ivar'>@date_names</span> <span class='
|
1081
|
-
<span class='symbol'>:long_months</span> <span class='op'
|
1082
|
-
<span class='symbol'>:short_months</span> <span class='op'
|
1083
|
-
<span class='symbol'>:long_days</span> <span class='op'
|
1084
|
-
<span class='symbol'>:short_days</span> <span class='op'
|
1085
|
-
<span class='rbrace'>}</span>
|
1086
|
-
<span class='kw'>end</span
|
1082
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_setup_date_names identifier id'>setup_date_names</span><span class='lparen token'>(</span><span class='rubyid_long_months identifier id'>long_months</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span><span class='comma token'>,</span> <span class='rubyid_short_months identifier id'>short_months</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span><span class='comma token'>,</span> <span class='rubyid_long_days identifier id'>long_days</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span><span class='comma token'>,</span> <span class='rubyid_short_days identifier id'>short_days</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span><span class='rparen token'>)</span>
|
1083
|
+
<span class='rubyid_long_months identifier id'>long_months</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='string val'>"January"</span><span class='comma token'>,</span> <span class='string val'>"February"</span><span class='comma token'>,</span> <span class='string val'>"March"</span><span class='comma token'>,</span> <span class='string val'>"April"</span><span class='comma token'>,</span> <span class='string val'>"May"</span><span class='comma token'>,</span> <span class='string val'>"June"</span><span class='comma token'>,</span> <span class='string val'>"July"</span><span class='comma token'>,</span> <span class='string val'>"August"</span><span class='comma token'>,</span> <span class='string val'>"September"</span><span class='comma token'>,</span> <span class='string val'>"October"</span><span class='comma token'>,</span> <span class='string val'>"November"</span><span class='comma token'>,</span> <span class='string val'>"December"</span><span class='rbrack token'>]</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_long_months identifier id'>long_months</span><span class='dot token'>.</span><span class='rubyid_blank? fid id'>blank?</span>
|
1084
|
+
<span class='rubyid_short_months identifier id'>short_months</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='string val'>"Jan"</span><span class='comma token'>,</span> <span class='string val'>"Feb"</span><span class='comma token'>,</span> <span class='string val'>"Mar"</span><span class='comma token'>,</span> <span class='string val'>"Apr"</span><span class='comma token'>,</span> <span class='string val'>"May"</span><span class='comma token'>,</span> <span class='string val'>"Jun"</span><span class='comma token'>,</span> <span class='string val'>"Jul"</span><span class='comma token'>,</span> <span class='string val'>"Aug"</span><span class='comma token'>,</span> <span class='string val'>"Sep"</span><span class='comma token'>,</span> <span class='string val'>"Oct"</span><span class='comma token'>,</span> <span class='string val'>"Nov"</span><span class='comma token'>,</span> <span class='string val'>"Dec"</span><span class='rbrack token'>]</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_short_months identifier id'>short_months</span><span class='dot token'>.</span><span class='rubyid_blank? fid id'>blank?</span>
|
1085
|
+
<span class='rubyid_long_days identifier id'>long_days</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='string val'>"Sunday"</span><span class='comma token'>,</span> <span class='string val'>"Monday"</span><span class='comma token'>,</span> <span class='string val'>"Tuesday"</span><span class='comma token'>,</span> <span class='string val'>"Wednesday"</span><span class='comma token'>,</span> <span class='string val'>"Thursday"</span><span class='comma token'>,</span> <span class='string val'>"Friday"</span><span class='comma token'>,</span> <span class='string val'>"Saturday"</span><span class='rbrack token'>]</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_long_days identifier id'>long_days</span><span class='dot token'>.</span><span class='rubyid_blank? fid id'>blank?</span>
|
1086
|
+
<span class='rubyid_short_days identifier id'>short_days</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='string val'>"Sun"</span><span class='comma token'>,</span> <span class='string val'>"Mon"</span><span class='comma token'>,</span> <span class='string val'>"Tue"</span><span class='comma token'>,</span> <span class='string val'>"Wed"</span><span class='comma token'>,</span> <span class='string val'>"Thu"</span><span class='comma token'>,</span> <span class='string val'>"Fri"</span><span class='comma token'>,</span> <span class='string val'>"Sat"</span><span class='rbrack token'>]</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_short_days identifier id'>short_days</span><span class='dot token'>.</span><span class='rubyid_blank? fid id'>blank?</span>
|
1087
|
+
|
1088
|
+
<span class='rubyid_@date_names ivar id'>@date_names</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span>
|
1089
|
+
<span class='symbol val'>:long_months</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='rubyid_long_months identifier id'>long_months</span><span class='comma token'>,</span>
|
1090
|
+
<span class='symbol val'>:short_months</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='rubyid_short_months identifier id'>short_months</span><span class='comma token'>,</span>
|
1091
|
+
<span class='symbol val'>:long_days</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='rubyid_long_days identifier id'>long_days</span><span class='comma token'>,</span>
|
1092
|
+
<span class='symbol val'>:short_days</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='rubyid_short_days identifier id'>short_days</span>
|
1093
|
+
<span class='rbrace token'>}</span>
|
1094
|
+
<span class='rubyid_end end kw'>end</span>
|
1095
|
+
</pre>
|
1087
1096
|
</td>
|
1088
1097
|
</tr>
|
1089
1098
|
</table>
|
@@ -1222,14 +1231,15 @@
|
|
1222
1231
|
<td>
|
1223
1232
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/settings.rb', line 46</span>
|
1224
1233
|
|
1225
|
-
<span class='kw'>def</span> <span class='
|
1226
|
-
<span class='ivar'>@format_number</span> <span class='
|
1227
|
-
<span class='symbol'>:prec</span> <span class='op'
|
1228
|
-
<span class='symbol'>:decimal_separator</span> <span class='op'
|
1229
|
-
<span class='symbol'>:add_string</span> <span class='op'
|
1230
|
-
<span class='symbol'>:k_separator</span> <span class='op'
|
1231
|
-
<span class='rbrace'>}</span>
|
1232
|
-
<span class='kw'>end</span
|
1234
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_setup_format_number identifier id'>setup_format_number</span><span class='lparen token'>(</span><span class='rubyid_prec identifier id'>prec</span> <span class='assign token'>=</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='rubyid_decimal_separator identifier id'>decimal_separator</span> <span class='assign token'>=</span> <span class='string val'>"."</span><span class='comma token'>,</span> <span class='rubyid_add_string identifier id'>add_string</span> <span class='assign token'>=</span> <span class='string val'>""</span><span class='comma token'>,</span> <span class='rubyid_k_separator identifier id'>k_separator</span> <span class='assign token'>=</span> <span class='string val'>","</span><span class='rparen token'>)</span>
|
1235
|
+
<span class='rubyid_@format_number ivar id'>@format_number</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span>
|
1236
|
+
<span class='symbol val'>:prec</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='rubyid_prec identifier id'>prec</span><span class='comma token'>,</span>
|
1237
|
+
<span class='symbol val'>:decimal_separator</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='rubyid_decimal_separator identifier id'>decimal_separator</span><span class='comma token'>,</span>
|
1238
|
+
<span class='symbol val'>:add_string</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='rubyid_add_string identifier id'>add_string</span><span class='comma token'>,</span>
|
1239
|
+
<span class='symbol val'>:k_separator</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='rubyid_k_separator identifier id'>k_separator</span>
|
1240
|
+
<span class='rbrace token'>}</span>
|
1241
|
+
<span class='rubyid_end end kw'>end</span>
|
1242
|
+
</pre>
|
1233
1243
|
</td>
|
1234
1244
|
</tr>
|
1235
1245
|
</table>
|
@@ -1240,9 +1250,9 @@
|
|
1240
1250
|
</div>
|
1241
1251
|
|
1242
1252
|
<div id="footer">
|
1243
|
-
Generated on
|
1253
|
+
Generated on Fri Jul 20 10:23:57 2012 by
|
1244
1254
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1245
|
-
0.8.2.1 (ruby-1.
|
1255
|
+
0.8.2.1 (ruby-1.8.7).
|
1246
1256
|
</div>
|
1247
1257
|
|
1248
1258
|
</body>
|
@@ -228,9 +228,9 @@
|
|
228
228
|
<div class="discussion">
|
229
229
|
<p>Removes accents from the string, normalizing to the normal letter.</p>
|
230
230
|
|
231
|
-
<pre class="code ruby"><code><span class='
|
232
|
-
<span class='comment'># => "eoau"
|
233
|
-
</
|
231
|
+
<pre class="code ruby"><code><span class='string val'>"èòàù"</span><span class='dot token'>.</span><span class='rubyid_remove_accents identifier id'>remove_accents</span>
|
232
|
+
<span class='comment val'># => "eoau"</span>
|
233
|
+
</code></pre>
|
234
234
|
|
235
235
|
|
236
236
|
</div>
|
@@ -270,11 +270,12 @@
|
|
270
270
|
<td>
|
271
271
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/string.rb', line 21</span>
|
272
272
|
|
273
|
-
<span class='kw'>def</span> <span class='
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
<span class='kw'>end</span
|
273
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_remove_accents identifier id'>remove_accents</span>
|
274
|
+
<span class='rubyid_silence_warnings identifier id'>silence_warnings</span> <span class='lbrace token'>{</span>
|
275
|
+
<span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_mb_chars identifier id'>mb_chars</span><span class='dot token'>.</span><span class='rubyid_normalize identifier id'>normalize</span><span class='lparen token'>(</span><span class='symbol val'>:kd</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='regexp val'>/[^\x00-\x7F]/n</span><span class='comma token'>,</span> <span class='string val'>""</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span>
|
276
|
+
<span class='rbrace token'>}</span>
|
277
|
+
<span class='rubyid_end end kw'>end</span>
|
278
|
+
</pre>
|
278
279
|
</td>
|
279
280
|
</tr>
|
280
281
|
</table>
|
@@ -329,9 +330,10 @@
|
|
329
330
|
<td>
|
330
331
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/string.rb', line 44</span>
|
331
332
|
|
332
|
-
<span class='kw'>def</span> <span class='
|
333
|
-
|
334
|
-
<span class='kw'>end</span
|
333
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_replace_ampersands identifier id'>replace_ampersands</span>
|
334
|
+
<span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='regexp val'>/&amp;(\S+);/</span><span class='comma token'>,</span> <span class='string val'>"&\\1;"</span><span class='rparen token'>)</span>
|
335
|
+
<span class='rubyid_end end kw'>end</span>
|
336
|
+
</pre>
|
335
337
|
</td>
|
336
338
|
</tr>
|
337
339
|
</table>
|
@@ -352,9 +354,9 @@
|
|
352
354
|
|
353
355
|
<p>The string is downcased and spaces are substituted with <code>-</code>.</p>
|
354
356
|
|
355
|
-
<pre class="code ruby"><code><span class='
|
356
|
-
<span class='comment'># => "abc-cde"
|
357
|
-
</
|
357
|
+
<pre class="code ruby"><code><span class='string val'>"ABC cde"</span><span class='dot token'>.</span><span class='rubyid_untitleize identifier id'>untitleize</span>
|
358
|
+
<span class='comment val'># => "abc-cde"</span>
|
359
|
+
</code></pre>
|
358
360
|
|
359
361
|
|
360
362
|
</div>
|
@@ -392,9 +394,10 @@
|
|
392
394
|
<td>
|
393
395
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/string.rb', line 37</span>
|
394
396
|
|
395
|
-
<span class='kw'>def</span> <span class='
|
396
|
-
|
397
|
-
<span class='kw'>end</span
|
397
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_untitleize identifier id'>untitleize</span>
|
398
|
+
<span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_downcase identifier id'>downcase</span><span class='dot token'>.</span><span class='rubyid_gsub identifier id'>gsub</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>
|
399
|
+
<span class='rubyid_end end kw'>end</span>
|
400
|
+
</pre>
|
398
401
|
</td>
|
399
402
|
</tr>
|
400
403
|
</table>
|
@@ -449,9 +452,10 @@
|
|
449
452
|
<td>
|
450
453
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/string.rb', line 51</span>
|
451
454
|
|
452
|
-
<span class='kw'>def</span> <span class='
|
453
|
-
|
454
|
-
<span class='kw'>end</span
|
455
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_value identifier id'>value</span>
|
456
|
+
<span class='rubyid_self self kw'>self</span>
|
457
|
+
<span class='rubyid_end end kw'>end</span>
|
458
|
+
</pre>
|
455
459
|
</td>
|
456
460
|
</tr>
|
457
461
|
</table>
|
@@ -462,9 +466,9 @@
|
|
462
466
|
</div>
|
463
467
|
|
464
468
|
<div id="footer">
|
465
|
-
Generated on
|
469
|
+
Generated on Fri Jul 20 10:23:55 2012 by
|
466
470
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
467
|
-
0.8.2.1 (ruby-1.
|
471
|
+
0.8.2.1 (ruby-1.8.7).
|
468
472
|
</div>
|
469
473
|
|
470
474
|
</body>
|
@@ -432,14 +432,15 @@
|
|
432
432
|
<td>
|
433
433
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 373</span>
|
434
434
|
|
435
|
-
<span class='kw'>def</span> <span class='
|
436
|
-
<span class='
|
435
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_current_offset identifier id'>current_offset</span><span class='lparen token'>(</span><span class='rubyid_rational identifier id'>rational</span> <span class='assign token'>=</span> <span class='rubyid_false false kw'>false</span><span class='comma token'>,</span> <span class='rubyid_date identifier id'>date</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span><span class='rparen token'>)</span>
|
436
|
+
<span class='rubyid_date identifier id'>date</span> <span class='opasgn op'>||=</span> <span class='colon3 op'>::</span><span class='rubyid_DateTime constant id'>DateTime</span><span class='dot token'>.</span><span class='rubyid_now identifier id'>now</span>
|
437
437
|
|
438
|
-
<span class='
|
438
|
+
<span class='rubyid_dst_period identifier id'>dst_period</span> <span class='assign token'>=</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_dst_period identifier id'>dst_period</span>
|
439
439
|
|
440
|
-
<span class='
|
441
|
-
<span class='
|
442
|
-
<span class='kw'>end</span
|
440
|
+
<span class='rubyid_rv identifier id'>rv</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_period_for_utc identifier id'>period_for_utc</span><span class='lparen token'>(</span><span class='rubyid_date identifier id'>date</span><span class='dot token'>.</span><span class='rubyid_utc identifier id'>utc</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_dst? fid id'>dst?</span> <span class='integer val'>? </span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_dst_offset identifier id'>dst_offset</span> <span class='colon op'>:</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_offset identifier id'>offset</span><span class='rparen token'>)</span>
|
441
|
+
<span class='rubyid_rational identifier id'>rational</span> <span class='integer val'>? </span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_class identifier id'>class</span><span class='dot token'>.</span><span class='rubyid_rationalize_offset identifier id'>rationalize_offset</span><span class='lparen token'>(</span><span class='rubyid_rv identifier id'>rv</span><span class='rparen token'>)</span> <span class='colon op'>:</span> <span class='rubyid_rv identifier id'>rv</span>
|
442
|
+
<span class='rubyid_end end kw'>end</span>
|
443
|
+
</pre>
|
443
444
|
</td>
|
444
445
|
</tr>
|
445
446
|
</table>
|
@@ -534,11 +535,12 @@
|
|
534
535
|
<td>
|
535
536
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 419</span>
|
536
537
|
|
537
|
-
<span class='kw'>def</span> <span class='
|
538
|
-
<span class='
|
539
|
-
<span class='
|
540
|
-
<span class='
|
541
|
-
<span class='kw'>end</span
|
538
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_dst_correction identifier id'>dst_correction</span><span class='lparen token'>(</span><span class='rubyid_rational identifier id'>rational</span> <span class='assign token'>=</span> <span class='rubyid_false false kw'>false</span><span class='comma 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>
|
539
|
+
<span class='rubyid_period identifier id'>period</span> <span class='assign token'>=</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_dst_period identifier id'>dst_period</span><span class='lparen token'>(</span><span class='rubyid_year identifier id'>year</span><span class='rparen token'>)</span>
|
540
|
+
<span class='rubyid_rv identifier id'>rv</span> <span class='assign token'>=</span> <span class='rubyid_period identifier id'>period</span> <span class='integer val'>? </span><span class='rubyid_period identifier id'>period</span><span class='dot token'>.</span><span class='rubyid_std_offset identifier id'>std_offset</span> <span class='colon op'>:</span> <span class='integer val'>0</span>
|
541
|
+
<span class='rubyid_rational identifier id'>rational</span> <span class='integer val'>? </span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_class identifier id'>class</span><span class='dot token'>.</span><span class='rubyid_rationalize_offset identifier id'>rationalize_offset</span><span class='lparen token'>(</span><span class='rubyid_rv identifier id'>rv</span><span class='rparen token'>)</span> <span class='colon op'>:</span> <span class='rubyid_rv identifier id'>rv</span>
|
542
|
+
<span class='rubyid_end end kw'>end</span>
|
543
|
+
</pre>
|
542
544
|
</td>
|
543
545
|
</tr>
|
544
546
|
</table>
|
@@ -633,11 +635,12 @@
|
|
633
635
|
<td>
|
634
636
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 430</span>
|
635
637
|
|
636
|
-
<span class='kw'>def</span> <span class='
|
637
|
-
<span class='
|
638
|
-
<span class='
|
639
|
-
<span class='
|
640
|
-
<span class='kw'>end</span
|
638
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_dst_offset identifier id'>dst_offset</span><span class='lparen token'>(</span><span class='rubyid_rational identifier id'>rational</span> <span class='assign token'>=</span> <span class='rubyid_false false kw'>false</span><span class='comma 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>
|
639
|
+
<span class='rubyid_period identifier id'>period</span> <span class='assign token'>=</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_dst_period identifier id'>dst_period</span><span class='lparen token'>(</span><span class='rubyid_year identifier id'>year</span><span class='rparen token'>)</span>
|
640
|
+
<span class='rubyid_rv identifier id'>rv</span> <span class='assign token'>=</span> <span class='rubyid_period identifier id'>period</span> <span class='integer val'>? </span><span class='rubyid_period identifier id'>period</span><span class='dot token'>.</span><span class='rubyid_utc_total_offset identifier id'>utc_total_offset</span> <span class='colon op'>:</span> <span class='integer val'>0</span>
|
641
|
+
<span class='rubyid_rational identifier id'>rational</span> <span class='integer val'>? </span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_class identifier id'>class</span><span class='dot token'>.</span><span class='rubyid_rationalize_offset identifier id'>rationalize_offset</span><span class='lparen token'>(</span><span class='rubyid_rv identifier id'>rv</span><span class='rparen token'>)</span> <span class='colon op'>:</span> <span class='rubyid_rv identifier id'>rv</span>
|
642
|
+
<span class='rubyid_end end kw'>end</span>
|
643
|
+
</pre>
|
641
644
|
</td>
|
642
645
|
</tr>
|
643
646
|
</table>
|
@@ -720,16 +723,17 @@
|
|
720
723
|
<td>
|
721
724
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 395</span>
|
722
725
|
|
723
|
-
<span class='kw'>def</span> <span class='
|
724
|
-
<span class='
|
726
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_dst_period identifier id'>dst_period</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>
|
727
|
+
<span class='rubyid_year identifier id'>year</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>
|
725
728
|
|
726
|
-
<span class='
|
727
|
-
|
728
|
-
|
729
|
-
<span class='
|
730
|
-
<span class='
|
731
|
-
<span class='
|
732
|
-
<span class='kw'>end</span
|
729
|
+
<span class='rubyid_nothern_summer identifier id'>nothern_summer</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_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='integer val'>7</span><span class='comma token'>,</span> <span class='integer val'>15</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_utc identifier id'>utc</span> <span class='comment val'># This is a representation of a summer period in the Northern Hemisphere.</span>
|
730
|
+
<span class='rubyid_southern_summer identifier id'>southern_summer</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_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='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>15</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_utc identifier id'>utc</span> <span class='comment val'># This is a representation of a summer period in the Northern Hemisphere.</span>
|
731
|
+
|
732
|
+
<span class='rubyid_period identifier id'>period</span> <span class='assign token'>=</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_period_for_utc identifier id'>period_for_utc</span><span class='lparen token'>(</span><span class='rubyid_nothern_summer identifier id'>nothern_summer</span><span class='rparen token'>)</span>
|
733
|
+
<span class='rubyid_period identifier id'>period</span> <span class='assign token'>=</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_period_for_utc identifier id'>period_for_utc</span><span class='lparen token'>(</span><span class='rubyid_southern_summer identifier id'>southern_summer</span><span class='rparen token'>)</span> <span class='rubyid_if if_mod kw'>if</span> <span class='notop op'>!</span><span class='rubyid_period identifier id'>period</span><span class='dot token'>.</span><span class='rubyid_dst? fid id'>dst?</span>
|
734
|
+
<span class='rubyid_period identifier id'>period</span><span class='dot token'>.</span><span class='rubyid_dst? fid id'>dst?</span> <span class='integer val'>? </span><span class='rubyid_period identifier id'>period</span> <span class='colon op'>:</span> <span class='rubyid_nil nil kw'>nil</span>
|
735
|
+
<span class='rubyid_end end kw'>end</span>
|
736
|
+
</pre>
|
733
737
|
</td>
|
734
738
|
</tr>
|
735
739
|
</table>
|
@@ -806,10 +810,11 @@
|
|
806
810
|
<td>
|
807
811
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 386</span>
|
808
812
|
|
809
|
-
<span class='kw'>def</span> <span class='
|
810
|
-
<span class='
|
811
|
-
<span class='
|
812
|
-
<span class='kw'>end</span
|
813
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_offset identifier id'>offset</span><span class='lparen token'>(</span><span class='rubyid_rational identifier id'>rational</span> <span class='assign token'>=</span> <span class='rubyid_false false kw'>false</span><span class='rparen token'>)</span>
|
814
|
+
<span class='rubyid_rv identifier id'>rv</span> <span class='assign token'>=</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_utc_offset identifier id'>utc_offset</span>
|
815
|
+
<span class='rubyid_rational identifier id'>rational</span> <span class='integer val'>? </span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_class identifier id'>class</span><span class='dot token'>.</span><span class='rubyid_rationalize_offset identifier id'>rationalize_offset</span><span class='lparen token'>(</span><span class='rubyid_rv identifier id'>rv</span><span class='rparen token'>)</span> <span class='colon op'>:</span> <span class='rubyid_rv identifier id'>rv</span>
|
816
|
+
<span class='rubyid_end end kw'>end</span>
|
817
|
+
</pre>
|
813
818
|
</td>
|
814
819
|
</tr>
|
815
820
|
</table>
|
@@ -885,9 +890,10 @@
|
|
885
890
|
<td>
|
886
891
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 457</span>
|
887
892
|
|
888
|
-
<span class='kw'>def</span> <span class='
|
889
|
-
<span class='op'>::</span><span class='
|
890
|
-
<span class='kw'>end</span
|
893
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_to_s_parameterized identifier id'>to_s_parameterized</span><span class='lparen 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>
|
894
|
+
<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_parameterize_zone identifier id'>parameterize_zone</span><span class='lparen token'>(</span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span><span class='comma token'>,</span> <span class='rubyid_with_offset identifier id'>with_offset</span><span class='rparen token'>)</span>
|
895
|
+
<span class='rubyid_end end kw'>end</span>
|
896
|
+
</pre>
|
891
897
|
</td>
|
892
898
|
</tr>
|
893
899
|
</table>
|
@@ -988,17 +994,18 @@
|
|
988
994
|
<td>
|
989
995
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 441</span>
|
990
996
|
|
991
|
-
<span class='kw'>def</span> <span class='
|
992
|
-
<span class='
|
993
|
-
|
994
|
-
<span class='kw'>if</span> <span class='kw'>self</span><span class='
|
995
|
-
<span class='
|
996
|
-
<span class='
|
997
|
-
<span class='
|
998
|
-
<span class='kw'>else</span>
|
999
|
-
<span class='kw'>nil</span>
|
1000
|
-
<span class='kw'>end</span>
|
1001
|
-
<span class='kw'>end</span
|
997
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_to_s_with_dst identifier id'>to_s_with_dst</span><span class='lparen 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='comma 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>
|
998
|
+
<span class='rubyid_dst_label identifier id'>dst_label</span> <span class='opasgn op'>||=</span> <span class='string val'>"(Daylight Saving Time)"</span>
|
999
|
+
|
1000
|
+
<span class='rubyid_if if kw'>if</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_uses_dst? fid id'>uses_dst?</span><span class='lparen token'>(</span><span class='rubyid_year identifier id'>year</span><span class='rparen token'>)</span> <span class='rubyid_then then kw'>then</span>
|
1001
|
+
<span class='rubyid_period identifier id'>period</span> <span class='assign token'>=</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_dst_period identifier id'>dst_period</span><span class='lparen token'>(</span><span class='rubyid_year identifier id'>year</span><span class='rparen token'>)</span>
|
1002
|
+
<span class='rubyid_offset identifier id'>offset</span> <span class='assign token'>=</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_class identifier id'>class</span><span class='dot token'>.</span><span class='rubyid_seconds_to_utc_offset identifier id'>seconds_to_utc_offset</span><span class='lparen token'>(</span><span class='rubyid_period identifier id'>period</span><span class='dot token'>.</span><span class='rubyid_utc_total_offset identifier id'>utc_total_offset</span><span class='rparen token'>)</span>
|
1003
|
+
<span class='dstring node'>"(GMT#{offset}) #{name} #{dst_label}"</span>
|
1004
|
+
<span class='rubyid_else else kw'>else</span>
|
1005
|
+
<span class='rubyid_nil nil kw'>nil</span>
|
1006
|
+
<span class='rubyid_end end kw'>end</span>
|
1007
|
+
<span class='rubyid_end end kw'>end</span>
|
1008
|
+
</pre>
|
1002
1009
|
</td>
|
1003
1010
|
</tr>
|
1004
1011
|
</table>
|
@@ -1109,10 +1116,11 @@
|
|
1109
1116
|
<td>
|
1110
1117
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 467</span>
|
1111
1118
|
|
1112
|
-
<span class='kw'>def</span> <span class='
|
1113
|
-
<span class='
|
1114
|
-
<span class='
|
1115
|
-
<span class='kw'>end</span
|
1119
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_to_s_with_dst_parameterized identifier id'>to_s_with_dst_parameterized</span><span class='lparen 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='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='comma 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>
|
1120
|
+
<span class='rubyid_rv identifier id'>rv</span> <span class='assign token'>=</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_to_s_with_dst identifier id'>to_s_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_year identifier id'>year</span><span class='rparen token'>)</span>
|
1121
|
+
<span class='rubyid_rv identifier id'>rv</span> <span class='integer val'>? </span><span class='colon2 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_parameterize_zone identifier id'>parameterize_zone</span><span class='lparen token'>(</span><span class='rubyid_rv identifier id'>rv</span><span class='rparen token'>)</span> <span class='colon op'>:</span> <span class='rubyid_nil nil kw'>nil</span>
|
1122
|
+
<span class='rubyid_end end kw'>end</span>
|
1123
|
+
</pre>
|
1116
1124
|
</td>
|
1117
1125
|
</tr>
|
1118
1126
|
</table>
|
@@ -1188,9 +1196,10 @@
|
|
1188
1196
|
<td>
|
1189
1197
|
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 410</span>
|
1190
1198
|
|
1191
|
-
<span class='kw'>def</span> <span class='
|
1192
|
-
<span class='kw'>self</span><span class='
|
1193
|
-
<span class='kw'>end</span
|
1199
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_uses_dst? fid id'>uses_dst?</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>
|
1200
|
+
<span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_dst_period identifier id'>dst_period</span><span class='lparen token'>(</span><span class='rubyid_year identifier id'>year</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_present? fid id'>present?</span>
|
1201
|
+
<span class='rubyid_end end kw'>end</span>
|
1202
|
+
</pre>
|
1194
1203
|
</td>
|
1195
1204
|
</tr>
|
1196
1205
|
</table>
|
@@ -1201,9 +1210,9 @@
|
|
1201
1210
|
</div>
|
1202
1211
|
|
1203
1212
|
<div id="footer">
|
1204
|
-
Generated on
|
1213
|
+
Generated on Fri Jul 20 10:23:57 2012 by
|
1205
1214
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1206
|
-
0.8.2.1 (ruby-1.
|
1215
|
+
0.8.2.1 (ruby-1.8.7).
|
1207
1216
|
</div>
|
1208
1217
|
|
1209
1218
|
</body>
|