Skip to content

Commit

Permalink
Add the #remove_share method to the server
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroSteiner committed Jan 8, 2024
1 parent 285716d commit 4be984f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/ruby_smb/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4be984f

Please sign in to comment.