summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2012-08-08 13:35:45 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2012-08-08 13:35:45 +0100
commit51f0b47ff60e7e33aa44ec3e950e4ffa8bf4e4fa (patch)
tree74805e55298768d77acfd093eb7d7f33145ae784
parentaafa49a381e3600ef28927a28bfb27a84eb3004b (diff)
parentd25d3d59f8dd91b0e1353dbbb0bf04caa9717fe6 (diff)
downloadrabbitmq-server-51f0b47ff60e7e33aa44ec3e950e4ffa8bf4e4fa.tar.gz
merge heads
-rw-r--r--src/rabbit_plugins.erl18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/rabbit_plugins.erl b/src/rabbit_plugins.erl
index 4b70a2a5..0320c69f 100644
--- a/src/rabbit_plugins.erl
+++ b/src/rabbit_plugins.erl
@@ -51,8 +51,8 @@ setup() ->
{ok, ExpandDir} = application:get_env(rabbit, plugins_expand_dir),
{ok, EnabledFile} = application:get_env(rabbit, enabled_plugins_file),
prepare_plugins(EnabledFile, PluginDir, ExpandDir),
- [prepare_dir_plugin(PluginName) ||
- PluginName <- filelib:wildcard("*/ebin/*.app", ExpandDir)].
+ [prepare_dir_plugin(PluginAppDescPath) ||
+ PluginAppDescPath <- filelib:wildcard(ExpandDir ++ "/*/ebin/*.app")].
%% @doc Lists the plugins which are currently running.
active() ->
@@ -137,15 +137,11 @@ prepare_plugins(EnabledFile, PluginsDistDir, ExpandDir) ->
[prepare_plugin(Plugin, ExpandDir) || Plugin <- ToUnpackPlugins].
-prepare_dir_plugin(PluginAppDescFn) ->
- %% Add the plugin ebin directory to the load path
- PluginEBinDirN = filename:dirname(PluginAppDescFn),
- code:add_path(PluginEBinDirN),
-
- %% We want the second-last token
- NameTokens = string:tokens(PluginAppDescFn,"/."),
- PluginNameString = lists:nth(length(NameTokens) - 1, NameTokens),
- list_to_atom(PluginNameString).
+prepare_dir_plugin(PluginAppDescPath) ->
+ PluginEBinDir = filename:dirname(PluginAppDescPath),
+ code:add_path(PluginEBinDir),
+ NameTokens = string:tokens(PluginAppDescPath, "/."),
+ list_to_atom(lists:nth(length(NameTokens) - 1, NameTokens)).
%%----------------------------------------------------------------------------