Class: DirFilter
- Inherits:
-
Object
- Object
- DirFilter
- Defined in:
- lib/helpers/filesystem_helpers.rb
Instance Method Summary collapse
- #filter_entries(path) ⇒ Object
-
#initialize(ignore_list) ⇒ DirFilter
constructor
A new instance of DirFilter.
Constructor Details
#initialize(ignore_list) ⇒ DirFilter
Returns a new instance of DirFilter.
3 4 5 6 |
# File 'lib/helpers/filesystem_helpers.rb', line 3 def initialize(ignore_list) @ignore_list = [ignore_list].flatten @ignore_list << /^\./ #ignore dot files end |
Instance Method Details
#filter_entries(path) ⇒ Object
9 10 11 12 13 |
# File 'lib/helpers/filesystem_helpers.rb', line 9 def filter_entries(path) wkg_entries = Dir.entries(path) #remove dot files wkg_entires = wkg_entries.delete_if{|entry| in_ignore_list?(entry) } end |