Class: Nova::Remote::Fake::FileSystem

Inherits:
Object
  • Object
show all
Defined in:
lib/nova/remote/fake/file_system.rb

Overview

Handles filesystem stuff, like downloading files and decompressing ifles.

Instance Method Summary collapse

Instance Method Details

#decompress_file(file, to) ⇒ void

This method is abstract.
Note:

Does nothing.

This method returns an undefined value.

Decompress the given file, to the given directory.

Parameters:

  • file (String)

    the file to decompress.

  • to (String)

    the directory to decompress to.



47
48
# File 'lib/nova/remote/fake/file_system.rb', line 47

def decompress_file(file, to)
end

#file_exists?(file) ⇒ Boolean

This method is abstract.
Note:

Does nothing.

Checks to see if the file exists on the file system.

Parameters:

  • file (String)

    the file to check.

Returns:

  • (Boolean)


36
37
38
# File 'lib/nova/remote/fake/file_system.rb', line 36

def file_exists?(file)
  false
end

#grab_file(file, options = {}) ⇒ Boolean

This method is abstract.
Note:

Does nothing.

Grabs the file from file and puts it somewhere else. If it’s a local file (checked by #file_exists?), it just copies it. If it’s not, it opens a connection to the server to try to download the file.

Parameters:

  • file (String)

    the file to download. Can be a path name or URI.

  • options (Hash{Symbol => Object}) (defaults to: {})

    the options for grabbing the files.

Options Hash (options):

  • :to (String)

    the file to save to. If this doesn’t exist, it’s guessed from the file name.

  • :decompress (Boolean, String)

    the file after saving it. If it’s a string, the decompressed file is extracted there. Otherwise, it’s guessed from the filename.

Returns:

  • (Boolean)


26
27
28
# File 'lib/nova/remote/fake/file_system.rb', line 26

def grab_file(file, options = {})
  false
end