vtt2ass 0.2.8 → 0.2.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bfa2fd9e7218f6e026e83008db176c51cb6a52a0190de4c20725ea6b11bd32bd
4
- data.tar.gz: 9a01ccb50e6ff3d58308440656f23e4c0f418568210cd82d9c82261bef96a87a
3
+ metadata.gz: 0b91fbc9f2fc64b1fb2fe4e981c02a9f1c30916b53e3447ceb271d8f04962178
4
+ data.tar.gz: 12c4c09991e48d86904b40566c9e11059427822eb152cd1f41a095187edcad9b
5
5
  SHA512:
6
- metadata.gz: e2f7236e87470913fe72dd68a7b0b56779f49a23bc1c004545cfbbd441dd302a7f33974c5955c772e81606456c81a914d780acb492e7304e9032baa2496b692e
7
- data.tar.gz: ad34647bf2fae860cc422c1d0fd603abeeb035c3c8efd4eca8d68a8936619ceba20632ec14c976522a1be35b549b6fdcb3cea23aeef60294e7bc754ac460af57
6
+ metadata.gz: 7f7e485f5302ad380cbd9514ebfd661dcec6a5f4c73dcee87266d1c06219f277c670552f58bd15f0884e631b7e37328c710b1b5ae0f3505bf431db609c9ce6ab
7
+ data.tar.gz: 1cbd943d67c01bac59987028ceb25127f6f6d5888ad0c96148c48698ec411d27006683b257daae76c43eb24dbec3fdc9464e14633e288f687872f2fde3672f5f
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/lib/vtt2ass.rb CHANGED
@@ -29,6 +29,9 @@ module Vtt2ass
29
29
  opts.on("-s", "--font-size SIZE", Integer, "Specify a font size for the subtitles (default: 52)") do |font_size|
30
30
  options[:font_size] = font_size
31
31
  end
32
+ opts.on("-t", "--title TITLE", String, "Specify a title for you file. If the input is a directory, all files will share the same title.") do |title|
33
+ options[:title] = title
34
+ end
32
35
  opts.on("-v", "--version", "Show version") do
33
36
  puts Vtt2ass::VERSION
34
37
  exit
@@ -19,6 +19,9 @@ class Application
19
19
  @height = 1080
20
20
  @font_family = options[:font_family] ? options[:font_family] : 'Open Sans Semibold'
21
21
  @font_size = options[:font_size] ? options[:font_size] : 52
22
+ if options[:title] then
23
+ @title = options[:title]
24
+ end
22
25
  end
23
26
 
24
27
  ##
@@ -28,7 +31,7 @@ class Application
28
31
  def start
29
32
  if File.directory?(@input) then
30
33
  Dir["#{@input}/*.vtt"].each do |file_path|
31
- vtt_to_ass(file_path).writeToFile(File.basename(file_path).gsub('.vtt', '.ass'))
34
+ vtt_to_ass(file_path).writeToFile(@output + File.basename(file_path).gsub('.vtt', '.ass'))
32
35
  end
33
36
  elsif File.file?(@input) then
34
37
  vtt_to_ass(@input).writeToFile(@output + File.basename(@input).gsub('.vtt', '.ass'))
@@ -39,7 +42,11 @@ class Application
39
42
 
40
43
  def vtt_to_ass(file_path)
41
44
  vtt_file = VTTFile.new(file_path)
42
- ass_file = ASSFile.new(File.basename(file_path).gsub('.vtt', ''), @width, @height)
45
+ ass_file = ASSFile.new(
46
+ (defined?(@title) ? @title : File.basename(file_path).gsub('.vtt', '')),
47
+ @width,
48
+ @height
49
+ )
43
50
  ass_file.convertVTTtoASS(vtt_file, @font_family, @font_size)
44
51
  return ass_file
45
52
  end
@@ -1,3 +1,3 @@
1
1
  module Vtt2ass
2
- VERSION = "0.2.8"
2
+ VERSION = "0.2.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vtt2ass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Louis-Philippe Fortin