aboutsummaryrefslogtreecommitdiffstats
path: root/config/initializers/theme_loader.rb
diff options
context:
space:
mode:
Diffstat (limited to 'config/initializers/theme_loader.rb')
-rw-r--r--config/initializers/theme_loader.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/config/initializers/theme_loader.rb b/config/initializers/theme_loader.rb
index 1ad2d01f1..9c79e513c 100644
--- a/config/initializers/theme_loader.rb
+++ b/config/initializers/theme_loader.rb
@@ -3,7 +3,9 @@
$alaveteli_route_extensions = []
def require_theme(theme_name)
- theme_main_include = File.expand_path "../../../vendor/plugins/#{theme_name}/lib/alavetelitheme.rb", __FILE__
+ theme_lib = Rails.root.join 'lib', 'themes', theme_name, 'lib'
+ $LOAD_PATH.unshift theme_lib.to_s
+ theme_main_include = Rails.root.join theme_lib, "alavetelitheme.rb"
if File.exists? theme_main_include
require theme_main_include
end
@@ -18,7 +20,6 @@ if Rails.env == "test"
end
else
for url in AlaveteliConfiguration::theme_urls.reverse
- theme_name = url.sub(/.*\/(.*).git/, "\\1")
- require_theme(theme_name)
+ require_theme theme_url_to_theme_name(url)
end
end