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

Instance Method Details

#delete(path) ⇒ Object

Raises:

  • (NotImplementedError)


20
21
22
# File 'lib/kozeki/filesystem.rb', line 20

def delete(path)
  raise NotImplementedError
end

#flushObject



43
44
# File 'lib/kozeki/filesystem.rb', line 43

def flush
end

#listObject



24
25
26
# File 'lib/kozeki/filesystem.rb', line 24

def list
  list_entries.map(&:path)
end

#list_entriesObject

Raises:

  • (NotImplementedError)


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

Raises:

  • (NotImplementedError)


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

#watchObject

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/kozeki/filesystem.rb', line 32

def watch
  raise NotImplementedError
end

#write(path, string) ⇒ Object

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/kozeki/filesystem.rb', line 16

def write(path, string)
  raise NotImplementedError
end