diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2012-08-08 12:15:13 +0100 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2012-08-08 12:15:13 +0100 |
| commit | b288959293063a16a249bfa3b39b2ad32bb8452a (patch) | |
| tree | 9e31641699c7cb534f4c36c55ffadb66f75ddba6 /src | |
| parent | 271e8667a70f68b49b9218290d0b8c665937f134 (diff) | |
| download | rabbitmq-server-git-b288959293063a16a249bfa3b39b2ad32bb8452a.tar.gz | |
refactor: less confusing variable names
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_plugins.erl | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/rabbit_plugins.erl b/src/rabbit_plugins.erl index c3d1ad7c61..0320c69fc2 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(ExpandDir ++ "/*/ebin/*.app")]. + [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)). %%---------------------------------------------------------------------------- |
