Skip to content
Snippets Groups Projects
Commit a51de416 authored by Bruno Nocera Zanette's avatar Bruno Nocera Zanette
Browse files

Refactor code: Use correct code pattern

parent c3c33bae
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,14 @@ require 'yaml' ...@@ -3,7 +3,14 @@ require 'yaml'
dspace_configs = YAML.load_file(Rails.root.join('config').to_s.concat('/dspace.yml')) dspace_configs = YAML.load_file(Rails.root.join('config').to_s.concat('/dspace.yml'))
env_config = dspace_configs.fetch(Rails.env) env_config = dspace_configs.fetch(Rails.env)
Dspace::Config.host = env_config['host'] if Rails.env.production?
Dspace::Config.port = env_config['port'] Dspace::Config.host = ENV['PORTALMEC_DSPACE_HOST']
Dspace::Config.rest_webapp_name = env_config['rest_webapp_name'] Dspace::Config.port = ENV['PORTALMEC_DSPACE_PORT']
Dspace::Config.solr_webapp_name = env_config['solr_webapp_name'] Dspace::Config.rest_webapp_name = ENV['PORTALMEC_DSPACE_REST_NAME']
Dspace::Config.solr_webapp_name = ENV['PORTALMEC_DSPACE_SOLR_NAME']
else
Dspace::Config.host = env_config['host']
Dspace::Config.port = env_config['port']
Dspace::Config.rest_webapp_name = env_config['rest_webapp_name']
Dspace::Config.solr_webapp_name = env_config['solr_webapp_name']
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment