Class: RubySMB::Server::Share::Provider::Disk
- Defined in:
- lib/ruby_smb/server/share/provider/disk.rb,
lib/ruby_smb/server/share/provider/disk/processor.rb,
lib/ruby_smb/server/share/provider/disk/file_system.rb,
lib/ruby_smb/server/share/provider/disk/processor/read.rb,
lib/ruby_smb/server/share/provider/disk/processor/close.rb,
lib/ruby_smb/server/share/provider/disk/processor/query.rb,
lib/ruby_smb/server/share/provider/disk/processor/create.rb
Overview
This is a share provider that exposes the local file system.
Direct Known Subclasses
Defined Under Namespace
Modules: FileSystem Classes: Processor
Constant Summary collapse
- TYPE =
TYPE_DISK
- FILE_SYSTEM =
emulate NTFS just like Samba does
FileSystem::NTFS
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(name, path, hooks: nil) ⇒ Disk
constructor
A new instance of Disk.
Methods inherited from Base
#add_hook, #new_processor, #remove_hook, #type
Constructor Details
#initialize(name, path, hooks: nil) ⇒ Disk
Returns a new instance of Disk.
17 18 19 20 21 22 23 24 |
# File 'lib/ruby_smb/server/share/provider/disk.rb', line 17 def initialize(name, path, hooks: nil) path = Pathname.new(File.(path)) if path.is_a?(String) raise ArgumentError.new('path must be a directory') unless path.directory? # it needs to exist raise ArgumentError.new('path must be absolute') unless path.absolute? # it needs to be absolute so it is independent of the cwd @path = path super(name, hooks: hooks) end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
26 27 28 |
# File 'lib/ruby_smb/server/share/provider/disk.rb', line 26 def path @path end |