lib/mini_mediainfo/media.rb in mini_mediainfo-0.0.3 vs lib/mini_mediainfo/media.rb in mini_mediainfo-0.0.5

- old
+ new

@@ -1,28 +1,15 @@ require 'open3' -require "net/http" require "uri" module MiniMediainfo # Class for parsing output from mediainfo class Media attr_reader :uri def initialize(uri, options={}) - unless File.exists?(uri) - if uri =~ URI::regexp(["ftp", "http", "https"]) - url = URI.parse(uri) - req = Net::HTTP.new(url.host, url.port) - res = req.request_head(url.path) - if res.code >= "400" - raise "Error: #{uri} is not accessible, status: #{res.code}" - end - else - raise "Error: the file '#{uri}' does not exist" - end - end @uri = uri @introspection_data = {} end def introspect()