Class: Dependabot::Nuget::FileFetcher

Inherits:
FileFetchers::Base
  • Object
show all
Defined in:
lib/dependabot/nuget/file_fetcher.rb,
lib/dependabot/nuget/file_fetcher/import_paths_finder.rb,
lib/dependabot/nuget/file_fetcher/sln_project_paths_finder.rb

Defined Under Namespace

Classes: ImportPathsFinder, SlnProjectPathsFinder

Class Method Summary collapse

Class Method Details

.required_files_in?(filenames) ⇒ Boolean

Returns:

  • (Boolean)

12
13
14
15
16
17
18
# File 'lib/dependabot/nuget/file_fetcher.rb', line 12

def self.required_files_in?(filenames)
  return true if filenames.any? { |f| f.match?(/^packages\.config$/i) }
  return true if filenames.any? { |f| f.end_with?(".sln") }
  return true if filenames.any? { |f| f.match?("^src$") }

  filenames.any? { |name| name.match?(%r{^[^/]*\.[a-z]{2}proj$}) }
end

.required_files_messageObject


20
21
22
# File 'lib/dependabot/nuget/file_fetcher.rb', line 20

def self.required_files_message
  "Repo must contain a .(cs|vb|fs)proj file or a packages.config."
end