vtt2ass 0.2.8 → 0.2.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +6 -5
- data/README.md +1 -0
- data/doc/ASSFile.html +546 -29
- data/doc/ASSLine.html +940 -0
- data/doc/ASSStyle.html +23 -147
- data/doc/ASSStyleParams.html +819 -0
- data/doc/Application.html +58 -149
- data/doc/VTTFile.html +454 -0
- data/doc/VTTLine.html +700 -0
- data/doc/Vtt2ass.html +61 -29
- data/doc/_index.html +12 -17
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +35 -8
- data/doc/index.html +35 -8
- data/doc/method_list.html +177 -49
- data/doc/top-level-namespace.html +3 -3
- data/lib/vtt2ass.rb +98 -31
- data/lib/vtt2ass/ASSFile.rb +9 -1
- data/lib/vtt2ass/ASSLine.rb +1 -1
- data/lib/vtt2ass/ASSStyle.rb +3 -0
- data/lib/vtt2ass/ASSStyleParams.rb +14 -1
- data/lib/vtt2ass/Application.rb +24 -9
- data/lib/vtt2ass/VTTFile.rb +19 -7
- data/lib/vtt2ass/VTTLine.rb +5 -2
- data/lib/vtt2ass/version.rb +6 -1
- data/vtt2ass.gemspec +5 -5
- metadata +28 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64688a982ce477a836bb7ccb206dc6b8055dc9eb264e2062114787a6cbc9b0e4
|
4
|
+
data.tar.gz: 8bca338d3f218d453c316a2676a68960a72fa3c5bd2ae6794d373cbb57412955
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca013fd08b2e2317b2be56ae94e71bb63e87dd5909c2662d9e880c22c00dab3903b0a56d01b5b8b737599a5368a4f7387bc2165a844fefd244e17e1ac2291749
|
7
|
+
data.tar.gz: 94e3a884c060141fea32a0fdfad566d745b0d7966dfe508992c8f14709ea869a2f6cc7ff11012a7132fdc5c12368bfd092534f4cf9f8383ef5eefba0f9efb595
|
data/Gemfile
CHANGED
@@ -3,8 +3,9 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in vtt2ass.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
gem '
|
7
|
-
gem '
|
8
|
-
|
9
|
-
gem
|
10
|
-
gem
|
6
|
+
gem 'htmlentities', '~> 4.3'
|
7
|
+
gem 'tty-option', '~> 0.1'
|
8
|
+
|
9
|
+
gem 'yard', '~> 0.9'
|
10
|
+
gem 'rake', '~> 12.0'
|
11
|
+
gem 'minitest', '~> 5.0'
|
data/README.md
CHANGED
@@ -42,6 +42,7 @@ Specific options:
|
|
42
42
|
-o, --output PATH Specify a custom output directory (default: './')
|
43
43
|
-f, --font-family FONT Specify a font family for the subtitles (default: 'Open Sans Semibold')
|
44
44
|
-s, --font-size SIZE Specify a font size for the subtitles (default: 52)
|
45
|
+
-t, --title TITLE Specify a title for you file. If the input is a directory, all files will share the same title.
|
45
46
|
-v, --version Show version
|
46
47
|
```
|
47
48
|
|
data/doc/ASSFile.html
CHANGED
@@ -102,7 +102,7 @@
|
|
102
102
|
<h2>Overview</h2><div class="docstring">
|
103
103
|
<div class="discussion">
|
104
104
|
|
105
|
-
<p>This class defines
|
105
|
+
<p>This class defines an ASS subtitle file.</p>
|
106
106
|
|
107
107
|
|
108
108
|
</div>
|
@@ -114,6 +114,152 @@
|
|
114
114
|
|
115
115
|
|
116
116
|
|
117
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
118
|
+
<ul class="summary">
|
119
|
+
|
120
|
+
<li class="public ">
|
121
|
+
<span class="summary_signature">
|
122
|
+
|
123
|
+
<a href="#ass_lines-instance_method" title="#ass_lines (instance method)">#<strong>ass_lines</strong> ⇒ Object </a>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
</span>
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
<span class="summary_desc"><div class='inline'>
|
141
|
+
<p>Returns the value of attribute ass_lines.</p>
|
142
|
+
</div></span>
|
143
|
+
|
144
|
+
</li>
|
145
|
+
|
146
|
+
|
147
|
+
<li class="public ">
|
148
|
+
<span class="summary_signature">
|
149
|
+
|
150
|
+
<a href="#ass_styles-instance_method" title="#ass_styles (instance method)">#<strong>ass_styles</strong> ⇒ Object </a>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
</span>
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
<span class="summary_desc"><div class='inline'>
|
168
|
+
<p>Returns the value of attribute ass_styles.</p>
|
169
|
+
</div></span>
|
170
|
+
|
171
|
+
</li>
|
172
|
+
|
173
|
+
|
174
|
+
<li class="public ">
|
175
|
+
<span class="summary_signature">
|
176
|
+
|
177
|
+
<a href="#height-instance_method" title="#height (instance method)">#<strong>height</strong> ⇒ Object </a>
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
</span>
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
<span class="note title readonly">readonly</span>
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
<span class="summary_desc"><div class='inline'>
|
197
|
+
<p>Returns the value of attribute height.</p>
|
198
|
+
</div></span>
|
199
|
+
|
200
|
+
</li>
|
201
|
+
|
202
|
+
|
203
|
+
<li class="public ">
|
204
|
+
<span class="summary_signature">
|
205
|
+
|
206
|
+
<a href="#title-instance_method" title="#title (instance method)">#<strong>title</strong> ⇒ Object </a>
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
</span>
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
<span class="note title readonly">readonly</span>
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
<span class="summary_desc"><div class='inline'>
|
226
|
+
<p>Returns the value of attribute title.</p>
|
227
|
+
</div></span>
|
228
|
+
|
229
|
+
</li>
|
230
|
+
|
231
|
+
|
232
|
+
<li class="public ">
|
233
|
+
<span class="summary_signature">
|
234
|
+
|
235
|
+
<a href="#width-instance_method" title="#width (instance method)">#<strong>width</strong> ⇒ Object </a>
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
</span>
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
<span class="note title readonly">readonly</span>
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
<span class="summary_desc"><div class='inline'>
|
255
|
+
<p>Returns the value of attribute width.</p>
|
256
|
+
</div></span>
|
257
|
+
|
258
|
+
</li>
|
259
|
+
|
260
|
+
|
261
|
+
</ul>
|
262
|
+
|
117
263
|
|
118
264
|
|
119
265
|
|
@@ -128,7 +274,31 @@
|
|
128
274
|
<li class="public ">
|
129
275
|
<span class="summary_signature">
|
130
276
|
|
131
|
-
<a href="#
|
277
|
+
<a href="#convertVTTtoASS-instance_method" title="#convertVTTtoASS (instance method)">#<strong>convertVTTtoASS</strong>(vtt_file, font_family, font_size) ⇒ Object </a>
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
</span>
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
<span class="summary_desc"><div class='inline'>
|
292
|
+
<p>This method receives a VTTFile object and font arguments creates new ASSLine with the params of each VTTLine.</p>
|
293
|
+
</div></span>
|
294
|
+
|
295
|
+
</li>
|
296
|
+
|
297
|
+
|
298
|
+
<li class="public ">
|
299
|
+
<span class="summary_signature">
|
300
|
+
|
301
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(title, width, height) ⇒ ASSFile </a>
|
132
302
|
|
133
303
|
|
134
304
|
|
@@ -145,7 +315,7 @@
|
|
145
315
|
|
146
316
|
|
147
317
|
<span class="summary_desc"><div class='inline'>
|
148
|
-
<p>
|
318
|
+
<p>Creates a new ASSFile instance and assigns the default values of instance variables.</p>
|
149
319
|
</div></span>
|
150
320
|
|
151
321
|
</li>
|
@@ -172,6 +342,30 @@
|
|
172
342
|
<p>This method concatenates the object data in the right order for a string output.</p>
|
173
343
|
</div></span>
|
174
344
|
|
345
|
+
</li>
|
346
|
+
|
347
|
+
|
348
|
+
<li class="public ">
|
349
|
+
<span class="summary_signature">
|
350
|
+
|
351
|
+
<a href="#writeToFile-instance_method" title="#writeToFile (instance method)">#<strong>writeToFile</strong>(file_path) ⇒ Object </a>
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
</span>
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
<span class="summary_desc"><div class='inline'>
|
366
|
+
<p>This method writes the content of the ASSFile object into a file path that is provided.</p>
|
367
|
+
</div></span>
|
368
|
+
|
175
369
|
</li>
|
176
370
|
|
177
371
|
|
@@ -184,7 +378,7 @@
|
|
184
378
|
<div class="method_details first">
|
185
379
|
<h3 class="signature first" id="initialize-instance_method">
|
186
380
|
|
187
|
-
#<strong>initialize</strong>(
|
381
|
+
#<strong>initialize</strong>(title, width, height) ⇒ <tt><span class='object_link'><a href="" title="ASSFile (class)">ASSFile</a></span></tt>
|
188
382
|
|
189
383
|
|
190
384
|
|
@@ -193,16 +387,7 @@
|
|
193
387
|
</h3><div class="docstring">
|
194
388
|
<div class="discussion">
|
195
389
|
|
196
|
-
<p>
|
197
|
-
<ul><li>
|
198
|
-
<p>Requires <code>ass_styles</code>, a list of ASSStyle as input.</p>
|
199
|
-
</li><li>
|
200
|
-
<p>Requires <code>ass_subs</code>, a list of ASSSubtitles as input.</p>
|
201
|
-
</li><li>
|
202
|
-
<p>Requires a video <code>width</code> as input.</p>
|
203
|
-
</li><li>
|
204
|
-
<p>Requires a video <code>height</code> as input.</p>
|
205
|
-
</li></ul>
|
390
|
+
<p>Creates a new ASSFile instance and assigns the default values of instance variables.</p>
|
206
391
|
|
207
392
|
|
208
393
|
</div>
|
@@ -216,7 +401,6 @@
|
|
216
401
|
<pre class="lines">
|
217
402
|
|
218
403
|
|
219
|
-
12
|
220
404
|
13
|
221
405
|
14
|
222
406
|
15
|
@@ -240,17 +424,18 @@
|
|
240
424
|
33
|
241
425
|
34
|
242
426
|
35
|
243
|
-
36
|
427
|
+
36
|
428
|
+
37</pre>
|
244
429
|
</td>
|
245
430
|
<td>
|
246
|
-
<pre class="code"><span class="info file"># File 'lib/vtt2ass/ASSFile.rb', line
|
431
|
+
<pre class="code"><span class="info file"># File 'lib/vtt2ass/ASSFile.rb', line 13</span>
|
247
432
|
|
248
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier
|
433
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_title'>title</span><span class='comma'>,</span> <span class='id identifier rubyid_width'>width</span><span class='comma'>,</span> <span class='id identifier rubyid_height'>height</span><span class='rparen'>)</span>
|
249
434
|
<span class='ivar'>@width</span> <span class='op'>=</span> <span class='id identifier rubyid_width'>width</span>
|
250
435
|
<span class='ivar'>@height</span> <span class='op'>=</span> <span class='id identifier rubyid_height'>height</span>
|
251
436
|
<span class='ivar'>@header</span> <span class='op'>=</span> <span class='lbracket'>[</span>
|
252
437
|
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>[Script Info]</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
253
|
-
<span class='tstring'><span class='tstring_beg'
|
438
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Title: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_title'>title</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
254
439
|
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ScriptType: v4.00+</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
255
440
|
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Collisions: Normal</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
256
441
|
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>PlayDepth: 0</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
@@ -262,20 +447,240 @@
|
|
262
447
|
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>[V4+ Styles]</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
263
448
|
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding</span><span class='tstring_end'>'</span></span>
|
264
449
|
<span class='rbracket'>]</span>
|
265
|
-
<span class='ivar'>@ass_styles</span> <span class='op'>=</span> <span class='id identifier rubyid_ass_styles'>ass_styles</span>
|
266
450
|
<span class='ivar'>@events</span> <span class='op'>=</span> <span class='lbracket'>[</span>
|
267
451
|
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
268
452
|
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>[Events]</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
269
453
|
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text</span><span class='tstring_end'>'</span></span>
|
270
454
|
<span class='rbracket'>]</span>
|
271
|
-
<span class='ivar'>@
|
455
|
+
<span class='ivar'>@ass_styles</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
456
|
+
<span class='ivar'>@ass_lines</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
457
|
+
<span class='kw'>end</span></pre>
|
458
|
+
</td>
|
459
|
+
</tr>
|
460
|
+
</table>
|
461
|
+
</div>
|
462
|
+
|
463
|
+
</div>
|
464
|
+
|
465
|
+
<div id="instance_attr_details" class="attr_details">
|
466
|
+
<h2>Instance Attribute Details</h2>
|
467
|
+
|
468
|
+
|
469
|
+
<span id="ass_lines=-instance_method"></span>
|
470
|
+
<div class="method_details first">
|
471
|
+
<h3 class="signature first" id="ass_lines-instance_method">
|
472
|
+
|
473
|
+
#<strong>ass_lines</strong> ⇒ <tt>Object</tt>
|
474
|
+
|
475
|
+
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
</h3><div class="docstring">
|
480
|
+
<div class="discussion">
|
481
|
+
|
482
|
+
<p>Returns the value of attribute ass_lines.</p>
|
483
|
+
|
484
|
+
|
485
|
+
</div>
|
486
|
+
</div>
|
487
|
+
<div class="tags">
|
488
|
+
|
489
|
+
|
490
|
+
</div><table class="source_code">
|
491
|
+
<tr>
|
492
|
+
<td>
|
493
|
+
<pre class="lines">
|
494
|
+
|
495
|
+
|
496
|
+
9
|
497
|
+
10
|
498
|
+
11</pre>
|
499
|
+
</td>
|
500
|
+
<td>
|
501
|
+
<pre class="code"><span class="info file"># File 'lib/vtt2ass/ASSFile.rb', line 9</span>
|
502
|
+
|
503
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_ass_lines'>ass_lines</span>
|
504
|
+
<span class='ivar'>@ass_lines</span>
|
272
505
|
<span class='kw'>end</span></pre>
|
273
506
|
</td>
|
274
507
|
</tr>
|
275
508
|
</table>
|
276
509
|
</div>
|
510
|
+
|
511
|
+
|
512
|
+
<span id="ass_styles=-instance_method"></span>
|
513
|
+
<div class="method_details ">
|
514
|
+
<h3 class="signature " id="ass_styles-instance_method">
|
515
|
+
|
516
|
+
#<strong>ass_styles</strong> ⇒ <tt>Object</tt>
|
517
|
+
|
518
|
+
|
277
519
|
|
520
|
+
|
521
|
+
|
522
|
+
</h3><div class="docstring">
|
523
|
+
<div class="discussion">
|
524
|
+
|
525
|
+
<p>Returns the value of attribute ass_styles.</p>
|
526
|
+
|
527
|
+
|
528
|
+
</div>
|
529
|
+
</div>
|
530
|
+
<div class="tags">
|
531
|
+
|
532
|
+
|
533
|
+
</div><table class="source_code">
|
534
|
+
<tr>
|
535
|
+
<td>
|
536
|
+
<pre class="lines">
|
537
|
+
|
538
|
+
|
539
|
+
9
|
540
|
+
10
|
541
|
+
11</pre>
|
542
|
+
</td>
|
543
|
+
<td>
|
544
|
+
<pre class="code"><span class="info file"># File 'lib/vtt2ass/ASSFile.rb', line 9</span>
|
545
|
+
|
546
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_ass_styles'>ass_styles</span>
|
547
|
+
<span class='ivar'>@ass_styles</span>
|
548
|
+
<span class='kw'>end</span></pre>
|
549
|
+
</td>
|
550
|
+
</tr>
|
551
|
+
</table>
|
278
552
|
</div>
|
553
|
+
|
554
|
+
|
555
|
+
<span id=""></span>
|
556
|
+
<div class="method_details ">
|
557
|
+
<h3 class="signature " id="height-instance_method">
|
558
|
+
|
559
|
+
#<strong>height</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
560
|
+
|
561
|
+
|
562
|
+
|
563
|
+
|
564
|
+
|
565
|
+
</h3><div class="docstring">
|
566
|
+
<div class="discussion">
|
567
|
+
|
568
|
+
<p>Returns the value of attribute height.</p>
|
569
|
+
|
570
|
+
|
571
|
+
</div>
|
572
|
+
</div>
|
573
|
+
<div class="tags">
|
574
|
+
|
575
|
+
|
576
|
+
</div><table class="source_code">
|
577
|
+
<tr>
|
578
|
+
<td>
|
579
|
+
<pre class="lines">
|
580
|
+
|
581
|
+
|
582
|
+
8
|
583
|
+
9
|
584
|
+
10</pre>
|
585
|
+
</td>
|
586
|
+
<td>
|
587
|
+
<pre class="code"><span class="info file"># File 'lib/vtt2ass/ASSFile.rb', line 8</span>
|
588
|
+
|
589
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_height'>height</span>
|
590
|
+
<span class='ivar'>@height</span>
|
591
|
+
<span class='kw'>end</span></pre>
|
592
|
+
</td>
|
593
|
+
</tr>
|
594
|
+
</table>
|
595
|
+
</div>
|
596
|
+
|
597
|
+
|
598
|
+
<span id=""></span>
|
599
|
+
<div class="method_details ">
|
600
|
+
<h3 class="signature " id="title-instance_method">
|
601
|
+
|
602
|
+
#<strong>title</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
603
|
+
|
604
|
+
|
605
|
+
|
606
|
+
|
607
|
+
|
608
|
+
</h3><div class="docstring">
|
609
|
+
<div class="discussion">
|
610
|
+
|
611
|
+
<p>Returns the value of attribute title.</p>
|
612
|
+
|
613
|
+
|
614
|
+
</div>
|
615
|
+
</div>
|
616
|
+
<div class="tags">
|
617
|
+
|
618
|
+
|
619
|
+
</div><table class="source_code">
|
620
|
+
<tr>
|
621
|
+
<td>
|
622
|
+
<pre class="lines">
|
623
|
+
|
624
|
+
|
625
|
+
8
|
626
|
+
9
|
627
|
+
10</pre>
|
628
|
+
</td>
|
629
|
+
<td>
|
630
|
+
<pre class="code"><span class="info file"># File 'lib/vtt2ass/ASSFile.rb', line 8</span>
|
631
|
+
|
632
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_title'>title</span>
|
633
|
+
<span class='ivar'>@title</span>
|
634
|
+
<span class='kw'>end</span></pre>
|
635
|
+
</td>
|
636
|
+
</tr>
|
637
|
+
</table>
|
638
|
+
</div>
|
639
|
+
|
640
|
+
|
641
|
+
<span id=""></span>
|
642
|
+
<div class="method_details ">
|
643
|
+
<h3 class="signature " id="width-instance_method">
|
644
|
+
|
645
|
+
#<strong>width</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
646
|
+
|
647
|
+
|
648
|
+
|
649
|
+
|
650
|
+
|
651
|
+
</h3><div class="docstring">
|
652
|
+
<div class="discussion">
|
653
|
+
|
654
|
+
<p>Returns the value of attribute width.</p>
|
655
|
+
|
656
|
+
|
657
|
+
</div>
|
658
|
+
</div>
|
659
|
+
<div class="tags">
|
660
|
+
|
661
|
+
|
662
|
+
</div><table class="source_code">
|
663
|
+
<tr>
|
664
|
+
<td>
|
665
|
+
<pre class="lines">
|
666
|
+
|
667
|
+
|
668
|
+
8
|
669
|
+
9
|
670
|
+
10</pre>
|
671
|
+
</td>
|
672
|
+
<td>
|
673
|
+
<pre class="code"><span class="info file"># File 'lib/vtt2ass/ASSFile.rb', line 8</span>
|
674
|
+
|
675
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_width'>width</span>
|
676
|
+
<span class='ivar'>@width</span>
|
677
|
+
<span class='kw'>end</span></pre>
|
678
|
+
</td>
|
679
|
+
</tr>
|
680
|
+
</table>
|
681
|
+
</div>
|
682
|
+
|
683
|
+
</div>
|
279
684
|
|
280
685
|
|
281
686
|
<div id="instance_method_details" class="method_details_list">
|
@@ -283,7 +688,72 @@
|
|
283
688
|
|
284
689
|
|
285
690
|
<div class="method_details first">
|
286
|
-
<h3 class="signature first" id="
|
691
|
+
<h3 class="signature first" id="convertVTTtoASS-instance_method">
|
692
|
+
|
693
|
+
#<strong>convertVTTtoASS</strong>(vtt_file, font_family, font_size) ⇒ <tt>Object</tt>
|
694
|
+
|
695
|
+
|
696
|
+
|
697
|
+
|
698
|
+
|
699
|
+
</h3><div class="docstring">
|
700
|
+
<div class="discussion">
|
701
|
+
|
702
|
+
<p>This method receives a VTTFile object and font arguments creates new ASSLine with the params of each VTTLine. All those ASSLine are stored in an array. It also creates an array of ASSStyle that will be used in the ASS style list.</p>
|
703
|
+
|
704
|
+
|
705
|
+
</div>
|
706
|
+
</div>
|
707
|
+
<div class="tags">
|
708
|
+
|
709
|
+
|
710
|
+
</div><table class="source_code">
|
711
|
+
<tr>
|
712
|
+
<td>
|
713
|
+
<pre class="lines">
|
714
|
+
|
715
|
+
|
716
|
+
43
|
717
|
+
44
|
718
|
+
45
|
719
|
+
46
|
720
|
+
47
|
721
|
+
48
|
722
|
+
49
|
723
|
+
50
|
724
|
+
51
|
725
|
+
52
|
726
|
+
53
|
727
|
+
54
|
728
|
+
55
|
729
|
+
56
|
730
|
+
57</pre>
|
731
|
+
</td>
|
732
|
+
<td>
|
733
|
+
<pre class="code"><span class="info file"># File 'lib/vtt2ass/ASSFile.rb', line 43</span>
|
734
|
+
|
735
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_convertVTTtoASS'>convertVTTtoASS</span><span class='lparen'>(</span><span class='id identifier rubyid_vtt_file'>vtt_file</span><span class='comma'>,</span> <span class='id identifier rubyid_font_family'>font_family</span><span class='comma'>,</span> <span class='id identifier rubyid_font_size'>font_size</span><span class='rparen'>)</span>
|
736
|
+
<span class='id identifier rubyid_vtt_file'>vtt_file</span><span class='period'>.</span><span class='id identifier rubyid_lines'>lines</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_line'>line</span><span class='op'>|</span>
|
737
|
+
<span class='ivar'>@ass_lines</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="ASSLine.html" title="ASSLine (class)">ASSLine</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ASSLine.html#initialize-instance_method" title="ASSLine#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_style'>style</span><span class='comma'>,</span> <span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_time_start'>time_start</span><span class='comma'>,</span> <span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_time_end'>time_end</span><span class='comma'>,</span> <span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
738
|
+
<span class='id identifier rubyid_style_exists'>style_exists</span> <span class='op'>=</span> <span class='kw'>false</span>
|
739
|
+
<span class='ivar'>@ass_styles</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_style'>style</span><span class='op'>|</span>
|
740
|
+
<span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_style_name'>style_name</span> <span class='op'>==</span> <span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span> <span class='kw'>then</span>
|
741
|
+
<span class='id identifier rubyid_style_exists'>style_exists</span> <span class='op'>=</span> <span class='kw'>true</span>
|
742
|
+
<span class='kw'>break</span>
|
743
|
+
<span class='kw'>end</span>
|
744
|
+
<span class='kw'>end</span>
|
745
|
+
<span class='kw'>if</span> <span class='kw'>not</span> <span class='id identifier rubyid_style_exists'>style_exists</span> <span class='kw'>then</span>
|
746
|
+
<span class='ivar'>@ass_styles</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="ASSStyle.html" title="ASSStyle (class)">ASSStyle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ASSStyle.html#initialize-instance_method" title="ASSStyle#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_style'>style</span><span class='comma'>,</span> <span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_params'>params</span><span class='comma'>,</span> <span class='id identifier rubyid_font_family'>font_family</span><span class='comma'>,</span> <span class='id identifier rubyid_font_size'>font_size</span><span class='comma'>,</span> <span class='ivar'>@width</span><span class='comma'>,</span> <span class='ivar'>@height</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
747
|
+
<span class='kw'>end</span>
|
748
|
+
<span class='kw'>end</span>
|
749
|
+
<span class='kw'>end</span></pre>
|
750
|
+
</td>
|
751
|
+
</tr>
|
752
|
+
</table>
|
753
|
+
</div>
|
754
|
+
|
755
|
+
<div class="method_details ">
|
756
|
+
<h3 class="signature " id="to_s-instance_method">
|
287
757
|
|
288
758
|
#<strong>to_s</strong> ⇒ <tt>Object</tt>
|
289
759
|
|
@@ -308,15 +778,62 @@
|
|
308
778
|
<pre class="lines">
|
309
779
|
|
310
780
|
|
311
|
-
|
312
|
-
|
313
|
-
|
781
|
+
70
|
782
|
+
71
|
783
|
+
72</pre>
|
314
784
|
</td>
|
315
785
|
<td>
|
316
|
-
<pre class="code"><span class="info file"># File 'lib/vtt2ass/ASSFile.rb', line
|
786
|
+
<pre class="code"><span class="info file"># File 'lib/vtt2ass/ASSFile.rb', line 70</span>
|
317
787
|
|
318
788
|
<span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span>
|
319
|
-
<span class='kw'>return</span> <span class='ivar'>@header</span> <span class='op'>+</span> <span class='ivar'>@ass_styles</span> <span class='op'>+</span> <span class='ivar'>@events</span> <span class='op'>+</span> <span class='ivar'>@
|
789
|
+
<span class='kw'>return</span> <span class='ivar'>@header</span> <span class='op'>+</span> <span class='ivar'>@ass_styles</span> <span class='op'>+</span> <span class='ivar'>@events</span> <span class='op'>+</span> <span class='ivar'>@ass_lines</span>
|
790
|
+
<span class='kw'>end</span></pre>
|
791
|
+
</td>
|
792
|
+
</tr>
|
793
|
+
</table>
|
794
|
+
</div>
|
795
|
+
|
796
|
+
<div class="method_details ">
|
797
|
+
<h3 class="signature " id="writeToFile-instance_method">
|
798
|
+
|
799
|
+
#<strong>writeToFile</strong>(file_path) ⇒ <tt>Object</tt>
|
800
|
+
|
801
|
+
|
802
|
+
|
803
|
+
|
804
|
+
|
805
|
+
</h3><div class="docstring">
|
806
|
+
<div class="discussion">
|
807
|
+
|
808
|
+
<p>This method writes the content of the ASSFile object into a file path that is provided.</p>
|
809
|
+
|
810
|
+
|
811
|
+
</div>
|
812
|
+
</div>
|
813
|
+
<div class="tags">
|
814
|
+
|
815
|
+
|
816
|
+
</div><table class="source_code">
|
817
|
+
<tr>
|
818
|
+
<td>
|
819
|
+
<pre class="lines">
|
820
|
+
|
821
|
+
|
822
|
+
61
|
823
|
+
62
|
824
|
+
63
|
825
|
+
64
|
826
|
+
65
|
827
|
+
66</pre>
|
828
|
+
</td>
|
829
|
+
<td>
|
830
|
+
<pre class="code"><span class="info file"># File 'lib/vtt2ass/ASSFile.rb', line 61</span>
|
831
|
+
|
832
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_writeToFile'>writeToFile</span><span class='lparen'>(</span><span class='id identifier rubyid_file_path'>file_path</span><span class='rparen'>)</span>
|
833
|
+
<span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_file_path'>file_path</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>w</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_line'>line</span><span class='op'>|</span>
|
834
|
+
<span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\ufeff</span><span class='tstring_end'>"</span></span>
|
835
|
+
<span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_puts'>puts</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
836
|
+
<span class='kw'>end</span>
|
320
837
|
<span class='kw'>end</span></pre>
|
321
838
|
</td>
|
322
839
|
</tr>
|
@@ -328,9 +845,9 @@
|
|
328
845
|
</div>
|
329
846
|
|
330
847
|
<div id="footer">
|
331
|
-
Generated on
|
848
|
+
Generated on Tue Mar 23 21:07:02 2021 by
|
332
849
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
333
|
-
0.9.26 (ruby-
|
850
|
+
0.9.26 (ruby-3.0.0).
|
334
851
|
</div>
|
335
852
|
|
336
853
|
</div>
|