rpub 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -1
  3. data/.rspec +0 -1
  4. data/.travis.yml +3 -4
  5. data/.yardopts +1 -0
  6. data/Gemfile +1 -1
  7. data/Gemfile.lock +70 -46
  8. data/Guardfile +6 -0
  9. data/HISTORY.md +10 -0
  10. data/README.md +1 -1
  11. data/Rakefile +7 -2
  12. data/bin/rpub +64 -1
  13. data/doc/.gitignore +8 -0
  14. data/doc/api/Rpub.html +339 -0
  15. data/doc/api/Rpub/Book.html +983 -0
  16. data/doc/api/Rpub/Chapter.html +737 -0
  17. data/doc/api/Rpub/Command.html +356 -0
  18. data/doc/api/Rpub/Commands.html +117 -0
  19. data/doc/api/Rpub/Commands/Clean.html +216 -0
  20. data/doc/api/Rpub/Commands/Compile.html +218 -0
  21. data/doc/api/Rpub/Commands/Generate.html +242 -0
  22. data/doc/api/Rpub/Commands/Package.html +230 -0
  23. data/doc/api/Rpub/Commands/Preview.html +216 -0
  24. data/doc/api/Rpub/Commands/Stats.html +226 -0
  25. data/doc/api/Rpub/Compressor.html +687 -0
  26. data/doc/api/Rpub/Context.html +553 -0
  27. data/doc/api/Rpub/Document.html +647 -0
  28. data/doc/api/Rpub/Document/OutlineElement.html +388 -0
  29. data/doc/api/Rpub/Epub.html +465 -0
  30. data/doc/api/Rpub/Epub/Container.html +224 -0
  31. data/doc/api/Rpub/Epub/Content.html +344 -0
  32. data/doc/api/Rpub/Epub/Cover.html +236 -0
  33. data/doc/api/Rpub/Epub/HtmlToc.html +240 -0
  34. data/doc/api/Rpub/Epub/Toc.html +244 -0
  35. data/doc/api/Rpub/FilesystemSource.html +544 -0
  36. data/doc/api/Rpub/HashDelegation.html +281 -0
  37. data/doc/api/Rpub/HashDelegation/ClassMethods.html +175 -0
  38. data/doc/api/Rpub/MediaType.html +192 -0
  39. data/doc/api/Rpub/Preview.html +464 -0
  40. data/doc/api/Rpub/XmlFile.html +457 -0
  41. data/doc/api/_index.html +405 -0
  42. data/doc/api/class_list.html +54 -0
  43. data/doc/api/css/common.css +1 -0
  44. data/doc/api/css/full_list.css +57 -0
  45. data/doc/api/css/style.css +339 -0
  46. data/doc/api/file.HISTORY.html +131 -0
  47. data/doc/api/file.LICENSE.html +92 -0
  48. data/doc/api/file.README.html +337 -0
  49. data/doc/api/file_list.html +62 -0
  50. data/doc/api/frames.html +26 -0
  51. data/doc/api/index.html +337 -0
  52. data/doc/api/js/app.js +219 -0
  53. data/doc/api/js/full_list.js +178 -0
  54. data/doc/api/js/jquery.js +4 -0
  55. data/doc/api/method_list.html +533 -0
  56. data/doc/api/top-level-namespace.html +112 -0
  57. data/doc/index.html +312 -0
  58. data/doc/javascripts/scale.fix.js +17 -0
  59. data/doc/params.json +1 -0
  60. data/doc/stylesheets/pygment_trac.css +69 -0
  61. data/doc/stylesheets/styles.css +255 -0
  62. data/features/clean.feature +31 -0
  63. data/features/compile.feature +49 -0
  64. data/features/embedded_assets.feature +51 -0
  65. data/features/generate.feature +63 -0
  66. data/features/layout.feature +41 -0
  67. data/features/package.feature +30 -0
  68. data/features/previews.feature +66 -0
  69. data/features/stats.feature +18 -0
  70. data/features/step_definitions/general_steps.rb +60 -0
  71. data/features/styles.feature +33 -0
  72. data/features/support/env.rb +7 -0
  73. data/features/table_of_contents.feature +35 -0
  74. data/lib/rpub.rb +28 -31
  75. data/lib/rpub/book.rb +9 -16
  76. data/lib/rpub/chapter.rb +4 -54
  77. data/lib/rpub/command.rb +32 -0
  78. data/lib/rpub/commands/clean.rb +4 -49
  79. data/lib/rpub/commands/compile.rb +4 -49
  80. data/lib/rpub/commands/generate.rb +10 -67
  81. data/lib/rpub/commands/package.rb +9 -37
  82. data/lib/rpub/commands/preview.rb +4 -54
  83. data/lib/rpub/commands/stats.rb +6 -10
  84. data/lib/rpub/compressor.rb +3 -3
  85. data/lib/rpub/context.rb +48 -0
  86. data/lib/rpub/document.rb +68 -0
  87. data/lib/rpub/epub.rb +8 -7
  88. data/lib/rpub/epub/content.rb +9 -30
  89. data/lib/rpub/epub/cover.rb +1 -8
  90. data/lib/rpub/epub/html_toc.rb +4 -9
  91. data/lib/rpub/epub/toc.rb +16 -13
  92. data/lib/rpub/filesystem_source.rb +47 -0
  93. data/lib/rpub/media_type.rb +16 -0
  94. data/lib/rpub/preview.rb +29 -0
  95. data/lib/rpub/version.rb +1 -1
  96. data/lib/rpub/xml_file.rb +4 -1
  97. data/rpub.gemspec +6 -7
  98. data/spec/rpub/book_spec.rb +45 -45
  99. data/spec/rpub/chapter_spec.rb +87 -22
  100. data/spec/rpub/epub/container_spec.rb +3 -5
  101. data/spec/rpub/epub/content_spec.rb +62 -41
  102. data/spec/rpub/epub/cover_spec.rb +3 -5
  103. data/spec/rpub/epub/html_toc_spec.rb +8 -8
  104. data/spec/rpub/epub/toc_spec.rb +20 -22
  105. data/spec/rpub_spec.rb +1 -3
  106. data/spec/spec_helper.rb +28 -0
  107. data/support/config.yml +1 -0
  108. data/support/styles.css +3 -3
  109. metadata +131 -120
  110. data/lib/rpub/commander.rb +0 -23
  111. data/lib/rpub/commands/base.rb +0 -33
  112. data/lib/rpub/commands/help.rb +0 -37
  113. data/lib/rpub/commands/main.rb +0 -45
  114. data/lib/rpub/compilation_helpers.rb +0 -73
  115. data/lib/rpub/subclass_tracker.rb +0 -53
  116. data/spec/rpub/commands/clean_spec.rb +0 -46
  117. data/spec/rpub/commands/generate_spec.rb +0 -52
  118. data/spec/rpub/commands/main_spec.rb +0 -26
  119. data/spec/rpub/commands/package_spec.rb +0 -33
  120. data/spec/rpub/commands/preview_spec.rb +0 -43
@@ -0,0 +1,983 @@
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
+ Class: Rpub::Book
8
+
9
+ &mdash; Rpub, a simple ePub generator library in Ruby
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" 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#!Rpub/Book.html";
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 (B)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../Rpub.html" title="Rpub (module)">Rpub</a></span></span>
36
+ &raquo;
37
+ <span class="title">Book</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>Class: Rpub::Book
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">Rpub::Book</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+ <dt class="r2">Extended by:</dt>
92
+ <dd class="r2">Forwardable</dd>
93
+
94
+
95
+
96
+
97
+ <dt class="r1">Includes:</dt>
98
+ <dd class="r1">Enumerable</dd>
99
+
100
+
101
+
102
+
103
+
104
+ <dt class="r2 last">Defined in:</dt>
105
+ <dd class="r2 last">lib/rpub/book.rb</dd>
106
+
107
+ </dl>
108
+ <div class="clear"></div>
109
+
110
+ <h2>Overview</h2><div class="docstring">
111
+ <div class="discussion">
112
+ <p>The Book object wraps a collection of chapter objects and knows about its
113
+ ordering, the book metadata from the configuration file and the book output
114
+ filename.</p>
115
+
116
+
117
+ </div>
118
+ </div>
119
+ <div class="tags">
120
+
121
+
122
+ </div>
123
+
124
+
125
+
126
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
127
+ <ul class="summary">
128
+
129
+ <li class="public ">
130
+ <span class="summary_signature">
131
+
132
+ <a href="#chapters-instance_method" title="#chapters (instance method)">- (Array&lt;Chapter&gt;) <strong>chapters</strong> </a>
133
+
134
+
135
+
136
+ </span>
137
+
138
+
139
+
140
+
141
+ <span class="note title readonly">readonly</span>
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+ <span class="summary_desc"><div class='inline'><p>List of chapters, one for every input markdown file.</p>
152
+ </div></span>
153
+
154
+ </li>
155
+
156
+
157
+ </ul>
158
+
159
+
160
+
161
+
162
+
163
+ <h2>
164
+ Instance Method Summary
165
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
166
+ </h2>
167
+
168
+ <ul class="summary">
169
+
170
+ <li class="public ">
171
+ <span class="summary_signature">
172
+
173
+ <a href="#add_chapter-instance_method" title="#add_chapter (instance method)">- (Object) <strong>add_chapter</strong>(content) </a>
174
+
175
+
176
+
177
+ (also: #&lt;&lt;)
178
+
179
+ </span>
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+ <span class="summary_desc"><div class='inline'><p>Add textual content as a new Chapter to this book.</p>
190
+ </div></span>
191
+
192
+ </li>
193
+
194
+
195
+ <li class="public ">
196
+ <span class="summary_signature">
197
+
198
+ <a href="#each-instance_method" title="#each (instance method)">- (Object) <strong>each</strong>(&amp;block) </a>
199
+
200
+
201
+
202
+ </span>
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+ <span class="summary_desc"><div class='inline'>
213
+ </div></span>
214
+
215
+ </li>
216
+
217
+
218
+ <li class="public ">
219
+ <span class="summary_signature">
220
+
221
+ <a href="#filename-instance_method" title="#filename (instance method)">- (String) <strong>filename</strong> </a>
222
+
223
+
224
+
225
+ </span>
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+ <span class="summary_desc"><div class='inline'><p>Output filename for epub, based on the book title and version number.</p>
236
+ </div></span>
237
+
238
+ </li>
239
+
240
+
241
+ <li class="public ">
242
+ <span class="summary_signature">
243
+
244
+ <a href="#has_cover%3F-instance_method" title="#has_cover? (instance method)">- (Boolean) <strong>has_cover?</strong> </a>
245
+
246
+
247
+
248
+ </span>
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+ <span class="summary_desc"><div class='inline'>
259
+ </div></span>
260
+
261
+ </li>
262
+
263
+
264
+ <li class="public ">
265
+ <span class="summary_signature">
266
+
267
+ <a href="#has_fonts%3F-instance_method" title="#has_fonts? (instance method)">- (Boolean) <strong>has_fonts?</strong> </a>
268
+
269
+
270
+
271
+ </span>
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+
280
+
281
+ <span class="summary_desc"><div class='inline'>
282
+ </div></span>
283
+
284
+ </li>
285
+
286
+
287
+ <li class="public ">
288
+ <span class="summary_signature">
289
+
290
+ <a href="#has_toc%3F-instance_method" title="#has_toc? (instance method)">- (Boolean) <strong>has_toc?</strong> </a>
291
+
292
+
293
+
294
+ </span>
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+
303
+
304
+ <span class="summary_desc"><div class='inline'>
305
+ </div></span>
306
+
307
+ </li>
308
+
309
+
310
+ <li class="public ">
311
+ <span class="summary_signature">
312
+
313
+ <a href="#images-instance_method" title="#images (instance method)">- (Object) <strong>images</strong> </a>
314
+
315
+
316
+
317
+ </span>
318
+
319
+
320
+
321
+
322
+
323
+
324
+
325
+
326
+
327
+ <span class="summary_desc"><div class='inline'>
328
+ </div></span>
329
+
330
+ </li>
331
+
332
+
333
+ <li class="public ">
334
+ <span class="summary_signature">
335
+
336
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Book) <strong>initialize</strong>(context) </a>
337
+
338
+
339
+
340
+ </span>
341
+
342
+
343
+ <span class="note title constructor">constructor</span>
344
+
345
+
346
+
347
+
348
+
349
+
350
+
351
+
352
+ <span class="summary_desc"><div class='inline'><p>A new instance of Book.</p>
353
+ </div></span>
354
+
355
+ </li>
356
+
357
+
358
+ <li class="public ">
359
+ <span class="summary_signature">
360
+
361
+ <a href="#outline-instance_method" title="#outline (instance method)">- (Object) <strong>outline</strong> </a>
362
+
363
+
364
+
365
+ </span>
366
+
367
+
368
+
369
+
370
+
371
+
372
+
373
+
374
+
375
+ <span class="summary_desc"><div class='inline'>
376
+ </div></span>
377
+
378
+ </li>
379
+
380
+
381
+ <li class="public ">
382
+ <span class="summary_signature">
383
+
384
+ <a href="#uid-instance_method" title="#uid (instance method)">- (String) <strong>uid</strong> </a>
385
+
386
+
387
+
388
+ </span>
389
+
390
+
391
+
392
+
393
+
394
+
395
+
396
+
397
+
398
+ <span class="summary_desc"><div class='inline'><p>Unique identifier for this entire book to be used in the epub manifest files.</p>
399
+ </div></span>
400
+
401
+ </li>
402
+
403
+
404
+ </ul>
405
+
406
+
407
+
408
+
409
+ <div id="constructor_details" class="method_details_list">
410
+ <h2>Constructor Details</h2>
411
+
412
+ <div class="method_details first">
413
+ <h3 class="signature first" id="initialize-instance_method">
414
+
415
+ - (<tt><span class='object_link'><a href="" title="Rpub::Book (class)">Book</a></span></tt>) <strong>initialize</strong>(context)
416
+
417
+
418
+
419
+
420
+
421
+ </h3><div class="docstring">
422
+ <div class="discussion">
423
+ <p>Returns a new instance of Book</p>
424
+
425
+
426
+ </div>
427
+ </div>
428
+ <div class="tags">
429
+
430
+
431
+ </div><table class="source_code">
432
+ <tr>
433
+ <td>
434
+ <pre class="lines">
435
+
436
+
437
+ 14
438
+ 15
439
+ 16
440
+ 17
441
+ 18</pre>
442
+ </td>
443
+ <td>
444
+ <pre class="code"><span class="info file"># File 'lib/rpub/book.rb', line 14</span>
445
+
446
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
447
+ <span class='ivar'>@chapters</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
448
+ <span class='ivar'>@context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span>
449
+ <span class='ivar'>@context</span><span class='period'>.</span><span class='id identifier rubyid_chapter_files'>chapter_files</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_method'>method</span><span class='lparen'>(</span><span class='symbol'>:&lt;&lt;</span><span class='rparen'>)</span><span class='rparen'>)</span>
450
+ <span class='kw'>end</span></pre>
451
+ </td>
452
+ </tr>
453
+ </table>
454
+ </div>
455
+
456
+ </div>
457
+
458
+ <div id="instance_attr_details" class="attr_details">
459
+ <h2>Instance Attribute Details</h2>
460
+
461
+
462
+ <span id=""></span>
463
+ <div class="method_details first">
464
+ <h3 class="signature first" id="chapters-instance_method">
465
+
466
+ - (<tt>Array&lt;<span class='object_link'><a href="Chapter.html" title="Rpub::Chapter (class)">Chapter</a></span>&gt;</tt>) <strong>chapters</strong> <span class="extras">(readonly)</span>
467
+
468
+
469
+
470
+
471
+
472
+ </h3><div class="docstring">
473
+ <div class="discussion">
474
+ <p>Returns List of chapters, one for every input markdown file.</p>
475
+
476
+
477
+ </div>
478
+ </div>
479
+ <div class="tags">
480
+
481
+ <p class="tag_title">Returns:</p>
482
+ <ul class="return">
483
+
484
+ <li>
485
+
486
+
487
+ <span class='type'>(<tt>Array&lt;<span class='object_link'><a href="Chapter.html" title="Rpub::Chapter (class)">Chapter</a></span>&gt;</tt>)</span>
488
+
489
+
490
+
491
+ &mdash;
492
+ <div class='inline'><p>List of chapters, one for every input markdown file.</p>
493
+ </div>
494
+
495
+ </li>
496
+
497
+ </ul>
498
+
499
+ </div><table class="source_code">
500
+ <tr>
501
+ <td>
502
+ <pre class="lines">
503
+
504
+
505
+ 12
506
+ 13
507
+ 14</pre>
508
+ </td>
509
+ <td>
510
+ <pre class="code"><span class="info file"># File 'lib/rpub/book.rb', line 12</span>
511
+
512
+ <span class='kw'>def</span> <span class='id identifier rubyid_chapters'>chapters</span>
513
+ <span class='ivar'>@chapters</span>
514
+ <span class='kw'>end</span></pre>
515
+ </td>
516
+ </tr>
517
+ </table>
518
+ </div>
519
+
520
+ </div>
521
+
522
+
523
+ <div id="instance_method_details" class="method_details_list">
524
+ <h2>Instance Method Details</h2>
525
+
526
+
527
+ <div class="method_details first">
528
+ <h3 class="signature first" id="add_chapter-instance_method">
529
+
530
+ - (<tt>Object</tt>) <strong>add_chapter</strong>(content)
531
+
532
+
533
+
534
+ <span class="aliases">Also known as:
535
+ <span class="names"><span id='<<-instance_method'>&lt;&lt;</span></span>
536
+ </span>
537
+
538
+
539
+
540
+ </h3><div class="docstring">
541
+ <div class="discussion">
542
+ <p>Add textual content as a new Chapter to this book.</p>
543
+
544
+ <p>This method returns the <code>Book</code> object iself, so you can chain multiple calls:</p>
545
+
546
+
547
+ </div>
548
+ </div>
549
+ <div class="tags">
550
+
551
+ <div class="examples">
552
+ <p class="tag_title">Examples:</p>
553
+
554
+
555
+ <p class="example_title"><div class='inline'><p>Chaining mutliple calls</p>
556
+ </div></p>
557
+
558
+ <pre class="example code"><code><span class='id identifier rubyid_book'>book</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>foo</span><span class='tstring_end'>&#39;</span></span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>bar</span><span class='tstring_end'>&#39;</span></span></code></pre>
559
+
560
+ </div>
561
+ <p class="tag_title">Parameters:</p>
562
+ <ul class="param">
563
+
564
+ <li>
565
+
566
+ <span class='name'>content</span>
567
+
568
+
569
+ <span class='type'>(<tt>String</tt>)</span>
570
+
571
+
572
+
573
+ &mdash;
574
+ <div class='inline'><p>is chapter text to add</p>
575
+ </div>
576
+
577
+ </li>
578
+
579
+ </ul>
580
+
581
+
582
+ </div><table class="source_code">
583
+ <tr>
584
+ <td>
585
+ <pre class="lines">
586
+
587
+
588
+ 52
589
+ 53
590
+ 54
591
+ 55</pre>
592
+ </td>
593
+ <td>
594
+ <pre class="code"><span class="info file"># File 'lib/rpub/book.rb', line 52</span>
595
+
596
+ <span class='kw'>def</span> <span class='id identifier rubyid_add_chapter'>add_chapter</span><span class='lparen'>(</span><span class='id identifier rubyid_content'>content</span><span class='rparen'>)</span>
597
+ <span class='id identifier rubyid_chapters'>chapters</span> <span class='op'>&lt;&lt;</span> <span class='const'>Chapter</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_content'>content</span><span class='comma'>,</span> <span class='id identifier rubyid_chapters'>chapters</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='comma'>,</span> <span class='id identifier rubyid_layout'>layout</span><span class='rparen'>)</span>
598
+ <span class='kw'>self</span>
599
+ <span class='kw'>end</span></pre>
600
+ </td>
601
+ </tr>
602
+ </table>
603
+ </div>
604
+
605
+ <div class="method_details ">
606
+ <h3 class="signature " id="each-instance_method">
607
+
608
+ - (<tt>Object</tt>) <strong>each</strong>(&amp;block)
609
+
610
+
611
+
612
+
613
+
614
+ </h3><table class="source_code">
615
+ <tr>
616
+ <td>
617
+ <pre class="lines">
618
+
619
+
620
+ 20
621
+ 21
622
+ 22</pre>
623
+ </td>
624
+ <td>
625
+ <pre class="code"><span class="info file"># File 'lib/rpub/book.rb', line 20</span>
626
+
627
+ <span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
628
+ <span class='id identifier rubyid_chapters'>chapters</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
629
+ <span class='kw'>end</span></pre>
630
+ </td>
631
+ </tr>
632
+ </table>
633
+ </div>
634
+
635
+ <div class="method_details ">
636
+ <h3 class="signature " id="filename-instance_method">
637
+
638
+ - (<tt>String</tt>) <strong>filename</strong>
639
+
640
+
641
+
642
+
643
+
644
+ </h3><div class="docstring">
645
+ <div class="discussion">
646
+ <p>Returns output filename for epub, based on the book title and
647
+ version number.</p>
648
+
649
+
650
+ </div>
651
+ </div>
652
+ <div class="tags">
653
+
654
+ <p class="tag_title">Returns:</p>
655
+ <ul class="return">
656
+
657
+ <li>
658
+
659
+
660
+ <span class='type'>(<tt>String</tt>)</span>
661
+
662
+
663
+
664
+ &mdash;
665
+ <div class='inline'><p>output filename for epub, based on the book title and
666
+ version number.</p>
667
+ </div>
668
+
669
+ </li>
670
+
671
+ </ul>
672
+
673
+ </div><table class="source_code">
674
+ <tr>
675
+ <td>
676
+ <pre class="lines">
677
+
678
+
679
+ 66
680
+ 67
681
+ 68</pre>
682
+ </td>
683
+ <td>
684
+ <pre class="code"><span class="info file"># File 'lib/rpub/book.rb', line 66</span>
685
+
686
+ <span class='kw'>def</span> <span class='id identifier rubyid_filename'>filename</span>
687
+ <span class='ivar'>@filename</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_title'>title</span><span class='comma'>,</span> <span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_version'>version</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>-</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>[^\w\.]</span><span class='regexp_end'>/i</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>-</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_squeeze'>squeeze</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>-</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='period'>.</span><span class='id identifier rubyid_chomp'>chomp</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>-</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>.epub</span><span class='tstring_end'>&#39;</span></span>
688
+ <span class='kw'>end</span></pre>
689
+ </td>
690
+ </tr>
691
+ </table>
692
+ </div>
693
+
694
+ <div class="method_details ">
695
+ <h3 class="signature " id="has_cover?-instance_method">
696
+
697
+ - (<tt>Boolean</tt>) <strong>has_cover?</strong>
698
+
699
+
700
+
701
+
702
+
703
+ </h3><div class="docstring">
704
+ <div class="discussion">
705
+
706
+
707
+
708
+ </div>
709
+ </div>
710
+ <div class="tags">
711
+
712
+ <p class="tag_title">Returns:</p>
713
+ <ul class="return">
714
+
715
+ <li>
716
+
717
+
718
+ <span class='type'>(<tt>Boolean</tt>)</span>
719
+
720
+
721
+
722
+ </li>
723
+
724
+ </ul>
725
+
726
+ </div><table class="source_code">
727
+ <tr>
728
+ <td>
729
+ <pre class="lines">
730
+
731
+
732
+ 32
733
+ 33
734
+ 34</pre>
735
+ </td>
736
+ <td>
737
+ <pre class="code"><span class="info file"># File 'lib/rpub/book.rb', line 32</span>
738
+
739
+ <span class='kw'>def</span> <span class='id identifier rubyid_has_cover?'>has_cover?</span>
740
+ <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_cover_image'>cover_image</span>
741
+ <span class='kw'>end</span></pre>
742
+ </td>
743
+ </tr>
744
+ </table>
745
+ </div>
746
+
747
+ <div class="method_details ">
748
+ <h3 class="signature " id="has_fonts?-instance_method">
749
+
750
+ - (<tt>Boolean</tt>) <strong>has_fonts?</strong>
751
+
752
+
753
+
754
+
755
+
756
+ </h3><div class="docstring">
757
+ <div class="discussion">
758
+
759
+
760
+
761
+ </div>
762
+ </div>
763
+ <div class="tags">
764
+
765
+ <p class="tag_title">Returns:</p>
766
+ <ul class="return">
767
+
768
+ <li>
769
+
770
+
771
+ <span class='type'>(<tt>Boolean</tt>)</span>
772
+
773
+
774
+
775
+ </li>
776
+
777
+ </ul>
778
+
779
+ </div><table class="source_code">
780
+ <tr>
781
+ <td>
782
+ <pre class="lines">
783
+
784
+
785
+ 24
786
+ 25
787
+ 26</pre>
788
+ </td>
789
+ <td>
790
+ <pre class="code"><span class="info file"># File 'lib/rpub/book.rb', line 24</span>
791
+
792
+ <span class='kw'>def</span> <span class='id identifier rubyid_has_fonts?'>has_fonts?</span>
793
+ <span class='id identifier rubyid_fonts'>fonts</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span>
794
+ <span class='kw'>end</span></pre>
795
+ </td>
796
+ </tr>
797
+ </table>
798
+ </div>
799
+
800
+ <div class="method_details ">
801
+ <h3 class="signature " id="has_toc?-instance_method">
802
+
803
+ - (<tt>Boolean</tt>) <strong>has_toc?</strong>
804
+
805
+
806
+
807
+
808
+
809
+ </h3><div class="docstring">
810
+ <div class="discussion">
811
+
812
+
813
+
814
+ </div>
815
+ </div>
816
+ <div class="tags">
817
+
818
+ <p class="tag_title">Returns:</p>
819
+ <ul class="return">
820
+
821
+ <li>
822
+
823
+
824
+ <span class='type'>(<tt>Boolean</tt>)</span>
825
+
826
+
827
+
828
+ </li>
829
+
830
+ </ul>
831
+
832
+ </div><table class="source_code">
833
+ <tr>
834
+ <td>
835
+ <pre class="lines">
836
+
837
+
838
+ 28
839
+ 29
840
+ 30</pre>
841
+ </td>
842
+ <td>
843
+ <pre class="code"><span class="info file"># File 'lib/rpub/book.rb', line 28</span>
844
+
845
+ <span class='kw'>def</span> <span class='id identifier rubyid_has_toc?'>has_toc?</span>
846
+ <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_toc'>toc</span>
847
+ <span class='kw'>end</span></pre>
848
+ </td>
849
+ </tr>
850
+ </table>
851
+ </div>
852
+
853
+ <div class="method_details ">
854
+ <h3 class="signature " id="images-instance_method">
855
+
856
+ - (<tt>Object</tt>) <strong>images</strong>
857
+
858
+
859
+
860
+
861
+
862
+ </h3><table class="source_code">
863
+ <tr>
864
+ <td>
865
+ <pre class="lines">
866
+
867
+
868
+ 40
869
+ 41
870
+ 42</pre>
871
+ </td>
872
+ <td>
873
+ <pre class="code"><span class="info file"># File 'lib/rpub/book.rb', line 40</span>
874
+
875
+ <span class='kw'>def</span> <span class='id identifier rubyid_images'>images</span>
876
+ <span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_chapter'>chapter</span><span class='op'>|</span> <span class='id identifier rubyid_chapter'>chapter</span><span class='period'>.</span><span class='id identifier rubyid_images'>images</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span><span class='period'>.</span><span class='id identifier rubyid_uniq'>uniq</span>
877
+ <span class='kw'>end</span></pre>
878
+ </td>
879
+ </tr>
880
+ </table>
881
+ </div>
882
+
883
+ <div class="method_details ">
884
+ <h3 class="signature " id="outline-instance_method">
885
+
886
+ - (<tt>Object</tt>) <strong>outline</strong>
887
+
888
+
889
+
890
+
891
+
892
+ </h3><table class="source_code">
893
+ <tr>
894
+ <td>
895
+ <pre class="lines">
896
+
897
+
898
+ 36
899
+ 37
900
+ 38</pre>
901
+ </td>
902
+ <td>
903
+ <pre class="code"><span class="info file"># File 'lib/rpub/book.rb', line 36</span>
904
+
905
+ <span class='kw'>def</span> <span class='id identifier rubyid_outline'>outline</span>
906
+ <span class='id identifier rubyid_inject'>inject</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_all'>all</span><span class='comma'>,</span> <span class='id identifier rubyid_chapter'>chapter</span><span class='op'>|</span> <span class='id identifier rubyid_all'>all</span> <span class='op'>&lt;&lt;</span> <span class='lbracket'>[</span><span class='id identifier rubyid_chapter'>chapter</span><span class='period'>.</span><span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_chapter'>chapter</span><span class='period'>.</span><span class='id identifier rubyid_outline'>outline</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
907
+ <span class='kw'>end</span></pre>
908
+ </td>
909
+ </tr>
910
+ </table>
911
+ </div>
912
+
913
+ <div class="method_details ">
914
+ <h3 class="signature " id="uid-instance_method">
915
+
916
+ - (<tt>String</tt>) <strong>uid</strong>
917
+
918
+
919
+
920
+
921
+
922
+ </h3><div class="docstring">
923
+ <div class="discussion">
924
+ <p>Returns Unique identifier for this entire book to be used in the
925
+ epub manifest files.</p>
926
+
927
+
928
+ </div>
929
+ </div>
930
+ <div class="tags">
931
+
932
+ <p class="tag_title">Returns:</p>
933
+ <ul class="return">
934
+
935
+ <li>
936
+
937
+
938
+ <span class='type'>(<tt>String</tt>)</span>
939
+
940
+
941
+
942
+ &mdash;
943
+ <div class='inline'><p>Unique identifier for this entire book to be used in the
944
+ epub manifest files.</p>
945
+ </div>
946
+
947
+ </li>
948
+
949
+ </ul>
950
+
951
+ </div><table class="source_code">
952
+ <tr>
953
+ <td>
954
+ <pre class="lines">
955
+
956
+
957
+ 60
958
+ 61
959
+ 62</pre>
960
+ </td>
961
+ <td>
962
+ <pre class="code"><span class="info file"># File 'lib/rpub/book.rb', line 60</span>
963
+
964
+ <span class='kw'>def</span> <span class='id identifier rubyid_uid'>uid</span>
965
+ <span class='ivar'>@uid</span> <span class='op'>||=</span> <span class='const'>Digest</span><span class='op'>::</span><span class='const'>SHA1</span><span class='period'>.</span><span class='id identifier rubyid_hexdigest'>hexdigest</span> <span class='lbracket'>[</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='comma'>,</span> <span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:uid</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span>
966
+ <span class='kw'>end</span></pre>
967
+ </td>
968
+ </tr>
969
+ </table>
970
+ </div>
971
+
972
+ </div>
973
+
974
+ </div>
975
+
976
+ <div id="footer">
977
+ Generated on Thu Aug 14 19:54:32 2014 by
978
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
979
+ 0.8.7.4 (ruby-2.1.2).
980
+ </div>
981
+
982
+ </body>
983
+ </html>