Class: Ferver::FerverDirectory

Inherits:
Object
  • Object
show all
Defined in:
lib/ferver/ferver_directory.rb

Overview

A wrapper around the directory specified by config

Instance Method Summary collapse

Constructor Details

#initialize(configuration) ⇒ FerverDirectory

Returns a new instance of FerverDirectory.

Raises:

  • (ArgumentError)


5
6
7
8
9
10
11
# File 'lib/ferver/ferver_directory.rb', line 5

def initialize(configuration)
  path = configuration.directory_path
  raise ArgumentError, "No path is specified" if path.empty?
  raise DirectoryNotFoundError unless Dir.exist?(path)

  @configuration = configuration
end

Instance Method Details

#found_filesObject



21
22
23
# File 'lib/ferver/ferver_directory.rb', line 21

def found_files
  find_files
end

#full_pathObject



17
18
19
# File 'lib/ferver/ferver_directory.rb', line 17

def full_path
  @_full_path ||= File.expand_path(path)
end

#pathObject



13
14
15
# File 'lib/ferver/ferver_directory.rb', line 13

def path
  configuration.directory_path
end