epub-parser 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/MIT-LICENSE +7 -0
- data/README +7 -0
- data/doc/EPUB.html +143 -0
- data/doc/EPUB/Book.html +616 -0
- data/doc/EPUB/Constants.html +130 -0
- data/doc/EPUB/Constants/Type.html +118 -0
- data/doc/EPUB/ContentDocument.html +108 -0
- data/doc/EPUB/ContentDocument/Navigation.html +673 -0
- data/doc/EPUB/ContentDocument/Navigation/Nav.html +563 -0
- data/doc/EPUB/ContentDocument/Navigation/Nav/Ol.html +285 -0
- data/doc/EPUB/ContentDocument/Navigation/Nav/Ol/A.html +354 -0
- data/doc/EPUB/ContentDocument/Navigation/Nav/Ol/Span.html +354 -0
- data/doc/EPUB/OCF.html +135 -0
- data/doc/EPUB/OCF/Container.html +358 -0
- data/doc/EPUB/OCF/Container/Rootfile.html +257 -0
- data/doc/EPUB/OCF/Encryption.html +111 -0
- data/doc/EPUB/OCF/Manifest.html +111 -0
- data/doc/EPUB/OCF/Metadata.html +111 -0
- data/doc/EPUB/OCF/Rights.html +111 -0
- data/doc/EPUB/OCF/Signatures.html +111 -0
- data/doc/EPUB/Parser.html +448 -0
- data/doc/EPUB/Parser/ContentDocument.html +531 -0
- data/doc/EPUB/Parser/OCF.html +635 -0
- data/doc/EPUB/Parser/Publication.html +640 -0
- data/doc/EPUB/Publication.html +108 -0
- data/doc/EPUB/Publication/Package.html +751 -0
- data/doc/EPUB/Publication/Package/Bindings.html +267 -0
- data/doc/EPUB/Publication/Package/Bindings/MediaType.html +257 -0
- data/doc/EPUB/Publication/Package/Guide.html +111 -0
- data/doc/EPUB/Publication/Package/Manifest.html +578 -0
- data/doc/EPUB/Publication/Package/Manifest/Item.html +669 -0
- data/doc/EPUB/Publication/Package/Metadata.html +257 -0
- data/doc/EPUB/Publication/Package/Spine.html +755 -0
- data/doc/EPUB/Publication/Package/Spine/Itemref.html +558 -0
- data/doc/EPUB/Type.html +118 -0
- data/doc/_index.html +422 -0
- data/doc/class_list.html +47 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +55 -0
- data/doc/css/style.css +322 -0
- data/doc/file.README.html +76 -0
- data/doc/file_list.html +49 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +76 -0
- data/doc/js/app.js +205 -0
- data/doc/js/full_list.js +167 -0
- data/doc/js/jquery.js +16 -0
- data/doc/method_list.html +902 -0
- data/doc/top-level-namespace.html +103 -0
- data/epub-parser.gemspec +2 -0
- data/lib/epub/constants.rb +20 -0
- data/lib/epub/parser.rb +1 -0
- data/lib/epub/parser/content_document.rb +4 -3
- data/lib/epub/parser/ocf.rb +2 -1
- data/lib/epub/parser/publication.rb +5 -5
- data/lib/epub/parser/version.rb +1 -1
- data/test/fixtures/book.epub +0 -0
- data/test/test_parser_content_document.rb +18 -0
- data/test/test_parser_ocf.rb +2 -2
- data/test/test_parser_publication.rb +21 -3
- metadata +87 -30
- data/lib/epub/type.rb +0 -7
- data/test/publication/package/test_bindings.rb +0 -15
- data/test/publication/package/test_guide.rb +0 -14
- data/test/publication/package/test_manifest.rb +0 -19
- data/test/publication/package/test_metadata.rb +0 -14
- data/test/publication/package/test_spine.rb +0 -15
@@ -0,0 +1,640 @@
|
|
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: EPUB::Parser::Publication
|
8
|
+
|
9
|
+
— Documentation by YARD 0.7.4
|
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
|
+
relpath = '../..';
|
19
|
+
if (relpath != '') relpath += '/';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
25
|
+
|
26
|
+
|
27
|
+
</head>
|
28
|
+
<body>
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<div id="header">
|
34
|
+
<div id="menu">
|
35
|
+
|
36
|
+
<a href="../../_index.html">Index (P)</a> »
|
37
|
+
<span class='title'><span class='object_link'><a href="../../EPUB.html" title="EPUB (module)">EPUB</a></span></span> » <span class='title'><span class='object_link'><a href="../Parser.html" title="EPUB::Parser (class)">Parser</a></span></span>
|
38
|
+
»
|
39
|
+
<span class="title">Publication</span>
|
40
|
+
|
41
|
+
|
42
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div id="search">
|
46
|
+
|
47
|
+
<a id="class_list_link" href="#">Class List</a>
|
48
|
+
|
49
|
+
<a id="method_list_link" href="#">Method List</a>
|
50
|
+
|
51
|
+
<a id="file_list_link" href="#">File List</a>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
<div class="clear"></div>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<iframe id="search_frame"></iframe>
|
58
|
+
|
59
|
+
<div id="content"><h1>Class: EPUB::Parser::Publication
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
<dt class="r1">Inherits:</dt>
|
68
|
+
<dd class="r1">
|
69
|
+
<span class="inheritName">Object</span>
|
70
|
+
|
71
|
+
<ul class="fullTree">
|
72
|
+
<li>Object</li>
|
73
|
+
|
74
|
+
<li class="next">EPUB::Parser::Publication</li>
|
75
|
+
|
76
|
+
</ul>
|
77
|
+
<a href="#" class="inheritanceTree">show all</a>
|
78
|
+
|
79
|
+
</dd>
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
<dt class="r2 last">Defined in:</dt>
|
90
|
+
<dd class="r2 last">lib/epub/parser/publication.rb</dd>
|
91
|
+
|
92
|
+
</dl>
|
93
|
+
<div class="clear"></div>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<h2>
|
102
|
+
Class Method Summary
|
103
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
104
|
+
</h2>
|
105
|
+
|
106
|
+
<ul class="summary">
|
107
|
+
|
108
|
+
<li class="public ">
|
109
|
+
<span class="summary_signature">
|
110
|
+
|
111
|
+
<a href="#parse-class_method" title="parse (class method)">+ (Object) <strong>parse</strong>(file) </a>
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
</span>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
125
|
+
|
126
|
+
</li>
|
127
|
+
|
128
|
+
|
129
|
+
</ul>
|
130
|
+
|
131
|
+
<h2>
|
132
|
+
Instance Method Summary
|
133
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
134
|
+
</h2>
|
135
|
+
|
136
|
+
<ul class="summary">
|
137
|
+
|
138
|
+
<li class="public ">
|
139
|
+
<span class="summary_signature">
|
140
|
+
|
141
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Publication) <strong>initialize</strong>(file) </a>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
</span>
|
146
|
+
|
147
|
+
<span class="note title constructor">constructor</span>
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
<span class="summary_desc"><div class='inline'>
|
157
|
+
<p>A new instance of Publication.</p>
|
158
|
+
</div></span>
|
159
|
+
|
160
|
+
</li>
|
161
|
+
|
162
|
+
|
163
|
+
<li class="public ">
|
164
|
+
<span class="summary_signature">
|
165
|
+
|
166
|
+
<a href="#parse-instance_method" title="#parse (instance method)">- (Object) <strong>parse</strong> </a>
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
</span>
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
180
|
+
|
181
|
+
</li>
|
182
|
+
|
183
|
+
|
184
|
+
<li class="public ">
|
185
|
+
<span class="summary_signature">
|
186
|
+
|
187
|
+
<a href="#parse_bindings-instance_method" title="#parse_bindings (instance method)">- (Object) <strong>parse_bindings</strong> </a>
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
</span>
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
201
|
+
|
202
|
+
</li>
|
203
|
+
|
204
|
+
|
205
|
+
<li class="public ">
|
206
|
+
<span class="summary_signature">
|
207
|
+
|
208
|
+
<a href="#parse_guide-instance_method" title="#parse_guide (instance method)">- (Object) <strong>parse_guide</strong> </a>
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
</span>
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
222
|
+
|
223
|
+
</li>
|
224
|
+
|
225
|
+
|
226
|
+
<li class="public ">
|
227
|
+
<span class="summary_signature">
|
228
|
+
|
229
|
+
<a href="#parse_manifest-instance_method" title="#parse_manifest (instance method)">- (Object) <strong>parse_manifest</strong> </a>
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
</span>
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
243
|
+
|
244
|
+
</li>
|
245
|
+
|
246
|
+
|
247
|
+
<li class="public ">
|
248
|
+
<span class="summary_signature">
|
249
|
+
|
250
|
+
<a href="#parse_metadata-instance_method" title="#parse_metadata (instance method)">- (Object) <strong>parse_metadata</strong> </a>
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
</span>
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
264
|
+
|
265
|
+
</li>
|
266
|
+
|
267
|
+
|
268
|
+
<li class="public ">
|
269
|
+
<span class="summary_signature">
|
270
|
+
|
271
|
+
<a href="#parse_spine-instance_method" title="#parse_spine (instance method)">- (Object) <strong>parse_spine</strong> </a>
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
</span>
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
285
|
+
|
286
|
+
</li>
|
287
|
+
|
288
|
+
|
289
|
+
</ul>
|
290
|
+
|
291
|
+
|
292
|
+
<div id="constructor_details" class="method_details_list">
|
293
|
+
<h2>Constructor Details</h2>
|
294
|
+
|
295
|
+
<div class="method_details first">
|
296
|
+
<p class="signature first" id="initialize-instance_method">
|
297
|
+
|
298
|
+
- (<tt><span class='object_link'><a href="" title="EPUB::Parser::Publication (class)">Publication</a></span></tt>) <strong>initialize</strong>(file)
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
</p><div class="docstring">
|
303
|
+
<div class="discussion">
|
304
|
+
|
305
|
+
<p>A new instance of Publication</p>
|
306
|
+
|
307
|
+
|
308
|
+
</div>
|
309
|
+
</div>
|
310
|
+
<div class="tags">
|
311
|
+
|
312
|
+
|
313
|
+
</div><table class="source_code">
|
314
|
+
<tr>
|
315
|
+
<td>
|
316
|
+
<pre class="lines">
|
317
|
+
|
318
|
+
|
319
|
+
15
|
320
|
+
16
|
321
|
+
17
|
322
|
+
18
|
323
|
+
19</pre>
|
324
|
+
</td>
|
325
|
+
<td>
|
326
|
+
<pre class="code"><span class="info file"># File 'lib/epub/parser/publication.rb', line 15</span>
|
327
|
+
|
328
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
|
329
|
+
<span class='ivar'>@package</span> <span class='op'>=</span> <span class='const'>EPUB</span><span class='op'>::</span><span class='const'>Publication</span><span class='op'>::</span><span class='const'>Package</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
330
|
+
<span class='ivar'>@rootfile</span> <span class='op'>=</span> <span class='const'>Addressable</span><span class='op'>::</span><span class='const'>URI</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_realpath'>realpath</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
|
331
|
+
<span class='ivar'>@doc</span> <span class='op'>=</span> <span class='const'>Nokogiri</span><span class='period'>.</span><span class='const'>XML</span> <span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
|
332
|
+
<span class='kw'>end</span></pre>
|
333
|
+
</td>
|
334
|
+
</tr>
|
335
|
+
</table>
|
336
|
+
</div>
|
337
|
+
|
338
|
+
</div>
|
339
|
+
|
340
|
+
|
341
|
+
<div id="class_method_details" class="method_details_list">
|
342
|
+
<h2>Class Method Details</h2>
|
343
|
+
|
344
|
+
|
345
|
+
<div class="method_details first">
|
346
|
+
<p class="signature first" id="parse-class_method">
|
347
|
+
|
348
|
+
+ (<tt>Object</tt>) <strong>parse</strong>(file)
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
</p><table class="source_code">
|
353
|
+
<tr>
|
354
|
+
<td>
|
355
|
+
<pre class="lines">
|
356
|
+
|
357
|
+
|
358
|
+
10
|
359
|
+
11
|
360
|
+
12</pre>
|
361
|
+
</td>
|
362
|
+
<td>
|
363
|
+
<pre class="code"><span class="info file"># File 'lib/epub/parser/publication.rb', line 10</span>
|
364
|
+
|
365
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
|
366
|
+
<span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span>
|
367
|
+
<span class='kw'>end</span></pre>
|
368
|
+
</td>
|
369
|
+
</tr>
|
370
|
+
</table>
|
371
|
+
</div>
|
372
|
+
|
373
|
+
</div>
|
374
|
+
|
375
|
+
<div id="instance_method_details" class="method_details_list">
|
376
|
+
<h2>Instance Method Details</h2>
|
377
|
+
|
378
|
+
|
379
|
+
<div class="method_details first">
|
380
|
+
<p class="signature first" id="parse-instance_method">
|
381
|
+
|
382
|
+
- (<tt>Object</tt>) <strong>parse</strong>
|
383
|
+
|
384
|
+
|
385
|
+
|
386
|
+
</p><table class="source_code">
|
387
|
+
<tr>
|
388
|
+
<td>
|
389
|
+
<pre class="lines">
|
390
|
+
|
391
|
+
|
392
|
+
21
|
393
|
+
22
|
394
|
+
23
|
395
|
+
24
|
396
|
+
25
|
397
|
+
26
|
398
|
+
27
|
399
|
+
28
|
400
|
+
29</pre>
|
401
|
+
</td>
|
402
|
+
<td>
|
403
|
+
<pre class="code"><span class="info file"># File 'lib/epub/parser/publication.rb', line 21</span>
|
404
|
+
|
405
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_parse'>parse</span>
|
406
|
+
<span class='comment'># parse_metadata
|
407
|
+
</span> <span class='id identifier rubyid_parse_manifest'>parse_manifest</span>
|
408
|
+
<span class='id identifier rubyid_parse_spine'>parse_spine</span>
|
409
|
+
<span class='comment'># parse_guide
|
410
|
+
</span> <span class='comment'># parse_bindings
|
411
|
+
</span>
|
412
|
+
<span class='ivar'>@package</span>
|
413
|
+
<span class='kw'>end</span></pre>
|
414
|
+
</td>
|
415
|
+
</tr>
|
416
|
+
</table>
|
417
|
+
</div>
|
418
|
+
|
419
|
+
<div class="method_details ">
|
420
|
+
<p class="signature " id="parse_bindings-instance_method">
|
421
|
+
|
422
|
+
- (<tt>Object</tt>) <strong>parse_bindings</strong>
|
423
|
+
|
424
|
+
|
425
|
+
|
426
|
+
</p><table class="source_code">
|
427
|
+
<tr>
|
428
|
+
<td>
|
429
|
+
<pre class="lines">
|
430
|
+
|
431
|
+
|
432
|
+
82
|
433
|
+
83
|
434
|
+
84</pre>
|
435
|
+
</td>
|
436
|
+
<td>
|
437
|
+
<pre class="code"><span class="info file"># File 'lib/epub/parser/publication.rb', line 82</span>
|
438
|
+
|
439
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_parse_bindings'>parse_bindings</span>
|
440
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>still not implemented</span><span class='tstring_end'>'</span></span>
|
441
|
+
<span class='kw'>end</span></pre>
|
442
|
+
</td>
|
443
|
+
</tr>
|
444
|
+
</table>
|
445
|
+
</div>
|
446
|
+
|
447
|
+
<div class="method_details ">
|
448
|
+
<p class="signature " id="parse_guide-instance_method">
|
449
|
+
|
450
|
+
- (<tt>Object</tt>) <strong>parse_guide</strong>
|
451
|
+
|
452
|
+
|
453
|
+
|
454
|
+
</p><table class="source_code">
|
455
|
+
<tr>
|
456
|
+
<td>
|
457
|
+
<pre class="lines">
|
458
|
+
|
459
|
+
|
460
|
+
78
|
461
|
+
79
|
462
|
+
80</pre>
|
463
|
+
</td>
|
464
|
+
<td>
|
465
|
+
<pre class="code"><span class="info file"># File 'lib/epub/parser/publication.rb', line 78</span>
|
466
|
+
|
467
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_parse_guide'>parse_guide</span>
|
468
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>still not implemented</span><span class='tstring_end'>'</span></span>
|
469
|
+
<span class='kw'>end</span></pre>
|
470
|
+
</td>
|
471
|
+
</tr>
|
472
|
+
</table>
|
473
|
+
</div>
|
474
|
+
|
475
|
+
<div class="method_details ">
|
476
|
+
<p class="signature " id="parse_manifest-instance_method">
|
477
|
+
|
478
|
+
- (<tt>Object</tt>) <strong>parse_manifest</strong>
|
479
|
+
|
480
|
+
|
481
|
+
|
482
|
+
</p><table class="source_code">
|
483
|
+
<tr>
|
484
|
+
<td>
|
485
|
+
<pre class="lines">
|
486
|
+
|
487
|
+
|
488
|
+
35
|
489
|
+
36
|
490
|
+
37
|
491
|
+
38
|
492
|
+
39
|
493
|
+
40
|
494
|
+
41
|
495
|
+
42
|
496
|
+
43
|
497
|
+
44
|
498
|
+
45
|
499
|
+
46
|
500
|
+
47
|
501
|
+
48
|
502
|
+
49
|
503
|
+
50
|
504
|
+
51
|
505
|
+
52
|
506
|
+
53
|
507
|
+
54
|
508
|
+
55
|
509
|
+
56</pre>
|
510
|
+
</td>
|
511
|
+
<td>
|
512
|
+
<pre class="code"><span class="info file"># File 'lib/epub/parser/publication.rb', line 35</span>
|
513
|
+
|
514
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_parse_manifest'>parse_manifest</span>
|
515
|
+
<span class='id identifier rubyid_manifest'>manifest</span> <span class='op'>=</span> <span class='ivar'>@package</span><span class='period'>.</span><span class='id identifier rubyid_manifest'>manifest</span> <span class='op'>=</span> <span class='const'>EPUB</span><span class='op'>::</span><span class='const'>Publication</span><span class='op'>::</span><span class='const'>Package</span><span class='op'>::</span><span class='const'>Manifest</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
516
|
+
<span class='id identifier rubyid_elem'>elem</span> <span class='op'>=</span> <span class='ivar'>@doc</span><span class='period'>.</span><span class='id identifier rubyid_xpath'>xpath</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/opf:package/opf:manifest</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='const'>EPUB</span><span class='op'>::</span><span class='const'>NAMESPACES</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
517
|
+
<span class='id identifier rubyid_manifest'>manifest</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>=</span> <span class='id identifier rubyid_elem'>elem</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>id</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
518
|
+
|
519
|
+
<span class='id identifier rubyid_fallback_map'>fallback_map</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
520
|
+
<span class='id identifier rubyid_elem'>elem</span><span class='period'>.</span><span class='id identifier rubyid_xpath'>xpath</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>./opf:item</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='const'>EPUB</span><span class='op'>::</span><span class='const'>NAMESPACES</span><span class='rparen'>)</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_elm'>elm</span><span class='op'>|</span>
|
521
|
+
<span class='id identifier rubyid_item'>item</span> <span class='op'>=</span> <span class='const'>EPUB</span><span class='op'>::</span><span class='const'>Publication</span><span class='op'>::</span><span class='const'>Package</span><span class='op'>::</span><span class='const'>Manifest</span><span class='op'>::</span><span class='const'>Item</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
522
|
+
<span class='qwords_beg'>%w[ </span><span class='tstring_content'>id</span><span class='words_sep'> </span><span class='tstring_content'>media-type</span><span class='words_sep'> </span><span class='tstring_content'>media-overlay</span><span class='words_sep'> ]</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_attr'>attr</span><span class='op'>|</span>
|
523
|
+
<span class='id identifier rubyid_item'>item</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attr'>attr</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'>-</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>_</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_elm'>elm</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span>
|
524
|
+
<span class='kw'>end</span>
|
525
|
+
<span class='id identifier rubyid_item'>item</span><span class='period'>.</span><span class='id identifier rubyid_href'>href</span> <span class='op'>=</span> <span class='ivar'>@rootfile</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span> <span class='const'>Addressable</span><span class='op'>::</span><span class='const'>URI</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_elm'>elm</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>href</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
526
|
+
<span class='id identifier rubyid_fallback_map'>fallback_map</span><span class='lbracket'>[</span><span class='id identifier rubyid_elm'>elm</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>fallback</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_item'>item</span> <span class='kw'>if</span> <span class='id identifier rubyid_elm'>elm</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>fallback</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
527
|
+
<span class='id identifier rubyid_item'>item</span><span class='period'>.</span><span class='id identifier rubyid_properties'>properties</span> <span class='op'>=</span> <span class='id identifier rubyid_elm'>elm</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>properties</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>?</span> <span class='id identifier rubyid_elm'>elm</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>properties</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='op'>:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
528
|
+
<span class='id identifier rubyid_manifest'>manifest</span> <span class='op'><<</span> <span class='id identifier rubyid_item'>item</span>
|
529
|
+
<span class='kw'>end</span>
|
530
|
+
<span class='id identifier rubyid_fallback_map'>fallback_map</span><span class='period'>.</span><span class='id identifier rubyid_each_pair'>each_pair</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_from'>from</span><span class='op'>|</span>
|
531
|
+
<span class='id identifier rubyid_from'>from</span><span class='period'>.</span><span class='id identifier rubyid_fallback'>fallback</span> <span class='op'>=</span> <span class='id identifier rubyid_manifest'>manifest</span><span class='lbracket'>[</span><span class='id identifier rubyid_id'>id</span><span class='rbracket'>]</span>
|
532
|
+
<span class='kw'>end</span>
|
533
|
+
|
534
|
+
<span class='id identifier rubyid_manifest'>manifest</span>
|
535
|
+
<span class='kw'>end</span></pre>
|
536
|
+
</td>
|
537
|
+
</tr>
|
538
|
+
</table>
|
539
|
+
</div>
|
540
|
+
|
541
|
+
<div class="method_details ">
|
542
|
+
<p class="signature " id="parse_metadata-instance_method">
|
543
|
+
|
544
|
+
- (<tt>Object</tt>) <strong>parse_metadata</strong>
|
545
|
+
|
546
|
+
|
547
|
+
|
548
|
+
</p><table class="source_code">
|
549
|
+
<tr>
|
550
|
+
<td>
|
551
|
+
<pre class="lines">
|
552
|
+
|
553
|
+
|
554
|
+
31
|
555
|
+
32
|
556
|
+
33</pre>
|
557
|
+
</td>
|
558
|
+
<td>
|
559
|
+
<pre class="code"><span class="info file"># File 'lib/epub/parser/publication.rb', line 31</span>
|
560
|
+
|
561
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_parse_metadata'>parse_metadata</span>
|
562
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>still not implemented</span><span class='tstring_end'>'</span></span>
|
563
|
+
<span class='kw'>end</span></pre>
|
564
|
+
</td>
|
565
|
+
</tr>
|
566
|
+
</table>
|
567
|
+
</div>
|
568
|
+
|
569
|
+
<div class="method_details ">
|
570
|
+
<p class="signature " id="parse_spine-instance_method">
|
571
|
+
|
572
|
+
- (<tt>Object</tt>) <strong>parse_spine</strong>
|
573
|
+
|
574
|
+
|
575
|
+
|
576
|
+
</p><table class="source_code">
|
577
|
+
<tr>
|
578
|
+
<td>
|
579
|
+
<pre class="lines">
|
580
|
+
|
581
|
+
|
582
|
+
58
|
583
|
+
59
|
584
|
+
60
|
585
|
+
61
|
586
|
+
62
|
587
|
+
63
|
588
|
+
64
|
589
|
+
65
|
590
|
+
66
|
591
|
+
67
|
592
|
+
68
|
593
|
+
69
|
594
|
+
70
|
595
|
+
71
|
596
|
+
72
|
597
|
+
73
|
598
|
+
74
|
599
|
+
75
|
600
|
+
76</pre>
|
601
|
+
</td>
|
602
|
+
<td>
|
603
|
+
<pre class="code"><span class="info file"># File 'lib/epub/parser/publication.rb', line 58</span>
|
604
|
+
|
605
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_parse_spine'>parse_spine</span>
|
606
|
+
<span class='id identifier rubyid_spine'>spine</span> <span class='op'>=</span> <span class='ivar'>@package</span><span class='period'>.</span><span class='id identifier rubyid_spine'>spine</span> <span class='op'>=</span> <span class='const'>EPUB</span><span class='op'>::</span><span class='const'>Publication</span><span class='op'>::</span><span class='const'>Package</span><span class='op'>::</span><span class='const'>Spine</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
607
|
+
<span class='id identifier rubyid_elem'>elem</span> <span class='op'>=</span> <span class='ivar'>@doc</span><span class='period'>.</span><span class='id identifier rubyid_xpath'>xpath</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/opf:package/opf:spine</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='const'>EPUB</span><span class='op'>::</span><span class='const'>NAMESPACES</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
608
|
+
<span class='qwords_beg'>%w[ </span><span class='tstring_content'>id</span><span class='words_sep'> </span><span class='tstring_content'>toc</span><span class='words_sep'> </span><span class='tstring_content'>page-progression-direction</span><span class='words_sep'> ]</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_attr'>attr</span><span class='op'>|</span>
|
609
|
+
<span class='id identifier rubyid_spine'>spine</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attr'>attr</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'>-</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>_</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_elem'>elem</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
610
|
+
<span class='kw'>end</span>
|
611
|
+
|
612
|
+
<span class='id identifier rubyid_elem'>elem</span><span class='period'>.</span><span class='id identifier rubyid_xpath'>xpath</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>./opf:itemref</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='const'>EPUB</span><span class='op'>::</span><span class='const'>NAMESPACES</span><span class='rparen'>)</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_elm'>elm</span><span class='op'>|</span>
|
613
|
+
<span class='id identifier rubyid_itemref'>itemref</span> <span class='op'>=</span> <span class='const'>EPUB</span><span class='op'>::</span><span class='const'>Publication</span><span class='op'>::</span><span class='const'>Package</span><span class='op'>::</span><span class='const'>Spine</span><span class='op'>::</span><span class='const'>Itemref</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
614
|
+
<span class='qwords_beg'>%w[ </span><span class='tstring_content'>idref</span><span class='words_sep'> </span><span class='tstring_content'>id</span><span class='words_sep'> ]</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_attr'>attr</span><span class='op'>|</span>
|
615
|
+
<span class='id identifier rubyid_itemref'>itemref</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attr'>attr</span><span class='rbrace'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_elm'>elm</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span>
|
616
|
+
<span class='kw'>end</span>
|
617
|
+
<span class='id identifier rubyid_itemref'>itemref</span><span class='period'>.</span><span class='id identifier rubyid_linear'>linear</span> <span class='op'>=</span> <span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_elm'>elm</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>linear</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>no</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
618
|
+
<span class='id identifier rubyid_itemref'>itemref</span><span class='period'>.</span><span class='id identifier rubyid_properties'>properties</span> <span class='op'>=</span> <span class='id identifier rubyid_elm'>elm</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>properties</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>?</span> <span class='id identifier rubyid_elm'>elm</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>properties</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='op'>:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
619
|
+
<span class='id identifier rubyid_spine'>spine</span> <span class='op'><<</span> <span class='id identifier rubyid_itemref'>itemref</span>
|
620
|
+
<span class='kw'>end</span>
|
621
|
+
|
622
|
+
<span class='id identifier rubyid_spine'>spine</span>
|
623
|
+
<span class='kw'>end</span></pre>
|
624
|
+
</td>
|
625
|
+
</tr>
|
626
|
+
</table>
|
627
|
+
</div>
|
628
|
+
|
629
|
+
</div>
|
630
|
+
|
631
|
+
</div>
|
632
|
+
|
633
|
+
<div id="footer">
|
634
|
+
Generated on Fri Dec 30 08:49:44 2011 by
|
635
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
636
|
+
0.7.4 (ruby-1.9.3).
|
637
|
+
</div>
|
638
|
+
|
639
|
+
</body>
|
640
|
+
</html>
|