nokogiri 1.11.0.rc1-java → 1.11.0.rc2-java

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of nokogiri might be problematic. Click here for more details.

@@ -12,7 +12,9 @@ module Nokogiri
12
12
  # Regular expression used by Searchable#search to determine if a query
13
13
  # string is CSS or XPath
14
14
  LOOKS_LIKE_XPATH = /^(\.\/|\/|\.\.|\.$)/
15
-
15
+
16
+ # @!group Searching via XPath or CSS Queries
17
+
16
18
  ###
17
19
  # call-seq: search *paths, [namespace-bindings, xpath-variable-bindings, custom-handler-class]
18
20
  #
@@ -46,7 +48,7 @@ module Nokogiri
46
48
  # )
47
49
  #
48
50
  # See Searchable#xpath and Searchable#css for further usage help.
49
- def search *args
51
+ def search(*args)
50
52
  paths, handler, ns, binds = extract_params(args)
51
53
 
52
54
  xpaths = paths.map(&:to_s).map do |path|
@@ -55,6 +57,7 @@ module Nokogiri
55
57
 
56
58
  xpath(*(xpaths + [ns, handler, binds].compact))
57
59
  end
60
+
58
61
  alias :/ :search
59
62
 
60
63
  ###
@@ -64,9 +67,10 @@ module Nokogiri
64
67
  # result. +paths+ must be one or more XPath or CSS queries.
65
68
  #
66
69
  # See Searchable#search for more information.
67
- def at *args
70
+ def at(*args)
68
71
  search(*args).first
69
72
  end
73
+
70
74
  alias :% :at
71
75
 
72
76
  ###
@@ -102,7 +106,7 @@ module Nokogiri
102
106
  # found in an XML document, where tags names are case-sensitive
103
107
  # (e.g., "H1" is distinct from "h1").
104
108
  #
105
- def css *args
109
+ def css(*args)
106
110
  rules, handler, ns, _ = extract_params(args)
107
111
 
108
112
  css_internal self, rules, handler, ns
@@ -115,7 +119,7 @@ module Nokogiri
115
119
  # match. +rules+ must be one or more CSS selectors.
116
120
  #
117
121
  # See Searchable#css for more information.
118
- def at_css *args
122
+ def at_css(*args)
119
123
  css(*args).first
120
124
  end
121
125
 
@@ -149,7 +153,7 @@ module Nokogiri
149
153
  # end
150
154
  # }.new)
151
155
  #
152
- def xpath *args
156
+ def xpath(*args)
153
157
  paths, handler, ns, binds = extract_params(args)
154
158
 
155
159
  xpath_internal self, paths, handler, ns, binds
@@ -162,17 +166,19 @@ module Nokogiri
162
166
  # match. +paths+ must be one or more XPath queries.
163
167
  #
164
168
  # See Searchable#xpath for more information.
165
- def at_xpath *args
169
+ def at_xpath(*args)
166
170
  xpath(*args).first
167
171
  end
168
172
 
173
+ # @!endgroup
174
+
169
175
  private
170
176
 
171
- def css_internal node, rules, handler, ns
177
+ def css_internal(node, rules, handler, ns)
172
178
  xpath_internal node, css_rules_to_xpath(rules, ns), handler, ns, nil
173
179
  end
174
180
 
175
- def xpath_internal node, paths, handler, ns, binds
181
+ def xpath_internal(node, paths, handler, ns, binds)
176
182
  document = node.document
177
183
  return NodeSet.new(document) unless document
178
184
 
@@ -187,12 +193,12 @@ module Nokogiri
187
193
  end
188
194
  end
189
195
 
190
- def xpath_impl node, path, handler, ns, binds
196
+ def xpath_impl(node, path, handler, ns, binds)
191
197
  ctx = XPathContext.new(node)
192
198
  ctx.register_namespaces(ns)
193
- path = path.gsub(/xmlns:/, ' :') unless Nokogiri.uses_libxml?
199
+ path = path.gsub(/xmlns:/, " :") unless Nokogiri.uses_libxml?
194
200
 
195
- binds.each do |key,value|
201
+ binds.each do |key, value|
196
202
  ctx.register_variable key.to_s, value
197
203
  end if binds
198
204
 
@@ -203,13 +209,13 @@ module Nokogiri
203
209
  rules.map { |rule| xpath_query_from_css_rule(rule, ns) }
204
210
  end
205
211
 
206
- def xpath_query_from_css_rule rule, ns
212
+ def xpath_query_from_css_rule(rule, ns)
207
213
  self.class::IMPLIED_XPATH_CONTEXTS.map do |implied_xpath_context|
208
214
  CSS.xpath_for(rule.to_s, :prefix => implied_xpath_context, :ns => ns)
209
- end.join(' | ')
215
+ end.join(" | ")
210
216
  end
211
217
 
212
- def extract_params params # :nodoc:
218
+ def extract_params(params) # :nodoc:
213
219
  handler = params.find do |param|
214
220
  ![Hash, String, Symbol].include?(param.class)
215
221
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokogiri
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.0.rc1
4
+ version: 1.11.0.rc2
5
5
  platform: java
6
6
  authors:
7
7
  - Aaron Patterson
@@ -14,14 +14,14 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2020-02-02 00:00:00.000000000 Z
17
+ date: 2020-04-01 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  requirement: !ruby/object:Gem::Requirement
21
21
  requirements:
22
22
  - - "~>"
23
23
  - !ruby/object:Gem::Version
24
- version: '0.30'
24
+ version: '0.32'
25
25
  name: concourse
26
26
  prerelease: false
27
27
  type: :development
@@ -29,13 +29,16 @@ dependencies:
29
29
  requirements:
30
30
  - - "~>"
31
31
  - !ruby/object:Gem::Version
32
- version: '0.30'
32
+ version: '0.32'
33
33
  - !ruby/object:Gem::Dependency
34
34
  requirement: !ruby/object:Gem::Requirement
35
35
  requirements:
36
36
  - - "~>"
37
37
  - !ruby/object:Gem::Version
38
- version: '3.18'
38
+ version: '3.22'
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: 3.22.1
39
42
  name: hoe
40
43
  prerelease: false
41
44
  type: :development
@@ -43,7 +46,10 @@ dependencies:
43
46
  requirements:
44
47
  - - "~>"
45
48
  - !ruby/object:Gem::Version
46
- version: '3.18'
49
+ version: '3.22'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 3.22.1
47
53
  - !ruby/object:Gem::Dependency
48
54
  requirement: !ruby/object:Gem::Requirement
49
55
  requirements: