Module: CFBundle::StorageDetection

Defined in:
lib/cfbundle/storage_detection.rb

Overview

Utility methods required to detect and instantiate a bundle’s storage.

Class Method Summary collapse

Class Method Details

.open(file) ⇒ Storage

Opens a file and returns a bundle storage.

Parameters:

  • file

    The file to open.

Returns:



14
15
16
17
18
19
20
# File 'lib/cfbundle/storage_detection.rb', line 14

def open(file)
  storage = open_as_storage(file) ||
            open_as_io(file) ||
            open_as_path(file)
  raise "#{file.inspect} is not a bundle" unless storage
  storage
end