module RDF::Util::File
Public Class Methods
open_file(filename_or_url, options = {}, &block)
click to toggle source
# File lib/turtle_reader/rdf/compression.rb 76 def open_file(filename_or_url, options = {}, &block) 77 klass = begin 78 case filename_or_url 79 when /\.bz(?:ip)?2?\z/i then RBzip2::Decompressor 80 when /\.gz(?:ip)?\z/i then Zlib::GzipReader 81 end 82 rescue NameError => err 83 err.message.sub!('Module::', '') 84 raise 85 end 86 87 if klass 88 original_block, block = block, lambda { |file| 89 original_block[file.is_a?(IO) ? klass.new(file) : file] 90 } 91 end 92 93 _turtle_reader_original_open_file(filename_or_url, options, &block) 94 end
Also aliased as: _turtle_reader_original_open_file