Module: Flvorflv

Extended by:
Flvorflv
Included in:
Flvorflv
Defined in:
lib/flvorflv.rb

Instance Method Summary collapse

Instance Method Details

#execute_binary(args) ⇒ Object



11
12
13
# File 'lib/flvorflv.rb', line 11

def execute_binary(args)
  `flvstreamer #{args} 2>&1`
end

#run(options) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/flvorflv.rb', line 15

def run(options)
  sorted_keys = options.keys.sort {|a, b| a.to_s <=> b.to_s }

  args = sorted_keys.collect do |key|
    value = options[key]
    "--#{key} #{value}"
  end.join(" ")

  execute_binary(args)
end

#versionObject



4
5
6
7
8
9
# File 'lib/flvorflv.rb', line 4

def version
  output = execute_binary("--help")
  if output =~ /FLVStreamer v(.*)\n/
    $1
  end
end