class ActiveFedora::FileConfigurator
def load_solr_config
def load_solr_config return @solr_config unless @solr_config.empty? @solr_config_path = get_config_path(:solr) ActiveFedora::Base.logger.info "ActiveFedora: loading solr config from #{::File.expand_path(@solr_config_path)}" if ActiveFedora::Base.logger begin config_erb = ERB.new(IO.read(@solr_config_path)).result(binding) rescue Exception => e raise("solr.yml was found, but could not be parsed with ERB. \n#{$!.inspect}") end begin solr_yml = YAML.load(config_erb) rescue StandardError => e raise("solr.yml was found, but could not be parsed.\n") end config = solr_yml.symbolize_keys raise "The #{ActiveFedora.environment.to_sym} environment settings were not found in the solr.yml config. If you already have a solr.yml file defined, make sure it defines settings for the #{ActiveFedora.environment.to_sym} environment" unless config[ActiveFedora.environment.to_sym] @solr_config = {:url=> get_solr_url(config[ActiveFedora.environment.to_sym].symbolize_keys)} end