vtt2ass 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vtt2ass/{Application.rb → application.rb} +14 -5
- data/lib/vtt2ass/{ASSFile.rb → ass_file.rb} +4 -4
- data/lib/vtt2ass/{ASSLine.rb → ass_line.rb} +0 -0
- data/lib/vtt2ass/{ASSStyle.rb → ass_style.rb} +2 -2
- data/lib/vtt2ass/{ASSStyleParams.rb → ass_style_params.rb} +0 -0
- data/lib/vtt2ass/{CSSFile.rb → css_file.rb} +1 -1
- data/lib/vtt2ass/{CSSRule.rb → css_rule.rb} +0 -0
- data/lib/vtt2ass/{Validator.rb → validator.rb} +0 -0
- data/lib/vtt2ass/version.rb +1 -1
- data/lib/vtt2ass/{VTTFile.rb → vtt_file.rb} +1 -1
- data/lib/vtt2ass/{VTTLine.rb → vtt_line.rb} +0 -0
- data/lib/vtt2ass.rb +1 -1
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3959903aff7b00e3544a9656edf9a17f9508445db041d28518549926cca7a09
|
4
|
+
data.tar.gz: 51359298d3ff0ed985ce10f48b18c5f2b84eec19b267e0781cd2b6ef12320e22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae929a40df7f483e8bd76cc43920177d299756cfe9774fc850f0e7a66b877d74c40314d2d8647cabf6ba5b2c7e0743533ce9236873d28c86203a76c74c9628d8
|
7
|
+
data.tar.gz: 1a280a2a76c87e2678c6275b65c1226779799e61abd8b2909816897e5e44b18a649d0c0f364ae97249044593656120e823edf80f06836703963840321449d088
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Relative imports
|
2
|
-
require_relative '
|
3
|
-
require_relative '
|
2
|
+
require_relative 'vtt_file'
|
3
|
+
require_relative 'ass_file'
|
4
4
|
|
5
5
|
##
|
6
6
|
# Main application class that manages all the operations.
|
@@ -21,7 +21,7 @@ class Application
|
|
21
21
|
end
|
22
22
|
@quiet = options[:quiet]
|
23
23
|
if options[:css] then
|
24
|
-
@css = options[:css].gsub('\\', '/')
|
24
|
+
@css = options[:css].gsub('\\', '/').delete_suffix('/')
|
25
25
|
end
|
26
26
|
@line_offset = options[:line_offset]
|
27
27
|
end
|
@@ -54,12 +54,21 @@ class Application
|
|
54
54
|
# This method creates a new VTTFile object from the file path provided and convert its content
|
55
55
|
# inside a new ASSFile object.
|
56
56
|
def vtt_to_ass(file_path)
|
57
|
+
base_file_name = File.basename(file_path).gsub('.vtt', '')
|
58
|
+
css_file = nil
|
59
|
+
if defined?(@css) and File.directory?(@css) then
|
60
|
+
css_file = "#{@css}/#{base_file_name}.css"
|
61
|
+
elsif File.file?("#{file_path.gsub('.vtt', '')}.css") then
|
62
|
+
css_file = "#{file_path.gsub('.vtt', '')}.css"
|
63
|
+
else
|
64
|
+
css_file = @css
|
65
|
+
end
|
57
66
|
vtt_file = VTTFile.new(file_path, @width, @height)
|
58
67
|
ass_file = ASSFile.new(
|
59
|
-
(defined?(@title) ? @title :
|
68
|
+
(defined?(@title) ? @title : base_file_name),
|
60
69
|
@width,
|
61
70
|
@height,
|
62
|
-
|
71
|
+
css_file
|
63
72
|
)
|
64
73
|
ass_file.convertVTTtoASS(vtt_file, @font_family, @font_size, @line_offset)
|
65
74
|
return ass_file
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# Relative imports
|
2
|
-
require_relative '
|
3
|
-
require_relative '
|
4
|
-
require_relative '
|
5
|
-
require_relative '
|
2
|
+
require_relative 'ass_line'
|
3
|
+
require_relative 'ass_style'
|
4
|
+
require_relative 'css_file'
|
5
|
+
require_relative 'css_rule'
|
6
6
|
|
7
7
|
##
|
8
8
|
# This class defines an ASS subtitle file.
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/vtt2ass/version.rb
CHANGED
File without changes
|
data/lib/vtt2ass.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.3.
|
4
|
+
version: 0.3.3
|
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: 2022-
|
11
|
+
date: 2022-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|
@@ -153,17 +153,17 @@ files:
|
|
153
153
|
- doc/top-level-namespace.html
|
154
154
|
- exe/vtt2ass
|
155
155
|
- lib/vtt2ass.rb
|
156
|
-
- lib/vtt2ass/
|
157
|
-
- lib/vtt2ass/
|
158
|
-
- lib/vtt2ass/
|
159
|
-
- lib/vtt2ass/
|
160
|
-
- lib/vtt2ass/
|
161
|
-
- lib/vtt2ass/
|
162
|
-
- lib/vtt2ass/
|
163
|
-
- lib/vtt2ass/
|
164
|
-
- lib/vtt2ass/VTTLine.rb
|
165
|
-
- lib/vtt2ass/Validator.rb
|
156
|
+
- lib/vtt2ass/application.rb
|
157
|
+
- lib/vtt2ass/ass_file.rb
|
158
|
+
- lib/vtt2ass/ass_line.rb
|
159
|
+
- lib/vtt2ass/ass_style.rb
|
160
|
+
- lib/vtt2ass/ass_style_params.rb
|
161
|
+
- lib/vtt2ass/css_file.rb
|
162
|
+
- lib/vtt2ass/css_rule.rb
|
163
|
+
- lib/vtt2ass/validator.rb
|
166
164
|
- lib/vtt2ass/version.rb
|
165
|
+
- lib/vtt2ass/vtt_file.rb
|
166
|
+
- lib/vtt2ass/vtt_line.rb
|
167
167
|
- vtt2ass.gemspec
|
168
168
|
homepage: https://gitlab.com/dkb-weeblets/vtt2ass
|
169
169
|
licenses:
|