abstract class Novika::Capabilities::IDisk
- Novika::Capabilities::IDisk
- Reference
- Object
Included Modules
Extended Modules
Direct Known Subclasses
Defined in:
novika/capabilities/disk.crClass Method Summary
Instance Method Summary
-
#can_read?(engine, path : Quote) : Boolean
Returns whether path exists and is readable.
-
#copy(engine, src : Quote, dst : Quote) : Bool
Copies source src (quote path to a file, symlink, or directory) to destination dst (also a quote).
-
#dir_empty?(engine, path : Quote) : Boolean | Nil
Returns whether directory pointed to by path is empty.
-
#has?(engine, path : Quote) : Boolean
Returns whether path exists.
-
#has_dir?(engine, path : Quote) : Boolean
Returns whether path exists and points to a directory.
-
#has_file?(engine, path : Quote) : Boolean
Returns whether path exists and points to a file.
-
#has_symlink?(engine, path : Quote) : Boolean
Returns whether path exists and points to a symlink.
-
#home(engine) : Quote
Returns current user's home directory.
-
#inject(into target : Block)
Injects the vocabulary of this capability into the target block.
-
#join(engine, base : Quote, child : Quote) : Quote
Returns path quote which is the result of joining base path and child path quotes using the platform-specific path separator.
-
#mkdir(engine, path : Quote)
Creates an empty directory at path, including any non-existing intermediate directories.
-
#pwd(engine) : Quote
Returns the working directory.
-
#read?(engine, path : Quote) : Quote | Nil
Reads and returns the contents of file at path.
-
#touch(engine, path : Quote)
Creates an empty file at path.
-
#write?(engine, content : Quote, path : Quote) : Bool
(Over)writes content of file at path with content quote.
-
#write?(engine, content : Byteslice, path : Quote) : Bool
(Over)writes content of file at path with content byteslice.
Instance methods inherited from module Novika::ICapability
capabilities : CapabilityCollection
capabilities,
inject(into target : Block)
inject
Constructor methods inherited from module Novika::ICapability
new(capabilities)
new
Class Method Detail
Instance Method Detail
Returns whether path exists and is readable.
Copies source src (quote path to a file, symlink, or directory) to destination dst (also a quote).
If src is a directory, copies it recursively.
Returns whether the operation was successful.
Returns whether directory pointed to by path is empty. Returns nil if path does not point to a directory, or if path does not exist.
Returns whether path exists and points to a directory.
Returns whether path exists and points to a file.
Returns whether path exists and points to a symlink.
Injects the vocabulary of this capability into the target block.
Returns path quote which is the result of joining base path and child path quotes using the platform-specific path separator.
Creates an empty directory at path, including any non-existing intermediate directories. Does nothing if path already exists.
Reads and returns the contents of file at path. Returns nil if there is no file at path.
Creates an empty file at path. Does nothing if path already exists.
(Over)writes content of file at path with content quote. Returns nil if path doesn't exist or doesn't point to a file.
(Over)writes content of file at path with content byteslice. Returns nil if path doesn't exist or doesn't point to a file.