Module: AuDefaults

Defined in:
lib/admin-utils/au_defaults.rb

Constant Summary collapse

LOGGER_BASE =
'/var/log'
DEFAULT_INIT_SCRIPT_PATH =
'/etc/init.d'
CONFIG_PATH =
[ ENV['HOME'] + '/.config', '/etc', '/usr/local/etc', '../config' ]

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.config_path(path = nil) ⇒ Object



21
22
23
# File 'lib/admin-utils/au_defaults.rb', line 21

def config_path(path = nil)
  @path_for_the_config = path || (@path_for_the_config || CONFIG_PATH)
end

.reset_config_pathObject

Call this to reset the config path to the default values of the CONFIG_PATH array



26
27
28
# File 'lib/admin-utils/au_defaults.rb', line 26

def reset_config_path
  @path_for_the_config = nil
end

Instance Method Details

#config_path(path = nil) ⇒ Object

Retrieves the default config path that holds the yml files for the current application. The path variable can be used to override the default config path. The method can then be called without argument to retrieve the currently set config path.

NOTE: As a default this method returns an array.



13
14
15
# File 'lib/admin-utils/au_defaults.rb', line 13

def config_path(path = nil)
  AuDefaults.config_path(path)
end