Feature #430
YAML-based config files for Fedora Repository and SolrService
| Status: | Closed | Start: | 08/04/2009 | |
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | - | Spent time: | 3.00 hours | |
| Target version: | 1.0.9 | |||
| Sponsor: |
Description
Instead of using an initializer to set FEDORA_URL, etc, use .yml files
Features¶
- support using RAILS_ENV (test, development, production)
Reference¶
See these files in Reindeer code base:- config/fedora.yml
- config/solr.yml
- lib/reindeer.rb
def initialize(fedora_home=nil, fedora_url=nil, solr_url=nil, solr_home=nil)
solr_config = YAML::load(File.open("#{RAILS_ROOT}/config/solr.yml"))
fedora_config = YAML::load(File.open("#{RAILS_ROOT}/config/fedora.yml"))
@fedora_home = fedora_home.nil? ? ENV['FEDORA_HOME'] : fedora_home
@solr_home = File.join(@fedora_home, 'solr') unless !solr_home.nil?
@fedora_url = fedora_config[RAILS_ENV]["url"] unless !fedora_url.nil?
@solr_url = solr_config[RAILS_ENV]["url"] unless !solr_url.nil?
end
Related issues
| related to Feature #580 | YAML includes settings for SOLR_DOCUMENT_ID and ENABLE_SOLR_UPDATES | New | 11/02/2009 |
History
Updated by Matt Zumwalt 269 days ago
- Status changed from New to Closed
Now uses RAILS_ROOT/lib/fedora.yml. If RAILS_ROOT is not set and no path has been passed in as an argument, uses /config/fedora.yml within the activefedora gem.