Sha256: e3a664c291dc838d792f97baab0976fceb6385975972f482f8e4a385b6f02d36

Contents?: true

Size: 443 Bytes

Versions: 2

Compression:

Stored size: 443 Bytes

Contents

module Flvorflv
  extend self

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

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

  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
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
technicalpickles-flvorflv-0.1.0 lib/flvorflv.rb
flvorflv-0.1.0 lib/flvorflv.rb