Method: DataPaths::Methods#register_data_path

Defined in:
lib/data_paths/methods.rb

#register_data_path(path) ⇒ String

Registers a path as a data directory.

Examples:

register_data_dir File.join(File.dirname(__FILE__),'..','..','..','data')

Parameters:

Returns:

  • (String)

    The fully qualified form of the specified path.

Raises:

  • (RuntimeError)

    The specified path is not a directory.

Since:

  • 0.3.0



30
31
32
33
34
35
36
37
# File 'lib/data_paths/methods.rb', line 30

def register_data_path(path)
  path = File.expand_path(path)

  DataPaths.register(path)

  data_paths << path unless data_paths.include?(path)
  return path
end