Class: Dependabot::Maven::FileUpdater::DeclarationFinder
- Inherits:
-
Object
- Object
- Dependabot::Maven::FileUpdater::DeclarationFinder
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/maven/file_updater/declaration_finder.rb
Constant Summary collapse
- DECLARATION_REGEX =
%r{ <parent>.*?</parent>| <dependency>.*?</dependency>| <plugin>.*?(?:<plugin>.*?</plugin>.*)?</plugin>| <extension>.*?</extension>| <path>.*?</path>| <artifactItem>.*?</artifactItem> }mx- Requirement =
T.type_alias { T.any(Dependabot::DependencyRequirement, T::Hash[Symbol, Object]) }
Instance Attribute Summary collapse
-
#declaring_requirement ⇒ Object
readonly
Returns the value of attribute declaring_requirement.
-
#dependency ⇒ Object
readonly
Returns the value of attribute dependency.
-
#dependency_files ⇒ Object
readonly
Returns the value of attribute dependency_files.
Instance Method Summary collapse
- #declaration_nodes ⇒ Object
- #declaration_strings ⇒ Object
-
#initialize(dependency:, dependency_files:, declaring_requirement:) ⇒ DeclarationFinder
constructor
A new instance of DeclarationFinder.
Constructor Details
#initialize(dependency:, dependency_files:, declaring_requirement:) ⇒ DeclarationFinder
Returns a new instance of DeclarationFinder.
41 42 43 44 45 46 47 |
# File 'lib/dependabot/maven/file_updater/declaration_finder.rb', line 41 def initialize(dependency:, dependency_files:, declaring_requirement:) @dependency = dependency @dependency_files = dependency_files @declaring_requirement = declaring_requirement @declaration_strings = T.let(nil, T.nilable(T::Array[String])) @property_value_finder = T.let(nil, T.nilable(Maven::FileParser::PropertyValueFinder)) end |
Instance Attribute Details
#declaring_requirement ⇒ Object (readonly)
Returns the value of attribute declaring_requirement.
29 30 31 |
# File 'lib/dependabot/maven/file_updater/declaration_finder.rb', line 29 def declaring_requirement @declaring_requirement end |
#dependency ⇒ Object (readonly)
Returns the value of attribute dependency.
26 27 28 |
# File 'lib/dependabot/maven/file_updater/declaration_finder.rb', line 26 def dependency @dependency end |
#dependency_files ⇒ Object (readonly)
Returns the value of attribute dependency_files.
32 33 34 |
# File 'lib/dependabot/maven/file_updater/declaration_finder.rb', line 32 def dependency_files @dependency_files end |
Instance Method Details
#declaration_nodes ⇒ Object
55 56 57 58 59 |
# File 'lib/dependabot/maven/file_updater/declaration_finder.rb', line 55 def declaration_nodes declaration_strings.map do |declaration_string| Nokogiri::XML(declaration_string) end end |
#declaration_strings ⇒ Object
50 51 52 |
# File 'lib/dependabot/maven/file_updater/declaration_finder.rb', line 50 def declaration_strings @declaration_strings ||= fetch_pom_declaration_strings end |