Class: Staticky::Filesystem

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/staticky/filesystem.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.realObject



10
11
12
13
# File 'lib/staticky/filesystem.rb', line 10

def self.real
  files = Staticky::Files.new
  new(files)
end

.testObject



5
6
7
8
# File 'lib/staticky/filesystem.rb', line 5

def self.test
  files = Staticky::Files.new(memory: true)
  new(files)
end

Instance Method Details

#children(directory) ⇒ Object



21
22
23
24
# File 'lib/staticky/filesystem.rb', line 21

def children(directory)
  tokens = [".", ".."]
  entries(directory).reject { |entry| tokens.include?(entry) }
end

#touch(*files) ⇒ Object



15
16
17
18
19
# File 'lib/staticky/filesystem.rb', line 15

def touch(*files)
  files.each do |file|
    super(file)
  end
end