diaspora/config/initializers/load_analyitics.rb
Jonne Haß ac147cc9f4 Refactor config/ directory
* Get rid of early pathname requirement
* Use require_relative where approciate
* Drop unused files
* Imported new application.rb, environment.rb and environments/* from fresh Rails app
* Cleaned up boot.rb
* Load config in boot.rb
* Deduplicate environments/integration*.rb
* Move username blacklist into defaults.yml
* Ruby 1.9 Hash syntax everywhere
* Reorganize lib/diaspora/markdownify to match conventions
* Get rid of full path requires where possible
* Add dummy content to production section diaspora.yml.example to prevent warning
* Drop sqlite? method
* Move postgres? method into ConfigurationMethods
* Drop token authentication from User
2013-05-19 18:54:54 +02:00

19 lines
768 B
Ruby

# Copyright (c) 2012, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
#hack to allow us to access app config, rather than putting in environments/production.rb
if Rails.env == 'production'
Diaspora::Application.configure do
if AppConfig.privacy.google_analytics_key.present?
require 'rack/google-analytics'
config.middleware.use Rack::GoogleAnalytics, tracker: AppConfig.privacy.google_analytics_key.get
end
if AppConfig.privacy.piwik.enable?
require 'rack/piwik'
config.middleware.use Rack::Piwik, piwik_url: AppConfig.privacy.piwik.host.get,
piwik_id: AppConfig.privacy.piwik.site_id.get
end
end
end