# File lib/rudy/config.rb, line 71
 71:     def look_and_load(adhoc_path=nil)
 72:       cwd = Dir.pwd
 73:       cwd_path = File.join(cwd, '.rudy', 'config')
 74:       
 75:       # Attempt to load the core configuration file first.
 76:       # The "core" config file can have any or all configuration
 77:       # but it should generally only contain the access identifiers
 78:       # and defaults. That's why we only load one of them. 
 79:       core_config_paths = [cwd_path, Rudy::CONFIG_FILE]
 80:       core_config_paths.each do |path|
 81:         next unless path && File.exists?(path)
 82:         @paths << path
 83:         break
 84:       end
 85:       
 86:       if adhoc_path.nil?
 87:         # self.keys returns the current config types (machines, routines, etc...)
 88:         typelist = self.keys.collect { |g| "#{g}.rb" }.join(',')
 89:       
 90:         # Rudy then looks for the rest of the config in these locations
 91:         @paths += Dir.glob(File.join(Rudy.sysinfo.home, '.rudy', '*.rb')) || []
 92:         @paths += Dir.glob(File.join(cwd, 'Rudyfile')) || []
 93:         @paths += Dir.glob(File.join(cwd, 'config', 'rudy', '*.rb')) || []
 94:         @paths += Dir.glob(File.join(cwd, '.rudy', '*.rb')) || []
 95:         @paths += Dir.glob(File.join(cwd, "{#{typelist}}")) || []
 96:         @paths += Dir.glob(File.join('/etc', 'rudy', '*.rb')) || []
 97:         @paths &&= @paths.uniq
 98:       else
 99:         @paths += [adhoc_path].flatten
100:       end
101:       
102:       refresh
103:     end