class CFBundle::Storage::Base

The {Storage::Base} class defines the methods required to access a bundle's underlying storage.

Most of the time, you don't need to concern youself with storages as {CFBundle::Bundle.open} and {CFBundle::Bundle#initialize} automatically detect and instantiate the appropriate storage.

Public Instance Methods

close() click to toggle source

Invoked when the storage is no longer needed.

The default implementation does nothing. @return [void]

# File lib/cfbundle/storage/base.rb, line 66
def close; end
directory?(path) click to toggle source

Returns whether a given directory exists within the storage.

@param path [String] The path of a directory, relative to the storage.

# File lib/cfbundle/storage/base.rb, line 32
def directory?(path)
  # :nocov:
  false
  # :nocov:
end
exist?(path) click to toggle source

Returns whether a given path exists within the storage.

@param path [String] The path of a file or directory, relative to the

storage.
# File lib/cfbundle/storage/base.rb, line 14
def exist?(path)
  # :nocov:
  false
  # :nocov:
end
file?(path) click to toggle source

Returns whether a given file exists within the storage.

@param path [String] The path of a file, relative to the storage.

# File lib/cfbundle/storage/base.rb, line 23
def file?(path)
  # :nocov:
  false
  # :nocov:
end
foreach(path) click to toggle source

Returns an enumerator that enumerates the files contained in a directory.

@param path [String] The path to the directory to enumerate. @return [Enumerator]

# File lib/cfbundle/storage/base.rb, line 56
def foreach(path)
  # :nocov:
  raise(Errno::ENOENT, path)
  # :nocov:
end
open(path, &block) click to toggle source

Opens a file for reading in the storage.

@param path [String] The path of the file to open. @yieldparam file [IO] The opened file. It is automatically closed when

the block terminates.

@return [Object] The return value of the block when a block if given. @return [IO] The opened file when no block is given.

# File lib/cfbundle/storage/base.rb, line 45
def open(path, &block)
  # :nocov:
  raise(Errno::ENOENT, path)
  # :nocov:
end