Class: Dependabot::Gradle::FileFetcher::SettingsFileParser
- Inherits:
-
Object
- Object
- Dependabot::Gradle::FileFetcher::SettingsFileParser
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/gradle/file_fetcher/settings_file_parser.rb
Instance Method Summary collapse
- #included_build_paths ⇒ Object
-
#initialize(settings_file:) ⇒ SettingsFileParser
constructor
A new instance of SettingsFileParser.
- #subproject_paths ⇒ Object
Constructor Details
#initialize(settings_file:) ⇒ SettingsFileParser
Returns a new instance of SettingsFileParser.
15 16 17 |
# File 'lib/dependabot/gradle/file_fetcher/settings_file_parser.rb', line 15 def initialize(settings_file:) @settings_file = settings_file end |
Instance Method Details
#included_build_paths ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/dependabot/gradle/file_fetcher/settings_file_parser.rb', line 20 def included_build_paths paths = [] comment_free_content&.scan(function_regex("includeBuild")) do arg = T.must(Regexp.last_match).named_captures.fetch("args") paths << T.must(arg).gsub(/["']/, "").strip end paths.uniq end |
#subproject_paths ⇒ Object
30 31 32 33 34 |
# File 'lib/dependabot/gradle/file_fetcher/settings_file_parser.rb', line 30 def subproject_paths subprojects = T.let([], T::Array[String]) process_include_functions(subprojects) subprojects.uniq.map { |name| process_subproject_name(name) } end |