Class: Dependabot::Hex::FileFetcher
- Inherits:
-
FileFetchers::Base
- Object
- FileFetchers::Base
- Dependabot::Hex::FileFetcher
- 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
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_message ⇒ Object
26 27 28 |
# File 'lib/dependabot/hex/file_fetcher.rb', line 26 def self. "Repo must contain a mix.exs." end |
Instance Method Details
#fetch_files ⇒ Object
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 |