Skip to content

Commit

Permalink
Complain when you can't load the .so in a ruby way
Browse files Browse the repository at this point in the history
  • Loading branch information
hackerdude committed Oct 29, 2012
1 parent d8ed90e commit 1f00b67
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/mediainfo-ruby.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
# Load the C++ library.
require 'ffi'

class MediaInfo

extend FFI::Library

functions = [

]

$:.unshift "#{File.dirname(__FILE__)}/../ext/mediainfo_ruby/"

puts "Loading mediainfo"
require "mediainfo_ruby"



module MediaInfoRubyisms_Streams
ThingsWithMultipleStreams = [:video, :audio]

Expand Down Expand Up @@ -86,6 +98,9 @@ def option_definitions

def parameters_csv
params_csv = self.option("Info_Parameters_CSV", "")
if params_csv.include?("nable to load lib")
raise LoadError.new(params_csv)
end
if RUBY_PLATFORM =~ /darwin/
params_csv = params_csv.gsub("\r", "\n")
end
Expand Down Expand Up @@ -134,3 +149,4 @@ class MediaInfoLib::MediaInfo
include(MediaInfoRubyisms_Streams)
end

end

0 comments on commit 1f00b67

Please sign in to comment.