timeline_setter 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/.document +4 -0
  2. data/LICENSE.txt +18 -0
  3. data/README +15 -0
  4. data/Rakefile +98 -0
  5. data/bin/timeline-setter +9 -0
  6. data/doc/doc.markdown +253 -0
  7. data/doc/doc_wrapper.erb +87 -0
  8. data/doc/docco.css +186 -0
  9. data/doc/timeline-setter.html +592 -0
  10. data/doc/todo.markdown +28 -0
  11. data/doc/twitter-demo.html +122 -0
  12. data/documentation/TimelineSetter/CLI.html +575 -0
  13. data/documentation/TimelineSetter/Parser.html +285 -0
  14. data/documentation/TimelineSetter/Timeline.html +513 -0
  15. data/documentation/TimelineSetter/Util.html +246 -0
  16. data/documentation/TimelineSetter.html +112 -0
  17. data/documentation/_index.html +132 -0
  18. data/documentation/class_list.html +36 -0
  19. data/documentation/css/common.css +1 -0
  20. data/documentation/css/full_list.css +53 -0
  21. data/documentation/css/style.css +318 -0
  22. data/documentation/file.README.html +70 -0
  23. data/documentation/file_list.html +38 -0
  24. data/documentation/frames.html +13 -0
  25. data/documentation/index.html +70 -0
  26. data/documentation/js/app.js +203 -0
  27. data/documentation/js/full_list.js +149 -0
  28. data/documentation/js/jquery.js +16 -0
  29. data/documentation/method_list.html +155 -0
  30. data/documentation/top-level-namespace.html +88 -0
  31. data/index.html +397 -0
  32. data/lib/timeline_setter/cli.rb +85 -0
  33. data/lib/timeline_setter/parser.rb +28 -0
  34. data/lib/timeline_setter/timeline.rb +44 -0
  35. data/lib/timeline_setter/version.rb +3 -0
  36. data/lib/timeline_setter.rb +22 -0
  37. data/public/javascripts/timeline-setter.js +822 -0
  38. data/public/javascripts/vendor/jquery-min.js +16 -0
  39. data/public/javascripts/vendor/underscore-min.js +26 -0
  40. data/public/stylesheets/timeline-setter.css +396 -0
  41. data/spec/spec_helper.rb +10 -0
  42. data/spec/test_data.csv +4 -0
  43. data/spec/timeline_setter_spec.rb +85 -0
  44. data/templates/timeline-markup.erb +61 -0
  45. data/templates/timeline-min.erb +1 -0
  46. data/templates/timeline.erb +12 -0
  47. data/timeline_setter.gemspec +104 -0
  48. metadata +189 -0
@@ -0,0 +1,513 @@
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: TimelineSetter::Timeline</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
+ <span class='title'><span class='object_link'><a href="../TimelineSetter.html" title="TimelineSetter (module)">TimelineSetter</a></span></span>
28
+ &raquo;
29
+ <span class="title">Timeline</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: TimelineSetter::Timeline
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">TimelineSetter::Timeline</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/timeline_setter/timeline.rb</dd>
78
+
79
+ </dl>
80
+ <div class="clear"></div>
81
+
82
+
83
+
84
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
85
+ <ul class="summary">
86
+
87
+ <li class="public ">
88
+ <span class="summary_signature">
89
+
90
+ <a href="#timeline-instance_method" title="#timeline (instance method)">- (Object) <strong>timeline</strong> </a>
91
+
92
+
93
+
94
+ </span>
95
+
96
+
97
+ <span class="note title readonly">readonly</span>
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+ <span class="summary_desc"><div class='inline'><p>
107
+ Create timeline HTML by interpolating events hash into an ERB template.
108
+ </p>
109
+ </div></span>
110
+
111
+ </li>
112
+
113
+
114
+ </ul>
115
+
116
+
117
+
118
+ <h2>
119
+ Instance Method Summary
120
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
121
+ </h2>
122
+
123
+ <ul class="summary">
124
+
125
+ <li class="public ">
126
+ <span class="summary_signature">
127
+
128
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Timeline) <strong>initialize</strong>(events) </a>
129
+
130
+
131
+
132
+ </span>
133
+
134
+ <span class="note title constructor">constructor</span>
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+ <span class="summary_desc"><div class='inline'><p>
144
+ Instantiate a new timeline from an events array created in
145
+ Parser#initialize.
146
+ </p>
147
+ </div></span>
148
+
149
+ </li>
150
+
151
+
152
+ <li class="public ">
153
+ <span class="summary_signature">
154
+
155
+ <a href="#timeline_markup-instance_method" title="#timeline_markup (instance method)">- (Object) <strong>timeline_markup</strong> </a>
156
+
157
+
158
+
159
+ </span>
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+ <span class="summary_desc"><div class='inline'></div></span>
169
+
170
+ </li>
171
+
172
+
173
+ <li class="public ">
174
+ <span class="summary_signature">
175
+
176
+ <a href="#timeline_min-instance_method" title="#timeline_min (instance method)">- (Object) <strong>timeline_min</strong> </a>
177
+
178
+
179
+
180
+ </span>
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+ <span class="summary_desc"><div class='inline'><p>
190
+ Create a minified one-page version of a timeline by minifying CSS and JS
191
+ and embedding all assets into our ERB template.
192
+ </p>
193
+ </div></span>
194
+
195
+ </li>
196
+
197
+
198
+ <li class="public ">
199
+ <span class="summary_signature">
200
+
201
+ <a href="#tmpl-instance_method" title="#tmpl (instance method)">- (Object) <strong>tmpl</strong>(tmpl_file) </a>
202
+
203
+
204
+
205
+ </span>
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+ <span class="summary_desc"><div class='inline'></div></span>
215
+
216
+ </li>
217
+
218
+
219
+ <li class="public ">
220
+ <span class="summary_signature">
221
+
222
+ <a href="#to_json-instance_method" title="#to_json (instance method)">- (Object) <strong>to_json</strong> </a>
223
+
224
+
225
+
226
+ </span>
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+ <span class="summary_desc"><div class='inline'><p>
236
+ Convert human dates to timestamps, sort the hash by timestamp, and convert
237
+ the events hash to JSON to stick into our HTML.
238
+ </p>
239
+ </div></span>
240
+
241
+ </li>
242
+
243
+
244
+ </ul>
245
+
246
+
247
+ <div id="constructor_details" class="method_details_list">
248
+ <h2>Constructor Details</h2>
249
+
250
+ <div class="method_details first">
251
+ <p class="signature first" id="initialize-instance_method">
252
+
253
+ - (<tt><span class='object_link'><a href="" title="TimelineSetter::Timeline (class)">Timeline</a></span></tt>) <strong>initialize</strong>(events)
254
+
255
+
256
+
257
+ </p><div class="docstring">
258
+ <div class="discussion">
259
+ <p>
260
+ Instantiate a new timeline from an events array created in
261
+ Parser#initialize
262
+ </p>
263
+
264
+
265
+ </div>
266
+ </div>
267
+ <div class="tags">
268
+
269
+ </div><table class="source_code">
270
+ <tr>
271
+ <td>
272
+ <pre class="lines">
273
+
274
+
275
+ 6
276
+ 7
277
+ 8</pre>
278
+ </td>
279
+ <td>
280
+ <pre class="code"><span class="info file"># File 'lib/timeline_setter/timeline.rb', line 6</span>
281
+
282
+ <span class='def def kw'>def</span> <span class='initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='events identifier id'>events</span><span class='rparen token'>)</span>
283
+ <span class='@events ivar id'>@events</span> <span class='assign token'>=</span> <span class='events identifier id'>events</span>
284
+ <span class='end end kw'>end</span>
285
+ </pre>
286
+ </td>
287
+ </tr>
288
+ </table>
289
+ </div>
290
+
291
+ </div>
292
+
293
+ <div id="instance_attr_details" class="attr_details">
294
+ <h2>Instance Attribute Details</h2>
295
+
296
+
297
+ <span id=""></span>
298
+ <span id="timeline-instance_method"></span>
299
+ <div class="method_details first">
300
+ <p class="signature first" id="timeline-instance_method">
301
+
302
+ - (<tt>Object</tt>) <strong>timeline</strong> <span class="extras">(readonly)</span>
303
+
304
+
305
+
306
+ </p><div class="docstring">
307
+ <div class="discussion">
308
+ <p>
309
+ Create timeline HTML by interpolating events hash into an ERB template.
310
+ Re-template timeline by editing ../templates/timeline.erb This version
311
+ preserves external links to CSS and JS.
312
+ </p>
313
+
314
+
315
+ </div>
316
+ </div>
317
+ <div class="tags">
318
+
319
+ </div><table class="source_code">
320
+ <tr>
321
+ <td>
322
+ <pre class="lines">
323
+
324
+
325
+ 24
326
+ 25
327
+ 26</pre>
328
+ </td>
329
+ <td>
330
+ <pre class="code"><span class="info file"># File 'lib/timeline_setter/timeline.rb', line 24</span>
331
+
332
+ <span class='def def kw'>def</span> <span class='timeline identifier id'>timeline</span>
333
+ <span class='@timeline ivar id'>@timeline</span> <span class='assign token'>=</span> <span class='tmpl identifier id'>tmpl</span><span class='lparen token'>(</span><span class='string val'>&quot;timeline.erb&quot;</span><span class='rparen token'>)</span>
334
+ <span class='end end kw'>end</span>
335
+ </pre>
336
+ </td>
337
+ </tr>
338
+ </table>
339
+ </div>
340
+
341
+ </div>
342
+
343
+
344
+ <div id="instance_method_details" class="method_details_list">
345
+ <h2>Instance Method Details</h2>
346
+
347
+
348
+ <div class="method_details first">
349
+ <p class="signature first" id="timeline_markup-instance_method">
350
+
351
+ - (<tt>Object</tt>) <strong>timeline_markup</strong>
352
+
353
+
354
+
355
+ </p><table class="source_code">
356
+ <tr>
357
+ <td>
358
+ <pre class="lines">
359
+
360
+
361
+ 17
362
+ 18
363
+ 19</pre>
364
+ </td>
365
+ <td>
366
+ <pre class="code"><span class="info file"># File 'lib/timeline_setter/timeline.rb', line 17</span>
367
+
368
+ <span class='def def kw'>def</span> <span class='timeline_markup identifier id'>timeline_markup</span>
369
+ <span class='tmpl identifier id'>tmpl</span><span class='lparen token'>(</span><span class='string val'>&quot;timeline-markup.erb&quot;</span><span class='rparen token'>)</span>
370
+ <span class='end end kw'>end</span>
371
+ </pre>
372
+ </td>
373
+ </tr>
374
+ </table>
375
+ </div>
376
+
377
+ <div class="method_details ">
378
+ <p class="signature " id="timeline_min-instance_method">
379
+
380
+ - (<tt>Object</tt>) <strong>timeline_min</strong>
381
+
382
+
383
+
384
+ </p><div class="docstring">
385
+ <div class="discussion">
386
+ <p>
387
+ Create a minified one-page version of a timeline by minifying CSS and JS
388
+ and embedding all assets into our ERB template.
389
+ </p>
390
+
391
+
392
+ </div>
393
+ </div>
394
+ <div class="tags">
395
+
396
+ </div><table class="source_code">
397
+ <tr>
398
+ <td>
399
+ <pre class="lines">
400
+
401
+
402
+ 30
403
+ 31
404
+ 32
405
+ 33
406
+ 34
407
+ 35
408
+ 36
409
+ 37
410
+ 38</pre>
411
+ </td>
412
+ <td>
413
+ <pre class="code"><span class="info file"># File 'lib/timeline_setter/timeline.rb', line 30</span>
414
+
415
+ <span class='def def kw'>def</span> <span class='timeline_min identifier id'>timeline_min</span>
416
+ <span class='@js ivar id'>@js</span> <span class='assign token'>=</span> <span class='string val'>&quot;&quot;</span>
417
+ <span class='@css ivar id'>@css</span> <span class='assign token'>=</span> <span class='Kompress constant id'>Kompress</span><span class='colon2 op'>::</span><span class='CSS constant id'>CSS</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='File constant id'>File</span><span class='dot token'>.</span><span class='open identifier id'>open</span><span class='lparen token'>(</span><span class='dstring node'>&quot;#{TimelineSetter::ROOT}/public/stylesheets/timeline-setter.css&quot;</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='read identifier id'>read</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='css identifier id'>css</span>
418
+ <span class='libs identifier id'>libs</span> <span class='assign token'>=</span> <span class='Dir constant id'>Dir</span><span class='dot token'>.</span><span class='glob identifier id'>glob</span><span class='lparen token'>(</span><span class='dstring node'>&quot;#{TimelineSetter::ROOT}/public/javascripts/vendor/**&quot;</span><span class='rparen token'>)</span>
419
+ <span class='libs identifier id'>libs</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='lib identifier id'>lib</span><span class='bitor op'>|</span> <span class='@js ivar id'>@js</span> <span class='lshft op'>&lt;&lt;</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='open identifier id'>open</span><span class='lparen token'>(</span><span class='lib identifier id'>lib</span><span class='comma token'>,</span><span class='string val'>'r'</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='read identifier id'>read</span> <span class='rbrace token'>}</span>
420
+ <span class='@min_html ivar id'>@min_html</span> <span class='assign token'>=</span> <span class='Kompress constant id'>Kompress</span><span class='colon2 op'>::</span><span class='HTML constant id'>HTML</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='timeline_markup identifier id'>timeline_markup</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='html identifier id'>html</span>
421
+ <span class='@js ivar id'>@js</span> <span class='lshft op'>&lt;&lt;</span> <span class='Closure constant id'>Closure</span><span class='colon2 op'>::</span><span class='Compiler constant id'>Compiler</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='dot token'>.</span><span class='compile identifier id'>compile</span><span class='lparen token'>(</span><span class='File constant id'>File</span><span class='dot token'>.</span><span class='open identifier id'>open</span><span class='lparen token'>(</span><span class='dstring node'>&quot;#{TimelineSetter::ROOT}/public/javascripts/timeline-setter.js&quot;</span><span class='comma token'>,</span> <span class='string val'>'r'</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
422
+ <span class='@timeline ivar id'>@timeline</span> <span class='assign token'>=</span> <span class='tmpl identifier id'>tmpl</span><span class='lparen token'>(</span><span class='string val'>&quot;timeline-min.erb&quot;</span><span class='rparen token'>)</span>
423
+ <span class='end end kw'>end</span>
424
+ </pre>
425
+ </td>
426
+ </tr>
427
+ </table>
428
+ </div>
429
+
430
+ <div class="method_details ">
431
+ <p class="signature " id="tmpl-instance_method">
432
+
433
+ - (<tt>Object</tt>) <strong>tmpl</strong>(tmpl_file)
434
+
435
+
436
+
437
+ </p><table class="source_code">
438
+ <tr>
439
+ <td>
440
+ <pre class="lines">
441
+
442
+
443
+ 40
444
+ 41
445
+ 42</pre>
446
+ </td>
447
+ <td>
448
+ <pre class="code"><span class="info file"># File 'lib/timeline_setter/timeline.rb', line 40</span>
449
+
450
+ <span class='def def kw'>def</span> <span class='tmpl identifier id'>tmpl</span><span class='lparen token'>(</span><span class='tmpl_file identifier id'>tmpl_file</span><span class='rparen token'>)</span>
451
+ <span class='ERB constant id'>ERB</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='File constant id'>File</span><span class='dot token'>.</span><span class='open identifier id'>open</span><span class='lparen token'>(</span><span class='dstring node'>&quot;#{TimelineSetter::ROOT}/templates/#{tmpl_file}&quot;</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='read identifier id'>read</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='result identifier id'>result</span><span class='lparen token'>(</span><span class='binding identifier id'>binding</span><span class='rparen token'>)</span>
452
+ <span class='end end kw'>end</span>
453
+ </pre>
454
+ </td>
455
+ </tr>
456
+ </table>
457
+ </div>
458
+
459
+ <div class="method_details ">
460
+ <p class="signature " id="to_json-instance_method">
461
+
462
+ - (<tt>Object</tt>) <strong>to_json</strong>
463
+
464
+
465
+
466
+ </p><div class="docstring">
467
+ <div class="discussion">
468
+ <p>
469
+ Convert human dates to timestamps, sort the hash by timestamp, and convert
470
+ the events hash to JSON to stick into our HTML.
471
+ </p>
472
+
473
+
474
+ </div>
475
+ </div>
476
+ <div class="tags">
477
+
478
+ </div><table class="source_code">
479
+ <tr>
480
+ <td>
481
+ <pre class="lines">
482
+
483
+
484
+ 12
485
+ 13
486
+ 14
487
+ 15</pre>
488
+ </td>
489
+ <td>
490
+ <pre class="code"><span class="info file"># File 'lib/timeline_setter/timeline.rb', line 12</span>
491
+
492
+ <span class='def def kw'>def</span> <span class='to_json identifier id'>to_json</span>
493
+ <span class='@events ivar id'>@events</span><span class='dot token'>.</span><span class='collect identifier id'>collect</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='r identifier id'>r</span><span class='bitor op'>|</span> <span class='r identifier id'>r</span><span class='lbrack token'>[</span><span class='symbol val'>:timestamp</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='Time constant id'>Time</span><span class='dot token'>.</span><span class='parse identifier id'>parse</span><span class='lparen token'>(</span><span class='r identifier id'>r</span><span class='lbrack token'>[</span><span class='symbol val'>:date</span><span class='rbrack token'>]</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='to_i identifier id'>to_i</span> <span class='mult op'>*</span> <span class='integer val'>1000</span> <span class='rbrace token'>}</span><span class='dot token'>.</span><span class='sort identifier id'>sort</span><span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='a identifier id'>a</span><span class='comma token'>,</span><span class='b identifier id'>b</span><span class='bitor op'>|</span> <span class='b identifier id'>b</span><span class='lbrack token'>[</span><span class='symbol val'>:timestamp</span><span class='rbrack token'>]</span> <span class='cmp op'>&lt;=&gt;</span> <span class='a identifier id'>a</span><span class='lbrack token'>[</span><span class='symbol val'>:timestamp</span><span class='rbrack token'>]</span><span class='rbrace token'>}</span>
494
+ <span class='@events ivar id'>@events</span><span class='dot token'>.</span><span class='to_json identifier id'>to_json</span>
495
+ <span class='end end kw'>end</span>
496
+ </pre>
497
+ </td>
498
+ </tr>
499
+ </table>
500
+ </div>
501
+
502
+ </div>
503
+
504
+ </div>
505
+
506
+ <div id="footer">
507
+ Generated on Mon Apr 4 11:05:24 2011 by
508
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
509
+ 0.6.5 (ruby-1.8.7).
510
+ </div>
511
+
512
+ </body>
513
+ </html>