mkvmuxer 0.1 → 0.2

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
  SHA1:
3
- metadata.gz: aae6ef7d409e929b08c7fa1b83d605e6c2f364ca
4
- data.tar.gz: fbdd28c2ed4cddf139d592a5f73813ee9259de22
3
+ metadata.gz: 261b833f4dce0ab2853a94aa5c3cb4c0e03684c8
4
+ data.tar.gz: c0d787a229d20a1b4b814393a68727fff0c7a95c
5
5
  SHA512:
6
- metadata.gz: a08ceb977f2aff81ff05c00b222b3a0f2fdc3ec04917ff33a687e48791ef6b6007e2c11b59466b85723f4d1ea7c8278d6567790249b76a3b693d8f9137742035
7
- data.tar.gz: 7ac00c8797a4a12bb7623f4d402710b8017fa19f843969d7a0381c20418d740e99b63e84d8b218ca26cfe8c8057bf03d34dd6808bf062f7f9fd07334986c9a10
6
+ metadata.gz: 08381b81ff9a623b9e9a0f03a4a0edc8105445b528e0a7162ac464d8798f2de00daa3a739a9ede5e11aacb7d426a50e83b6c8133720ec427920d224f9eac558a
7
+ data.tar.gz: dda01f5e260d9de22817e5c279ec95fb8ea33897fc7f956ed1f25a1ddb17f6ba3e401f8e34f6f314ed3c5cc48e8db705c26e2b01237240d42b92ee62ec230eb3
@@ -1,10 +1,16 @@
1
1
  #! /usr/bin/env ruby
2
2
  require 'mkvmuxer'
3
3
 
4
- abort "Usage: #{$0} <path>" if ARGV.empty?
5
- abort 'Folder not found.' unless File.directory? ARGV.first
4
+ abort "Usage: #{$0} <path> [language]" if ARGV.empty?
5
+ abort 'Folder not found.' unless File.directory? ARGV.first
6
+
7
+ mkvmuxer = MkvMuxer.new ARGV.shift
8
+
9
+ if ARGV.any?
10
+ mkvmuxer.prepare ARGV.shift
11
+ else
12
+ mkvmuxer.prepare
13
+ end
6
14
 
7
- mkvmuxer = MkvMuxer.new ARGV.first
8
- mkvmuxer.prepare
9
15
  mkvmuxer.merge!
10
16
  mkvmuxer.apply_crc32!
@@ -1,4 +1,4 @@
1
- #
1
+ #--
2
2
  # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
3
3
  # Version 2, December 2004
4
4
  #
@@ -6,7 +6,7 @@
6
6
  # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
7
7
  #
8
8
  # 0. You just DO WHAT THE FUCK YOU WANT TO.
9
- #
9
+ #++
10
10
 
11
11
  class MkvMuxer
12
12
  attr_reader :command
@@ -28,18 +28,22 @@ class MkvMuxer
28
28
  raise Exception, 'Target mkv already exists' if !force && File.exists?(@output)
29
29
  end
30
30
 
31
- def prepare(fonts = true, chapters = true)
31
+ def prepare(language = 'Italian', fonts = true, chapters = true)
32
32
  options = []
33
- options << { opt: '-o', val: @output }
34
- options << { val: @mkv }
35
- options << { val: @ass }
36
- options << { opt: '--no-chapters --chapters', val: chapters } if @chapters
33
+ options << { opt: '-o', val: @output }
34
+ options << { opt: '--default-track', val: '0' }
35
+ options << { opt: '--track-name', val: "0:#{language}" }
36
+ options << { opt: '--language', val: "0:#{language[0..2].downcase}" }
37
+ options << { opt: '--no-chapters --chapters', val: chapters } if @chapters
37
38
 
38
39
  @fonts.each { |font|
39
40
  options << { opt: '--attachment-mime-type', val: 'application/x-truetype-font' }
40
- options << { opt: '--attach-file', val: font }
41
+ options << { opt: '--attach-file', val: font }
41
42
  } if fonts
42
43
 
44
+ options << { val: @ass }
45
+ options << { val: @mkv }
46
+
43
47
  @command = [].tap { |cmd|
44
48
  options.each { |option|
45
49
  cmd << option[:opt] if option[:opt]
@@ -1,4 +1,4 @@
1
- #
1
+ #--
2
2
  # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
3
3
  # Version 2, December 2004
4
4
  #
@@ -6,8 +6,8 @@
6
6
  # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
7
7
  #
8
8
  # 0. You just DO WHAT THE FUCK YOU WANT TO.
9
- #
9
+ #++
10
10
 
11
11
  class MkvMuxer
12
- VERSION = '0.1'
12
+ VERSION = '0.2'
13
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mkvmuxer
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giovanni Capuano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-28 00:00:00.000000000 Z
11
+ date: 2014-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake