From feba8f6592c33c252c6b4e5dd576f2722ada6bf2 Mon Sep 17 00:00:00 2001 From: Spencer McIntyre Date: Mon, 8 Jan 2024 10:43:07 -0500 Subject: [PATCH] Add the #remove_share method to the server --- lib/ruby_smb/server.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/ruby_smb/server.rb b/lib/ruby_smb/server.rb index 9e69e7506..78da7f361 100644 --- a/lib/ruby_smb/server.rb +++ b/lib/ruby_smb/server.rb @@ -58,6 +58,14 @@ def add_share(share_provider) @shares[share_provider.name] = share_provider end + def remove_share(share_provider) + share_provider = share_provder.name if share_provider.is_a?(RubySMB::Server::Share::Provider::Base) + logger.debug("Removing share: #{share_provider}") + @shares.delete(share_provider) + + nil + end + # Run the server and accept any connections. For each connection, the block will be executed if specified. When the # block returns false, the loop will exit and the server will no long accept new connections. def run(&block)