cowtech-extensions 2.1.3 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. data/.gitignore +1 -0
  2. data/.yardopts +1 -0
  3. data/README.md +10 -0
  4. data/Rakefile +6 -3
  5. data/cowtech-extensions.gemspec +9 -5
  6. data/doc/Cowtech.html +128 -0
  7. data/doc/Cowtech/Extensions.html +546 -0
  8. data/doc/Cowtech/Extensions/Boolean.html +297 -0
  9. data/doc/Cowtech/Extensions/DateTime.html +787 -0
  10. data/doc/Cowtech/Extensions/DateTime/ClassMethods.html +1592 -0
  11. data/doc/Cowtech/Extensions/Exceptions.html +125 -0
  12. data/doc/Cowtech/Extensions/Exceptions/Dump.html +133 -0
  13. data/doc/Cowtech/Extensions/Hash.html +393 -0
  14. data/doc/Cowtech/Extensions/Math.html +130 -0
  15. data/doc/Cowtech/Extensions/Math/ClassMethods.html +362 -0
  16. data/doc/Cowtech/Extensions/Object.html +1565 -0
  17. data/doc/Cowtech/Extensions/Pathname.html +225 -0
  18. data/doc/Cowtech/Extensions/Settings.html +1249 -0
  19. data/doc/Cowtech/Extensions/String.html +471 -0
  20. data/doc/Cowtech/Extensions/TimeZone.html +1210 -0
  21. data/doc/Cowtech/Extensions/TimeZone/ClassMethods.html +925 -0
  22. data/doc/Cowtech/Extensions/Version.html +189 -0
  23. data/doc/_index.html +305 -0
  24. data/doc/class_list.html +53 -0
  25. data/doc/css/common.css +1 -0
  26. data/doc/css/full_list.css +57 -0
  27. data/doc/css/style.css +328 -0
  28. data/doc/file.README.html +103 -0
  29. data/doc/file_list.html +55 -0
  30. data/doc/frames.html +28 -0
  31. data/doc/index.html +103 -0
  32. data/doc/js/app.js +214 -0
  33. data/doc/js/full_list.js +173 -0
  34. data/doc/js/jquery.js +4 -0
  35. data/doc/method_list.html +620 -0
  36. data/doc/top-level-namespace.html +112 -0
  37. data/lib/cowtech-extensions.rb +47 -16
  38. data/lib/cowtech-extensions/boolean.rb +8 -1
  39. data/lib/cowtech-extensions/datetime.rb +377 -71
  40. data/lib/cowtech-extensions/exceptions.rb +16 -0
  41. data/lib/cowtech-extensions/hash.rb +20 -9
  42. data/lib/cowtech-extensions/math.rb +15 -8
  43. data/lib/cowtech-extensions/object.rb +84 -27
  44. data/lib/cowtech-extensions/pathname.rb +10 -1
  45. data/lib/cowtech-extensions/settings.rb +120 -0
  46. data/lib/cowtech-extensions/string.rb +30 -3
  47. data/lib/cowtech-extensions/version.rb +11 -2
  48. data/spec/coverage_helper.rb +19 -0
  49. data/spec/cowtech-extensions/boolean_spec.rb +4 -0
  50. data/spec/cowtech-extensions/datetime_spec.rb +238 -79
  51. data/spec/cowtech-extensions/hash_spec.rb +5 -2
  52. data/spec/cowtech-extensions/math_spec.rb +14 -4
  53. data/spec/cowtech-extensions/object_spec.rb +19 -1
  54. data/spec/cowtech-extensions/pathname_spec.rb +5 -1
  55. data/spec/cowtech-extensions/settings_spec.rb +101 -0
  56. data/spec/cowtech-extensions/string_spec.rb +13 -0
  57. data/spec/cowtech-extensions_spec.rb +33 -13
  58. data/spec/spec_helper.rb +2 -5
  59. metadata +182 -97
  60. data/lib/cowtech-extensions/utils.rb +0 -74
@@ -0,0 +1,130 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Module: Cowtech::Extensions::Math
8
+
9
+ &mdash; Documentation by YARD 0.8.2.1
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../../';
20
+ framesUrl = "../../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../../_index.html">Index (M)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../Cowtech.html" title="Cowtech (module)">Cowtech</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Extensions.html" title="Cowtech::Extensions (module)">Extensions</a></span></span>
36
+ &raquo;
37
+ <span class="title">Math</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Module: Cowtech::Extensions::Math
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+ <dt class="r1">Extended by:</dt>
77
+ <dd class="r1">ActiveSupport::Concern</dd>
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+ <dt class="r2 last">Defined in:</dt>
86
+ <dd class="r2 last">lib/cowtech-extensions/math.rb</dd>
87
+
88
+ </dl>
89
+ <div class="clear"></div>
90
+
91
+ <h2>Overview</h2><div class="docstring">
92
+ <div class="discussion">
93
+ <p>Utility methods for Math module.</p>
94
+
95
+
96
+ </div>
97
+ </div>
98
+ <div class="tags">
99
+
100
+
101
+ </div><h2>Defined Under Namespace</h2>
102
+ <p class="children">
103
+
104
+
105
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Math/ClassMethods.html" title="Cowtech::Extensions::Math::ClassMethods (module)">ClassMethods</a></span>
106
+
107
+
108
+
109
+
110
+ </p>
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+ </div>
122
+
123
+ <div id="footer">
124
+ Generated on Thu Jul 19 17:17:50 2012 by
125
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
126
+ 0.8.2.1 (ruby-1.9.2).
127
+ </div>
128
+
129
+ </body>
130
+ </html>
@@ -0,0 +1,362 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Module: Cowtech::Extensions::Math::ClassMethods
8
+
9
+ &mdash; Documentation by YARD 0.8.2.1
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../../../';
20
+ framesUrl = "../../../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../../../_index.html">Index (C)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../../Cowtech.html" title="Cowtech (module)">Cowtech</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../Extensions.html" title="Cowtech::Extensions (module)">Extensions</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Math.html" title="Cowtech::Extensions::Math (module)">Math</a></span></span>
36
+ &raquo;
37
+ <span class="title">ClassMethods</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../../../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../../../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../../../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Module: Cowtech::Extensions::Math::ClassMethods
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ <dt class="r1 last">Defined in:</dt>
82
+ <dd class="r1 last">lib/cowtech-extensions/math.rb</dd>
83
+
84
+ </dl>
85
+ <div class="clear"></div>
86
+
87
+ <h2>Overview</h2><div class="docstring">
88
+ <div class="discussion">
89
+ <p>General methods.</p>
90
+
91
+
92
+ </div>
93
+ </div>
94
+ <div class="tags">
95
+
96
+
97
+ </div>
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+ <h2>
106
+ Instance Method Summary
107
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
108
+ </h2>
109
+
110
+ <ul class="summary">
111
+
112
+ <li class="public ">
113
+ <span class="summary_signature">
114
+
115
+ <a href="#max-instance_method" title="#max (instance method)">- (Object) <strong>max</strong>(*args) </a>
116
+
117
+
118
+
119
+ </span>
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+ <span class="summary_desc"><div class='inline'><p>Returns the maximum value in the arguments.</p>
130
+ </div></span>
131
+
132
+ </li>
133
+
134
+
135
+ <li class="public ">
136
+ <span class="summary_signature">
137
+
138
+ <a href="#min-instance_method" title="#min (instance method)">- (Object) <strong>min</strong>(*args) </a>
139
+
140
+
141
+
142
+ </span>
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+ <span class="summary_desc"><div class='inline'><p>Returns the minimum value in the arguments.</p>
153
+ </div></span>
154
+
155
+ </li>
156
+
157
+
158
+ </ul>
159
+
160
+
161
+
162
+
163
+ <div id="instance_method_details" class="method_details_list">
164
+ <h2>Instance Method Details</h2>
165
+
166
+
167
+ <div class="method_details first">
168
+ <h3 class="signature first" id="max-instance_method">
169
+
170
+ - (<tt><span class='object_link'><a href="../Object.html" title="Cowtech::Extensions::Object (module)">Object</a></span></tt>) <strong>max</strong>(*args)
171
+
172
+
173
+
174
+
175
+
176
+ </h3><div class="docstring">
177
+ <div class="discussion">
178
+ <p>Returns the maximum value in the arguments</p>
179
+
180
+
181
+ </div>
182
+ </div>
183
+ <div class="tags">
184
+ <p class="tag_title">Parameters:</p>
185
+ <ul class="param">
186
+
187
+ <li>
188
+
189
+ <span class='name'>args</span>
190
+
191
+
192
+ <span class='type'>(<tt>Array</tt>)</span>
193
+
194
+
195
+
196
+ &mdash;
197
+ <div class='inline'><p>A collection of object to compare (with the <code>&gt;</code> operator).</p>
198
+ </div>
199
+
200
+ </li>
201
+
202
+ </ul>
203
+
204
+ <p class="tag_title">Returns:</p>
205
+ <ul class="return">
206
+
207
+ <li>
208
+
209
+
210
+ <span class='type'>(<tt><span class='object_link'><a href="../Object.html" title="Cowtech::Extensions::Object (module)">Object</a></span></tt>)</span>
211
+
212
+
213
+
214
+ &mdash;
215
+ <div class='inline'><p>The maximum value or <code>nil</code> (if the collection is empty).</p>
216
+ </div>
217
+
218
+ </li>
219
+
220
+ </ul>
221
+
222
+ </div><table class="source_code">
223
+ <tr>
224
+ <td>
225
+ <pre class="lines">
226
+
227
+
228
+ 35
229
+ 36
230
+ 37
231
+ 38
232
+ 39
233
+ 40
234
+ 41
235
+ 42
236
+ 43
237
+ 44
238
+ 45</pre>
239
+ </td>
240
+ <td>
241
+ <pre class="code"><span class="info file"># File 'lib/cowtech-extensions/math.rb', line 35</span>
242
+
243
+ <span class='kw'>def</span> <span class='id identifier rubyid_max'>max</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
244
+ <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>nil</span>
245
+
246
+ <span class='id identifier rubyid_args'>args</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
247
+ <span class='kw'>if</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>&gt;</span> <span class='int'>0</span> <span class='kw'>then</span>
248
+ <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
249
+ <span class='id identifier rubyid_args'>args</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_a'>a</span><span class='op'>|</span> <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_a'>a</span> <span class='kw'>if</span> <span class='id identifier rubyid_a'>a</span> <span class='op'>&gt;</span> <span class='id identifier rubyid_rv'>rv</span> <span class='kw'>end</span>
250
+ <span class='kw'>end</span>
251
+
252
+ <span class='id identifier rubyid_rv'>rv</span>
253
+ <span class='kw'>end</span></pre>
254
+ </td>
255
+ </tr>
256
+ </table>
257
+ </div>
258
+
259
+ <div class="method_details ">
260
+ <h3 class="signature " id="min-instance_method">
261
+
262
+ - (<tt><span class='object_link'><a href="../Object.html" title="Cowtech::Extensions::Object (module)">Object</a></span></tt>) <strong>min</strong>(*args)
263
+
264
+
265
+
266
+
267
+
268
+ </h3><div class="docstring">
269
+ <div class="discussion">
270
+ <p>Returns the minimum value in the arguments</p>
271
+
272
+
273
+ </div>
274
+ </div>
275
+ <div class="tags">
276
+ <p class="tag_title">Parameters:</p>
277
+ <ul class="param">
278
+
279
+ <li>
280
+
281
+ <span class='name'>args</span>
282
+
283
+
284
+ <span class='type'>(<tt>Array</tt>)</span>
285
+
286
+
287
+
288
+ &mdash;
289
+ <div class='inline'><p>A collection of object to compare (with the <code>&lt;</code> operator).</p>
290
+ </div>
291
+
292
+ </li>
293
+
294
+ </ul>
295
+
296
+ <p class="tag_title">Returns:</p>
297
+ <ul class="return">
298
+
299
+ <li>
300
+
301
+
302
+ <span class='type'>(<tt><span class='object_link'><a href="../Object.html" title="Cowtech::Extensions::Object (module)">Object</a></span></tt>)</span>
303
+
304
+
305
+
306
+ &mdash;
307
+ <div class='inline'><p>The minimum value or <code>nil</code> (if the collection is empty).</p>
308
+ </div>
309
+
310
+ </li>
311
+
312
+ </ul>
313
+
314
+ </div><table class="source_code">
315
+ <tr>
316
+ <td>
317
+ <pre class="lines">
318
+
319
+
320
+ 19
321
+ 20
322
+ 21
323
+ 22
324
+ 23
325
+ 24
326
+ 25
327
+ 26
328
+ 27
329
+ 28
330
+ 29</pre>
331
+ </td>
332
+ <td>
333
+ <pre class="code"><span class="info file"># File 'lib/cowtech-extensions/math.rb', line 19</span>
334
+
335
+ <span class='kw'>def</span> <span class='id identifier rubyid_min'>min</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
336
+ <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>nil</span>
337
+
338
+ <span class='id identifier rubyid_args'>args</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
339
+ <span class='kw'>if</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>&gt;</span> <span class='int'>0</span> <span class='kw'>then</span>
340
+ <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
341
+ <span class='id identifier rubyid_args'>args</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_a'>a</span><span class='op'>|</span> <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_a'>a</span> <span class='kw'>if</span> <span class='id identifier rubyid_a'>a</span> <span class='op'>&lt;</span> <span class='id identifier rubyid_rv'>rv</span> <span class='kw'>end</span>
342
+ <span class='kw'>end</span>
343
+
344
+ <span class='id identifier rubyid_rv'>rv</span>
345
+ <span class='kw'>end</span></pre>
346
+ </td>
347
+ </tr>
348
+ </table>
349
+ </div>
350
+
351
+ </div>
352
+
353
+ </div>
354
+
355
+ <div id="footer">
356
+ Generated on Thu Jul 19 17:17:50 2012 by
357
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
358
+ 0.8.2.1 (ruby-1.9.2).
359
+ </div>
360
+
361
+ </body>
362
+ </html>