Class: Dependabot::Hex::FileFetcher

Inherits:
FileFetchers::Base
  • Object
show all
Extended by:
T::Helpers, T::Sig
Defined in:
lib/dependabot/hex/file_fetcher.rb

Constant Summary collapse

APPS_PATH_REGEX =
/apps_path:\s*"(?<path>.*?)"/m
STRING_ARG =
%{(?:["'](.*?)["'])}
SUPPORTED_METHODS =
T.let(%w(eval_file require_file).join("|").freeze, String)
SUPPORT_FILE =
/Code\.(?:#{SUPPORTED_METHODS})\(#{STRING_ARG}(?:\s*,\s*#{STRING_ARG})?\)/
PATH_DEPS_REGEX =
/{.*path: ?#{STRING_ARG}.*}/

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.required_files_in?(filenames) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/dependabot/hex/file_fetcher.rb', line 21

def self.required_files_in?(filenames)
  filenames.include?("mix.exs")
end

.required_files_messageObject



26
27
28
# File 'lib/dependabot/hex/file_fetcher.rb', line 26

def self.required_files_message
  "Repo must contain a mix.exs."
end

Instance Method Details

#fetch_filesObject



31
32
33
34
35
36
37
38
# File 'lib/dependabot/hex/file_fetcher.rb', line 31

def fetch_files
  fetched_files = []
  fetched_files << mixfile
  fetched_files << lockfile if lockfile
  fetched_files += subapp_mixfiles
  fetched_files += support_files
  fetched_files
end