Class: Dependabot::Maven::FileFetcher
- Inherits:
-
FileFetchers::Base
- Object
- FileFetchers::Base
- Dependabot::Maven::FileFetcher
- Extended by:
- T::Helpers, T::Sig
- Defined in:
- lib/dependabot/maven/file_fetcher.rb
Constant Summary collapse
- MODULE_SELECTOR =
"project > modules > module, " \ "profile > modules > module"
- WRAPPER_PROPERTIES_RELATIVE =
".mvn/wrapper/maven-wrapper.properties"- WRAPPER_JAR_RELATIVE =
".mvn/wrapper/maven-wrapper.jar"- WRAPPER_DOWNLOADER_RELATIVE =
".mvn/wrapper/MavenWrapperDownloader.java"- WRAPPER_UNIX_SCRIPTS =
%w(mvnw mvnwDebug).freeze
- WRAPPER_WINDOWS_SCRIPTS =
%w(mvnw.cmd mvnwDebug.cmd).freeze
- WRAPPER_ALL_SCRIPTS =
T.let((WRAPPER_UNIX_SCRIPTS + WRAPPER_WINDOWS_SCRIPTS).freeze, T::Array[String])
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.required_files_in?(filenames) ⇒ Boolean
32 33 34 |
# File 'lib/dependabot/maven/file_fetcher.rb', line 32 def self.required_files_in?(filenames) filenames.include?("pom.xml") end |
.required_files_message ⇒ Object
37 38 39 |
# File 'lib/dependabot/maven/file_fetcher.rb', line 37 def self. "Repo must contain a pom.xml." end |
Instance Method Details
#fetch_files ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/dependabot/maven/file_fetcher.rb', line 42 def fetch_files fetched_files = [] fetched_files << pom poms = child_poms fetched_files += poms fetched_files += relative_path_parents(fetched_files) fetched_files += targetfiles fetched_files << extensions if extensions # Pass already-fetched poms so all_wrapper_files does not re-fetch them. fetched_files += all_wrapper_files([T.must(pom)] + poms) # Filter excluded files from final collection filtered_files = fetched_files.uniq.reject do |file| Dependabot::FileFiltering.should_exclude_path?(file.name, "file from final collection", @exclude_paths) end filtered_files end |