Class: Stowaway::Sweeper
- Inherits:
-
Object
- Object
- Stowaway::Sweeper
- Includes:
- FSHelpyHelp, Output
- Defined in:
- lib/stowaway/sweeper.rb
Overview
Sweeper will sweep through a directory recursively (path) and try to find references to files in the array of FileObjs passed in as the second parameter.
Constant Summary
Constants included from Output
Instance Method Summary collapse
-
#initialize(matcher = Matcher.new) ⇒ Sweeper
constructor
A new instance of Sweeper.
- #sweep(target_context, files) ⇒ Object
Methods included from Output
Methods included from FSHelpyHelp
#ignore?, #ignore_special_directories, #recursively
Constructor Details
Instance Method Details
#sweep(target_context, files) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/stowaway/sweeper.rb', line 22 def sweep(target_context, files) @context = target_context @result = OpenStruct.new({ :files => files, :name_only_matches => []}) ignore_special_directories(@context.root) recursively(@context.root) { |fp| inspect_file(fp) } @result end |