Class: BaseDirectory

Inherits:
Directory show all
Defined in:
lib/exegesis/base_directory.rb

Overview

class BaseDirectory IS_A Directory

HAS_A Root
HAS_MANY Directories
HAS_MANY SourceFiles (files)

Responsibilities:

Expose properties of the root directory, Spawn the initial set of
directories which will recursively find all the files in the project

The class will also wrap some of the SourceFile macros, like #join and
#expand_path and stuff. Think along the lines of Rails.root and the like.

Collaborators:

[Directory]
[SourceFile]

Instance Method Summary collapse

Constructor Details

#initialize(root, searcher = FileSearcher) ⇒ BaseDirectory

Returns a new instance of BaseDirectory.

Parameters:

  • root (String)

    the root path of the project

  • searcher (FileSearcher) (defaults to: FileSearcher)

    an object used to search for files in a given directory



20
21
22
# File 'lib/exegesis/base_directory.rb', line 20

def initialize(root, searcher = FileSearcher)
  super(nil, root, searcher)
end

Instance Method Details

#pathObject Also known as: root

The path to the root of the project



25
26
27
# File 'lib/exegesis/base_directory.rb', line 25

def path
  name
end