Class: Changit::GitDirFinder
- Inherits:
-
Object
- Object
- Changit::GitDirFinder
- Defined in:
- lib/changit/git_dir_finder.rb
Constant Summary collapse
- DEFAULT_SEARCH_PATH =
Dir.pwd.freeze
Instance Method Summary collapse
- #find_all ⇒ Object
-
#initialize(search_paths: nil) ⇒ GitDirFinder
constructor
A new instance of GitDirFinder.
Constructor Details
#initialize(search_paths: nil) ⇒ GitDirFinder
Returns a new instance of GitDirFinder.
5 6 7 8 9 10 |
# File 'lib/changit/git_dir_finder.rb', line 5 def initialize(search_paths: nil) search_paths ||= [DEFAULT_SEARCH_PATH] @search_paths = search_paths.collect! { |path| "#{path}/**/.git/config" } freeze end |
Instance Method Details
#find_all ⇒ Object
12 13 14 |
# File 'lib/changit/git_dir_finder.rb', line 12 def find_all Dir.glob(@search_paths) end |