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

Instance Attribute Summary

Attributes inherited from FileFetchers::Base

#credentials, #repo_contents_path, #source

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from FileFetchers::Base

#clone_repo_contents, #commit, #directory, #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)


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

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

.required_files_messageObject



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

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

Instance Method Details

#config_fileObject



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

def config_file
  @config_file ||= files.first
end