dependabot-maven 0.169.0 → 0.169.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19815372ba020f9f27d6b219cbc6c6b912a632a89ee1db53c7e7aec3d90237f0
4
- data.tar.gz: ea337f8d681d33b00be01d72ccd0456f2bcfa16f3aee3a48461e9e2410626a1f
3
+ metadata.gz: af08872eae5d8ca74fc1c8ed9c9756dc107f728042865b9750691ae0022b8561
4
+ data.tar.gz: ec1a46e61ac25104db34d9ea98dcf8622ba53e3e7ab5ae0c57667f1a8259b2b9
5
5
  SHA512:
6
- metadata.gz: 119216189a8311d8be0df337937703894af76b9bd900581227a592224cbce871fb629e0948a5be64bcf5fd6d66c10f43d873e8ae22ab912b4df7ffb5aab3afce
7
- data.tar.gz: 9c52c7ed35830e96d99828f3ba5c2573da9643b32f0ab4b28231223cc856a46280e5e57bad5ece0c8bf5be13de14fdd4ff7f07a15d92c44b2af92c26dc13ac07
6
+ metadata.gz: 715729b5e36660dc4abf3d63b2d501ec4cd2ce83de105df8218cc54d4981d0df48873aea959fb8954aadb815376bf15d580479069b2ab0f6d104e666227f5ee8
7
+ data.tar.gz: 430fc4c5c88ca5ec0beef3aa515d39bef44797722c98803463701c208ee6827dfa601525873812bb5609d7c71d1a1cb31ed829580968bdfb26786775b32785b9
@@ -9,7 +9,9 @@ module Dependabot
9
9
  module Maven
10
10
  class FileUpdater
11
11
  class DeclarationFinder
12
- DECLARATION_TYPES = %w(parent dependency plugin extension).freeze
12
+ DECLARATION_REGEX =
13
+ %r{<parent>.*?</parent>|<dependency>.*?</dependency>|
14
+ <plugin>.*?(?:<plugin>.*?</plugin>.*)?</plugin>|<extension>.*?</extension>}mx.freeze
13
15
 
14
16
  attr_reader :dependency, :declaring_requirement, :dependency_files
15
17
 
@@ -76,14 +78,9 @@ module Dependabot
76
78
  end
77
79
 
78
80
  def deep_find_declarations(string)
79
- pom = Nokogiri::XML(string)
80
- nodes = []
81
- pom.traverse do |node|
82
- next unless DECLARATION_TYPES.include?(node.node_name)
83
-
84
- nodes << node.to_s
81
+ string.scan(DECLARATION_REGEX).flat_map do |matching_node|
82
+ [matching_node, *deep_find_declarations(matching_node[1..-1])]
85
83
  end
86
- nodes
87
84
  end
88
85
 
89
86
  def declaring_requirement_matches?(node)
@@ -105,7 +105,7 @@ module Dependabot
105
105
  dependency: dep,
106
106
  declaring_requirement: declaring_requirement,
107
107
  dependency_files: dependency_files
108
- ).declaration_nodes.first.at_xpath("./*/version")&.content
108
+ ).declaration_nodes.first.at_css("version")&.content
109
109
  end
110
110
 
111
111
  def pom
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-maven
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.169.0
4
+ version: 0.169.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-23 00:00:00.000000000 Z
11
+ date: 2021-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dependabot-common
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.169.0
19
+ version: 0.169.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.169.0
26
+ version: 0.169.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
220
  - !ruby/object:Gem::Version
221
221
  version: 2.5.0
222
222
  requirements: []
223
- rubygems_version: 3.2.22
223
+ rubygems_version: 3.2.32
224
224
  signing_key:
225
225
  specification_version: 4
226
226
  summary: Maven support for dependabot