File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -57,15 +57,16 @@ def rpc_load(path, xopts = {})
57
57
# @example Here's how you would use this from the client:
58
58
# rpc.call('plugin.unload', 'nexpose')
59
59
def rpc_unload ( name )
60
- self . framework . plugins . each { |plugin |
61
- # Unload the plugin if it matches the name we're searching for
62
- if ( plugin . name == name )
63
- self . framework . plugins . unload ( plugin )
64
- return { "result" => "success" }
65
- end
66
- }
67
- return { "result" => "failure" }
60
+ # Find a plugin within the plugins array
61
+ plugin = self . framework . plugins . find { |p | p . name == name }
68
62
63
+ # Unload the plugin if it matches the name we're searching for
64
+ if plugin
65
+ self . framework . plugins . unload ( plugin )
66
+ return { "result" => "success" }
67
+ end
68
+
69
+ return { "result" => "failure" }
69
70
end
70
71
71
72
You can’t perform that action at this time.
0 commit comments