Module: Kozeki::Filesystem
- Included in:
- LocalFilesystem, QueuedFilesystem
- Defined in:
- lib/kozeki/filesystem.rb
Defined Under Namespace
Classes: NotFound
Constant Summary collapse
- Entry =
Data.define(:path, :mtime)
- Event =
Data.define(:op, :path, :time)
Instance Method Summary collapse
- #delete(path) ⇒ Object
- #flush ⇒ Object
- #list ⇒ Object
- #list_entries ⇒ Object
- #read(path) ⇒ Object
- #read_with_mtime(path) ⇒ Object
- #retain_only(files) ⇒ Object
- #watch ⇒ Object
- #write(path, string) ⇒ Object
Instance Method Details
#delete(path) ⇒ Object
20 21 22 |
# File 'lib/kozeki/filesystem.rb', line 20 def delete(path) raise NotImplementedError end |
#flush ⇒ Object
43 44 |
# File 'lib/kozeki/filesystem.rb', line 43 def flush end |
#list ⇒ Object
24 25 26 |
# File 'lib/kozeki/filesystem.rb', line 24 def list list_entries.map(&:path) end |
#list_entries ⇒ Object
28 29 30 |
# File 'lib/kozeki/filesystem.rb', line 28 def list_entries raise NotImplementedError end |
#read(path) ⇒ Object
8 9 10 |
# File 'lib/kozeki/filesystem.rb', line 8 def read(path) read_with_mtime(path)[0] end |
#read_with_mtime(path) ⇒ Object
12 13 14 |
# File 'lib/kozeki/filesystem.rb', line 12 def read_with_mtime(path) raise NotImplementedError end |
#retain_only(files) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/kozeki/filesystem.rb', line 36 def retain_only(files) to_remove = list() - files to_remove.each do |path| delete(path) end end |
#watch ⇒ Object
32 33 34 |
# File 'lib/kozeki/filesystem.rb', line 32 def watch raise NotImplementedError end |
#write(path, string) ⇒ Object
16 17 18 |
# File 'lib/kozeki/filesystem.rb', line 16 def write(path, string) raise NotImplementedError end |