Class: Based::BaseDirectory
Overview
An object representing the base directory
Instance Attribute Summary collapse
-
#dirExclude ⇒ Object
readonly
Function to decide if sub-directories should be excluded (if a directory is excluded, so are all it’s sub-directories and files contained within).
-
#fileExclude ⇒ Object
readonly
Function to decide if files should be excluded.
-
#fileInclude ⇒ Object
readonly
Function to decide if files should be included (if nil, assume all included).
Attributes inherited from Directory
#base, #fullPath, #name, #parent, #pathElements, #relativePath
Instance Method Summary collapse
-
#initialize(path, options = {}) ⇒ BaseDirectory
constructor
Initialise from absolute file path.
Methods inherited from Directory
#allFiles, #dirs, #files, #getEntries, #subDirs
Constructor Details
#initialize(path, options = {}) ⇒ BaseDirectory
Initialise from absolute file path. Options include :dirExclude, :fileInclude and :fileExclude
130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/based.rb', line 130 def initialize(path, = {}) super() @name = nil @parent = nil @base = self @relativePath = "" @pathElements = [] @fullPath = path.end_with?("/") ? path : path + "/" @dirExclude = .fetch(:dirExclude, nil) @fileInclude = .fetch(:fileInclude, nil) @fileExclude = .fetch(:fileExclude, nil) end |
Instance Attribute Details
#dirExclude ⇒ Object (readonly)
Function to decide if sub-directories should be excluded (if a directory is excluded, so are all it’s sub-directories and files contained within)
127 128 129 |
# File 'lib/based.rb', line 127 def dirExclude @dirExclude end |
#fileExclude ⇒ Object (readonly)
Function to decide if files should be excluded
123 124 125 |
# File 'lib/based.rb', line 123 def fileExclude @fileExclude end |
#fileInclude ⇒ Object (readonly)
Function to decide if files should be included (if nil, assume all included). Subject to exclusion by fileExclude
120 121 122 |
# File 'lib/based.rb', line 120 def fileInclude @fileInclude end |