- file_name = File.join(Rails.root, "config", "legales", country_code.to_s + ".yml")
- file_name = File.join(Rails.root, "config", "legales", DEFAULT_LEGALE + ".yml") unless File.exist? file_name
- YAML.load_file(file_name)
+ file_name = Rails.root.join("config", "legales", "#{country_code}.yml")
+ file_name = Rails.root.join("config", "legales", "#{Settings.default_legale}.yml") unless File.exist? file_name
+ YAML.load_file(file_name).transform_values!(&:html_safe)
+ end
+
+ # Return the HTTP client to use
+ def self.http_client
+ @http_client ||= Faraday.new(:request => { :timeout => 15 },
+ :headers => { :user_agent => Settings.server_url })
+ end
+
+ # Return the MaxMindDB database handle
+ def self.maxmind_database
+ @maxmind_database ||= MaxMindDB.new(Settings.maxmind_database) if Settings.key?(:maxmind_database)