Module: YAVDB::SourceTypes::GitRepo

Defined in:
lib/yavdb/source_types/git_repo.rb

Class Method Summary collapse

Class Method Details

.search(file_pattern, repo_url, repo_branch = 'master', with_cache = true) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/yavdb/source_types/git_repo.rb', line 23

def self.search(file_pattern, repo_url, repo_branch = 'master', with_cache = true)
  repo_path = YAVDB::Utils::Git.get_contents(repo_url, repo_branch, with_cache)

  file_paths = Dir.chdir(repo_path) do
    Dir.glob(file_pattern).select { |f| File.file?(f) }
  end

  Hash[repo_path => file_paths]
end