aboutsummaryrefslogtreecommitdiffstats
path: root/config/initializers/theme_loader.rb
blob: 4ddce6910f83762f7e9d23ab616a5999003d25e5 (plain)
1
2
3
4
5
6
7
8
9
10
theme_urls = MySociety::Config.get("THEME_URLS", [])
if ENV["RAILS_ENV"] != "test" # Don't let the theme interfere with Alaveteli specs
    for url in theme_urls.reverse
        theme_name = url.sub(/.*\/(.*).git/, "\\1")
        theme_main_include = File.expand_path "../../../vendor/plugins/#{theme_name}/lib/alavetelitheme.rb", __FILE__
        if File.exists? theme_main_include
            require theme_main_include
        end
    end
end