Class: Dependabot::Config::FileFetcher

Inherits:
FileFetchers::Base show all
Defined in:
lib/dependabot/config/file_fetcher.rb

Constant Summary collapse

CONFIG_FILE_PATHS =
%w(.github/dependabot.yml .github/dependabot.yaml).freeze

Constants inherited from FileFetchers::Base

FileFetchers::Base::CLIENT_NOT_FOUND_ERRORS, FileFetchers::Base::GIT_SUBMODULE_CLONE_ERROR, FileFetchers::Base::GIT_SUBMODULE_ERROR_REGEX, FileFetchers::Base::GIT_SUBMODULE_INACCESSIBLE_ERROR

Instance Attribute Summary

Attributes inherited from FileFetchers::Base

#credentials, #options, #repo_contents_path, #source

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from FileFetchers::Base

#clone_repo_contents, #commit, #directory, #ecosystem_versions, #files, #initialize, #repo, #target_branch

Constructor Details

This class inherits a constructor from Dependabot::FileFetchers::Base

Class Method Details

.required_files_in?(filenames) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/dependabot/config/file_fetcher.rb', line 12

def self.required_files_in?(filenames)
  CONFIG_FILE_PATHS.any? { |file| filenames.include?(file) }
end

.required_files_messageObject



16
17
18
# File 'lib/dependabot/config/file_fetcher.rb', line 16

def self.required_files_message
  "Repo must contain either a #{CONFIG_FILE_PATHS.join(' or a ')} file"
end

Instance Method Details

#config_fileObject



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

def config_file
  @config_file ||= files.first
end