vtt2ass 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/lib/vtt2ass/ASSLine.rb +4 -1
- data/lib/vtt2ass/Application.rb +1 -1
- data/lib/vtt2ass/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fe71574454d7bf315cb1de1c25ceb478e98fa0676f30e55a4e97b9522edfca9
|
4
|
+
data.tar.gz: d6380d5ee7e0f9e3341636cc266c43daea659724de180ee854811d243efd6348
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4a0ce576c898b8a69467dbfc92481017ebb1d467377c7772ca52b05d72aebe14cd1ea2ac84ef3ad2898cb00defd4bde7104372de7e49a1aece6ab5072d1f7ec
|
7
|
+
data.tar.gz: 72c4f381475ad497ee697bbedc5d8c54864c4192a780ea7da32a9ebe5752a0b3c4b3f5463aa6486682e7baaa65dafed9ae7fe9439e8b45506e40407a4d60cd88
|
data/Gemfile
CHANGED
data/lib/vtt2ass/ASSLine.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'htmlentities'
|
2
|
+
|
1
3
|
##
|
2
4
|
# This class defines an ASS subtile line.
|
3
5
|
class ASSLine
|
@@ -28,6 +30,7 @@ class ASSLine
|
|
28
30
|
#
|
29
31
|
# * Requires +text+, a string of VTT formated text as input.
|
30
32
|
def convertToAssText(text)
|
33
|
+
decoder = HTMLEntities.new()
|
31
34
|
text = text
|
32
35
|
.gsub(/\r/, '')
|
33
36
|
.gsub(/\n/, '\\N')
|
@@ -42,7 +45,7 @@ class ASSLine
|
|
42
45
|
.gsub(/<[^>]>/, '')
|
43
46
|
.gsub(/\\N$/, '')
|
44
47
|
.gsub(/ +$/, '')
|
45
|
-
return text
|
48
|
+
return decoder.decode(text)
|
46
49
|
end
|
47
50
|
|
48
51
|
##
|
data/lib/vtt2ass/Application.rb
CHANGED
@@ -31,7 +31,7 @@ class Application
|
|
31
31
|
vtt_to_ass(file_path).writeToFile(File.basename(file_path).gsub('.vtt', '.ass'))
|
32
32
|
end
|
33
33
|
elsif File.file?(@input) then
|
34
|
-
vtt_to_ass(@input).writeToFile(File.basename(@input).gsub('.vtt', '.ass'))
|
34
|
+
vtt_to_ass(@input).writeToFile(@output + File.basename(@input).gsub('.vtt', '.ass'))
|
35
35
|
else
|
36
36
|
puts 'Error: input file or directory does not exist.'
|
37
37
|
end
|
data/lib/vtt2ass/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vtt2ass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Louis-Philippe Fortin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|