Module: RDF::Util::File
- Defined in:
- lib/rdf/util/file.rb
Overview
Wrapper for Kernel.open. Allows implementations to override to get more suffisticated behavior for HTTP resources (e.g., Accept header).
Also supports the file: scheme for access to local files.
Classes include this module when they represent some form of a file as a base resource, for instance an HTTP resource representing the serialization of a Graph.
This module may be monkey-patched to allow for more options and interfaces.
Class Method Summary collapse
-
.open_gzipfile(filename_or_url, options = {}) {|IO| ... } ⇒ IO
Open the file, returning or yielding an IO stream and mime_type.
Class Method Details
.open_gzipfile(filename_or_url, options = {}) {|IO| ... } ⇒ IO
Open the file, returning or yielding an IO stream and mime_type.
any options to pass through to the underlying UUID library
25 26 27 28 |
# File 'lib/rdf/util/file.rb', line 25 def self.open_gzipfile(filename_or_url, = {}, &block) filename_or_url = $1 if filename_or_url.to_s.match(/^file:(.*)$/) f = Zlib::GzipReader.open(filename_or_url.to_s, &block) end |