time-lord 0.2.5 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. data/.gitignore +34 -4
  2. data/.rvmrc +38 -34
  3. data/.travis.yml +5 -0
  4. data/COPYRIGHT +19 -16
  5. data/README.md +46 -22
  6. data/Rakefile +30 -1
  7. data/lib/time-lord.rb +6 -81
  8. data/lib/time-lord/extensions/integer.rb +16 -0
  9. data/lib/time-lord/extensions/time.rb +5 -0
  10. data/lib/time-lord/period.rb +54 -0
  11. data/lib/time-lord/scale.rb +49 -0
  12. data/lib/time-lord/time.rb +13 -0
  13. data/lib/time-lord/units.rb +11 -0
  14. data/lib/time-lord/units/business.rb +6 -0
  15. data/lib/time-lord/units/long.rb +11 -0
  16. data/lib/time-lord/units/special.rb +8 -0
  17. data/lib/time-lord/version.rb +1 -1
  18. data/test/helper.rb +1 -3
  19. data/test/lib/time-lord/extentions/integer_test.rb +24 -0
  20. data/test/lib/time-lord/extentions/time_test.rb +30 -0
  21. data/test/lib/time-lord/period_test.rb +50 -0
  22. data/test/lib/time-lord/scale_test.rb +34 -0
  23. data/test/lib/time-lord/time_test.rb +32 -0
  24. data/test/lib/time-lord_test.rb +12 -0
  25. data/time-lord.gemspec +22 -18
  26. metadata +87 -30
  27. data/.yardoc/checksums +0 -2
  28. data/.yardoc/objects/root.dat +0 -0
  29. data/.yardoc/proxy_types +0 -2
  30. data/doc/Time.html +0 -290
  31. data/doc/TimeLord.html +0 -93
  32. data/doc/_index.html +0 -100
  33. data/doc/class_list.html +0 -36
  34. data/doc/css/common.css +0 -1
  35. data/doc/css/full_list.css +0 -53
  36. data/doc/css/style.css +0 -318
  37. data/doc/file.README.html +0 -104
  38. data/doc/file_list.html +0 -38
  39. data/doc/frames.html +0 -13
  40. data/doc/index.html +0 -104
  41. data/doc/js/app.js +0 -203
  42. data/doc/js/full_list.js +0 -149
  43. data/doc/js/jquery.js +0 -16
  44. data/doc/method_list.html +0 -43
  45. data/doc/top-level-namespace.html +0 -90
@@ -1,2 +0,0 @@
1
- lib/time-lord.rb 93a21229aaa27912f8fbaf8113232f9299a94c04
2
- lib/time-lord/version.rb 1d4a7d9f645c106306ef4700a69712b6ede43db0
Binary file
@@ -1,2 +0,0 @@
1
- {I" Object:EF:
2
- class
@@ -1,290 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
- <title>Class: Time</title>
7
- <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
8
- <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
9
-
10
- <script type="text/javascript" charset="utf-8">
11
- relpath = '';
12
- if (relpath != '') relpath += '/';
13
- </script>
14
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
15
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
16
-
17
- </head>
18
- <body>
19
- <script type="text/javascript" charset="utf-8">
20
- if (window.top.frames.main) document.body.className = 'frames';
21
- </script>
22
-
23
- <div id="header">
24
- <div id="menu">
25
-
26
- <a href="_index.html">Index (T)</a> &raquo;
27
-
28
-
29
- <span class="title">Time</span>
30
-
31
-
32
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
33
- </div>
34
-
35
- <div id="search">
36
- <a id="class_list_link" href="#">Class List</a>
37
- <a id="method_list_link" href="#">Method List</a>
38
- <a id ="file_list_link" href="#">File List</a>
39
- </div>
40
-
41
- <div class="clear"></div>
42
- </div>
43
-
44
- <iframe id="search_frame"></iframe>
45
-
46
- <div id="content"><h1>Class: Time
47
-
48
-
49
-
50
- </h1>
51
-
52
- <dl class="box">
53
-
54
- <dt class="r1">Inherits:</dt>
55
- <dd class="r1">
56
- <span class="inheritName">Object</span>
57
-
58
- <ul class="fullTree">
59
- <li>Object</li>
60
-
61
- <li class="next">Time</li>
62
-
63
- </ul>
64
- <a href="#" class="inheritanceTree">show all</a>
65
-
66
- </dd>
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
- <dt class="r2 last">Defined in:</dt>
77
- <dd class="r2 last">lib/time-lord.rb</dd>
78
-
79
- </dl>
80
- <div class="clear"></div>
81
-
82
-
83
- <h2>Constant Summary</h2>
84
-
85
- <dl class="constants">
86
-
87
- <dt id="Second-constant" class="">Second =
88
-
89
- </dt>
90
- <dd><pre class="code"><span class='int'>1</span></pre></dd>
91
-
92
- <dt id="Minute-constant" class="">Minute =
93
-
94
- </dt>
95
- <dd><pre class="code"><span class='const'>Second</span> <span class='op'>*</span> <span class='int'>60</span></pre></dd>
96
-
97
- <dt id="Hour-constant" class="">Hour =
98
-
99
- </dt>
100
- <dd><pre class="code"><span class='const'>Minute</span> <span class='op'>*</span> <span class='int'>60</span></pre></dd>
101
-
102
- <dt id="Day-constant" class="">Day =
103
-
104
- </dt>
105
- <dd><pre class="code"><span class='const'>Hour</span> <span class='op'>*</span> <span class='int'>24</span></pre></dd>
106
-
107
- <dt id="Week-constant" class="">Week =
108
-
109
- </dt>
110
- <dd><pre class="code"><span class='const'>Day</span> <span class='op'>*</span> <span class='int'>7</span></pre></dd>
111
-
112
- <dt id="Fortnight-constant" class="">Fortnight =
113
-
114
- </dt>
115
- <dd><pre class="code"><span class='const'>Week</span> <span class='op'>*</span> <span class='int'>2</span></pre></dd>
116
-
117
- <dt id="Month-constant" class="">Month =
118
-
119
- </dt>
120
- <dd><pre class="code"><span class='const'>Week</span> <span class='op'>*</span> <span class='int'>4</span></pre></dd>
121
-
122
- <dt id="Quarter-constant" class="">Quarter =
123
-
124
- </dt>
125
- <dd><pre class="code"><span class='const'>Month</span> <span class='op'>*</span> <span class='int'>3</span></pre></dd>
126
-
127
- <dt id="Year-constant" class="">Year =
128
-
129
- </dt>
130
- <dd><pre class="code"><span class='const'>Month</span> <span class='op'>*</span> <span class='int'>12</span></pre></dd>
131
-
132
- <dt id="Olympiad-constant" class="">Olympiad =
133
-
134
- </dt>
135
- <dd><pre class="code"><span class='const'>Year</span> <span class='op'>*</span> <span class='int'>4</span></pre></dd>
136
-
137
- <dt id="Lustrum-constant" class="">Lustrum =
138
-
139
- </dt>
140
- <dd><pre class="code"><span class='const'>Year</span> <span class='op'>*</span> <span class='int'>5</span></pre></dd>
141
-
142
- <dt id="Decade-constant" class="">Decade =
143
-
144
- </dt>
145
- <dd><pre class="code"><span class='const'>Year</span> <span class='op'>*</span> <span class='int'>10</span></pre></dd>
146
-
147
- <dt id="Indiction-constant" class="">Indiction =
148
-
149
- </dt>
150
- <dd><pre class="code"><span class='const'>Year</span> <span class='op'>*</span> <span class='int'>15</span></pre></dd>
151
-
152
- <dt id="Jubilee-constant" class="">Jubilee =
153
-
154
- </dt>
155
- <dd><pre class="code"><span class='const'>Decade</span> <span class='op'>*</span> <span class='int'>5</span></pre></dd>
156
-
157
- <dt id="Century-constant" class="">Century =
158
-
159
- </dt>
160
- <dd><pre class="code"><span class='const'>Decade</span> <span class='op'>*</span> <span class='int'>10</span></pre></dd>
161
-
162
- <dt id="Millennium-constant" class="">Millennium =
163
-
164
- </dt>
165
- <dd><pre class="code"><span class='const'>Century</span> <span class='op'>*</span> <span class='int'>10</span></pre></dd>
166
-
167
- <dt id="Eon-constant" class="">Eon =
168
-
169
- </dt>
170
- <dd><pre class="code"><span class='float'>1.0</span><span class='op'>/</span><span class='int'>0</span></pre></dd>
171
-
172
- </dl>
173
-
174
-
175
-
176
-
177
-
178
- <h2>
179
- Instance Method Summary
180
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
181
- </h2>
182
-
183
- <ul class="summary">
184
-
185
- <li class="public ">
186
- <span class="summary_signature">
187
-
188
- <a href="#ago_in_words-instance_method" title="#ago_in_words (instance method)">- (Object) <strong>ago_in_words</strong> </a>
189
-
190
-
191
-
192
- (also: #time_ago_in_words)
193
-
194
- </span>
195
-
196
-
197
-
198
-
199
-
200
-
201
-
202
-
203
- <span class="summary_desc"><div class='inline'></div></span>
204
-
205
- </li>
206
-
207
-
208
- </ul>
209
-
210
-
211
-
212
-
213
- <div id="instance_method_details" class="method_details_list">
214
- <h2>Instance Method Details</h2>
215
-
216
-
217
- <div class="method_details first">
218
- <p class="signature first" id="ago_in_words-instance_method">
219
-
220
- - (<tt>Object</tt>) <strong>ago_in_words</strong>
221
-
222
-
223
-
224
- <span class="aliases">Also known as:
225
- <span class="names"><span id='time_ago_in_words-instance_method'>time_ago_in_words</span></span>
226
- </span>
227
-
228
- </p><table class="source_code">
229
- <tr>
230
- <td>
231
- <pre class="lines">
232
-
233
-
234
- 22
235
- 23
236
- 24
237
- 25
238
- 26
239
- 27
240
- 28
241
- 29
242
- 30
243
- 31
244
- 32
245
- 33
246
- 34
247
- 35
248
- 36
249
- 37
250
- 38
251
- 39</pre>
252
- </td>
253
- <td>
254
- <pre class="code"><span class="info file"># File 'lib/time-lord.rb', line 22</span>
255
-
256
- <span class='kw'>def</span> <span class='id ago_in_words'>ago_in_words</span>
257
-
258
- <span class='comment'># Find the time difference between the time provided and the current time.
259
- </span> <span class='id difference'>difference</span> <span class='op'>=</span> <span class='id get_time_difference_from'>get_time_difference_from</span> <span class='kw'>self</span>
260
-
261
- <span class='comment'># Catch less than 1 second differences.
262
- </span> <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>just now</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id difference'>difference</span> <span class='op'>&lt;</span> <span class='int'>1</span>
263
-
264
- <span class='id name'>name</span> <span class='op'>=</span> <span class='id get_unit_name_from'>get_unit_name_from</span> <span class='id difference'>difference</span>
265
- <span class='id amount'>amount</span> <span class='op'>=</span> <span class='id get_unit_amount_from'>get_unit_amount_from</span> <span class='id difference'>difference</span>
266
- <span class='id count'>count</span> <span class='op'>=</span> <span class='id get_unit_count_from'>get_unit_count_from</span> <span class='id difference'>difference</span><span class='comma'>,</span> <span class='id amount'>amount</span>
267
-
268
- <span class='comment'># Determine if unit name needs pluralization.
269
- </span> <span class='id name'>name</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>s</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id count'>count</span> <span class='op'>&gt;</span> <span class='int'>1</span>
270
-
271
- <span class='comment'># Return the remaining string.
272
- </span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id count'>count</span><span class='rbrace'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> ago</span><span class='tstring_end'>&quot;</span></span>
273
- <span class='kw'>end</span></pre>
274
- </td>
275
- </tr>
276
- </table>
277
- </div>
278
-
279
- </div>
280
-
281
- </div>
282
-
283
- <div id="footer">
284
- Generated on Wed Mar 16 02:14:43 2011 by
285
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
286
- 0.6.5 (ruby-1.9.2).
287
- </div>
288
-
289
- </body>
290
- </html>
@@ -1,93 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
- <title>Module: TimeLord</title>
7
- <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
8
- <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
9
-
10
- <script type="text/javascript" charset="utf-8">
11
- relpath = '';
12
- if (relpath != '') relpath += '/';
13
- </script>
14
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
15
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
16
-
17
- </head>
18
- <body>
19
- <script type="text/javascript" charset="utf-8">
20
- if (window.top.frames.main) document.body.className = 'frames';
21
- </script>
22
-
23
- <div id="header">
24
- <div id="menu">
25
-
26
- <a href="_index.html">Index (T)</a> &raquo;
27
-
28
-
29
- <span class="title">TimeLord</span>
30
-
31
-
32
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
33
- </div>
34
-
35
- <div id="search">
36
- <a id="class_list_link" href="#">Class List</a>
37
- <a id="method_list_link" href="#">Method List</a>
38
- <a id ="file_list_link" href="#">File List</a>
39
- </div>
40
-
41
- <div class="clear"></div>
42
- </div>
43
-
44
- <iframe id="search_frame"></iframe>
45
-
46
- <div id="content"><h1>Module: TimeLord
47
-
48
-
49
-
50
- </h1>
51
-
52
- <dl class="box">
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
-
61
- <dt class="r1 last">Defined in:</dt>
62
- <dd class="r1 last">lib/time-lord/version.rb</dd>
63
-
64
- </dl>
65
- <div class="clear"></div>
66
-
67
-
68
- <h2>Constant Summary</h2>
69
-
70
- <dl class="constants">
71
-
72
- <dt id="VERSION-constant" class="">VERSION =
73
-
74
- </dt>
75
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>0.1.5</span><span class='tstring_end'>&quot;</span></span></pre></dd>
76
-
77
- </dl>
78
-
79
-
80
-
81
-
82
-
83
-
84
- </div>
85
-
86
- <div id="footer">
87
- Generated on Wed Mar 16 02:14:43 2011 by
88
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
89
- 0.6.5 (ruby-1.9.2).
90
- </div>
91
-
92
- </body>
93
- </html>
@@ -1,100 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
- <title>Documentation by YARD 0.6.5</title>
7
- <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
8
- <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
9
-
10
- <script type="text/javascript" charset="utf-8">
11
- relpath = '';
12
- if (relpath != '') relpath += '/';
13
- </script>
14
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
15
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
16
-
17
- </head>
18
- <body>
19
- <script type="text/javascript" charset="utf-8">
20
- if (window.top.frames.main) document.body.className = 'frames';
21
- </script>
22
-
23
- <div id="header">
24
- <div id="menu">
25
-
26
-
27
- <span class="title"></span>
28
-
29
-
30
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
31
- </div>
32
-
33
- <div id="search">
34
- <a id="class_list_link" href="#">Class List</a>
35
- <a id="method_list_link" href="#">Method List</a>
36
- <a id ="file_list_link" href="#">File List</a>
37
- </div>
38
-
39
- <div class="clear"></div>
40
- </div>
41
-
42
- <iframe id="search_frame"></iframe>
43
-
44
- <div id="content"><h1 class="noborder title">Documentation by YARD 0.6.5</h1>
45
- <div id="listing">
46
- <h1 class="alphaindex">Alphabetic Index</h1>
47
-
48
- <h2>File Listing</h2>
49
- <ul id="files">
50
-
51
-
52
- <li class="r1"><a href="index.html" title="README">README</a></li>
53
-
54
-
55
- </ul>
56
-
57
- <div class="clear"></div>
58
- <h2>Namespace Listing A-Z</h2>
59
-
60
-
61
-
62
-
63
- <table>
64
- <tr>
65
- <td valign='top' width="33%">
66
-
67
-
68
- <ul id="alpha_T" class="alpha">
69
- <li class="letter">T</li>
70
- <ul>
71
-
72
- <li>
73
- <span class='object_link'><a href="Time.html" title="Time (class)">Time</a></span>
74
-
75
- </li>
76
-
77
- <li>
78
- <span class='object_link'><a href="TimeLord.html" title="TimeLord (module)">TimeLord</a></span>
79
-
80
- </li>
81
-
82
- </ul>
83
- </ul>
84
-
85
- </td>
86
- </tr>
87
- </table>
88
-
89
- </div>
90
-
91
- </div>
92
-
93
- <div id="footer">
94
- Generated on Wed Mar 16 02:14:43 2011 by
95
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
96
- 0.6.5 (ruby-1.9.2).
97
- </div>
98
-
99
- </body>
100
- </html>