Method: CloudTempfile::Storage#local_file

Defined in:
lib/cloud_tempfile/storage.rb

#local_file(f, body, options = {}) ⇒ Fog::Storage::Local::File

Used with the “Local” provider which will utilize the local file system with Fog. This is handy for development and test environments.

Returns:

  • (Fog::Storage::Local::File)


43
44
45
46
47
48
49
# File 'lib/cloud_tempfile/storage.rb', line 43

def local_file(f, body, options={})
  #return !self.config.public?
  file = init_fog_file(f, body, options)
  # If the "file" is empty then return nil
  return nil if file.nil? || file.blank? || local_root.nil?
  file = local_root(options).files.create( file )
end