Class: CodeKeeper::Finder
- Inherits:
-
Object
- Object
- CodeKeeper::Finder
- Defined in:
- lib/code_keeper/finder.rb
Overview
Find ruby files and manage the list of files.
Instance Attribute Summary collapse
-
#file_paths ⇒ Object
readonly
Returns the value of attribute file_paths.
Instance Method Summary collapse
-
#initialize(paths) ⇒ Finder
constructor
A new instance of Finder.
Constructor Details
#initialize(paths) ⇒ Finder
Returns a new instance of Finder.
8 9 10 11 12 13 14 |
# File 'lib/code_keeper/finder.rb', line 8 def initialize(paths) @file_paths = search_recursively(paths.uniq).map do |path| raise ::CodeKeeper::TargetFileNotFoundError.new(path) unless File.exist?(path) path if FileTest.file?(path) && File.extname(path) == '.rb' end.compact end |
Instance Attribute Details
#file_paths ⇒ Object (readonly)
Returns the value of attribute file_paths.
6 7 8 |
# File 'lib/code_keeper/finder.rb', line 6 def file_paths @file_paths end |