Module: MKV

Defined in:
lib/mkv.rb,
lib/mkv/error.rb,
lib/mkv/movie.rb,
lib/mkv/track.rb,
lib/mkv/version.rb

Defined Under Namespace

Classes: Error, Movie, Track

Constant Summary collapse

VERSION =
"0.0.4"
Timer =
Timeout

Class Method Summary collapse

Class Method Details

.loggerLogger

Get MKV logger.

Returns:

  • (Logger)


28
29
30
31
32
33
# File 'lib/mkv.rb', line 28

def self.logger
  return @logger if @logger
  log = Logger.new(STDOUT)
  log.level = Logger::INFO
  @logger = log
end

.logger=(log) ⇒ Logger

MKV logs information about its progress when it’s transcoding. Jack in your own logger through this method if you wish to.

Parameters:

  • log (Logger)

    your own logger

Returns:

  • (Logger)

    the logger you set



21
22
23
# File 'lib/mkv.rb', line 21

def self.logger=(log)
  @logger = log
end

.mkvextract_binaryString

Get the path to the mkvextract binary, defaulting to an OS-dependent path

Returns:

  • (String)

    the path to the mkvextract binary



63
64
65
# File 'lib/mkv.rb', line 63

def self.mkvextract_binary
  @mkvextract_binary.nil? ? default_mkvextract_binary : @mkvextract_binary
end

.mkvextract_binary=(bin) ⇒ String

Set the path of the mkvextract binary. Can be useful if you need to specify a path such as /usr/local/bin/MKV

Parameters:

  • path (String)

    to the mkvextract binary

Returns:

  • (String)

    the path you set



56
57
58
# File 'lib/mkv.rb', line 56

def self.mkvextract_binary=(bin)
  @mkvextract_binary = bin
end

.mkvinfo_binaryString

Get the path to the mkvinfo binary, defaulting to an OS-dependent path

Returns:

  • (String)

    the path to the MKV binary



47
48
49
# File 'lib/mkv.rb', line 47

def self.mkvinfo_binary
  @mkvinfo_binary.nil? ? default_mkvinfo_binary : @mkvinfo_binary
end

.mkvinfo_binary=(bin) ⇒ String

Set the path of the mkvinfo binary. Can be useful if you need to specify a path such as /usr/local/bin/MKV

Parameters:

  • path (String)

    to the mkvinfo binary

Returns:

  • (String)

    the path you set



40
41
42
# File 'lib/mkv.rb', line 40

def self.mkvinfo_binary=(bin)
  @mkvinfo_binary = bin
end