# File lib/backup/config.rb, line 56 def hostname @hostname ||= run(utility(:hostname)) end
Tries to find and load the configuration file
# File lib/backup/config.rb, line 32 def load_config! unless File.exist?(@config_file) raise Error, "Could not find configuration file: '#{@config_file}'." end module_eval(File.read(@config_file), @config_file) end
Allows users to create preconfigured models.
# File lib/backup/config.rb, line 41 def preconfigure(name, &block) unless name.is_a?(String) && name =~ /^[A-Z]/ raise Error, "Preconfigured model names must be given as a string " + " and start with a capital letter." end if Backup.const_defined?(name) raise Error, "'#{ name }' is already in use " + "and can not be used for a preconfigured model." end Backup.const_set(name, Class.new(Model)) Backup.const_get(name).preconfigure(&block) end
Setup required paths based on the given options
# File lib/backup/config.rb, line 21 def update(options = {}) root_path = options[:root_path].to_s.strip new_root = root_path.empty? ? false : set_root_path(root_path) DEFAULTS.each do |name, ending| set_path_variable(name, options[name], ending, new_root) end end
Generated with the Darkfish Rdoc Generator 2.