nokogiri 1.11.0.rc1-x86-mingw32 → 1.11.0.rc2-x86-mingw32
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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/ext/nokogiri/extconf.rb +6 -2
- data/ext/nokogiri/nokogiri.h +12 -0
- data/ext/nokogiri/xml_reader.c +6 -17
- data/ext/nokogiri/xml_schema.c +29 -0
- data/lib/nokogiri/2.4/nokogiri.so +0 -0
- data/lib/nokogiri/2.5/nokogiri.so +0 -0
- data/lib/nokogiri/2.6/nokogiri.so +0 -0
- data/lib/nokogiri/2.7/nokogiri.so +0 -0
- data/lib/nokogiri/css/parser_extras.rb +38 -36
- data/lib/nokogiri/version.rb +2 -2
- data/lib/nokogiri/xml/node.rb +514 -213
- data/lib/nokogiri/xml/searchable.rb +21 -15
- metadata +12 -20
@@ -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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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:/,
|
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
|
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
|
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.
|
4
|
+
version: 1.11.0.rc2
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Aaron Patterson
|
@@ -14,50 +14,42 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date: 2020-
|
17
|
+
date: 2020-04-01 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
|
-
- !ruby/object:Gem::Dependency
|
20
|
-
name: mini_portile2
|
21
|
-
requirement: !ruby/object:Gem::Requirement
|
22
|
-
requirements:
|
23
|
-
- - "~>"
|
24
|
-
- !ruby/object:Gem::Version
|
25
|
-
version: 2.4.0
|
26
|
-
type: :runtime
|
27
|
-
prerelease: false
|
28
|
-
version_requirements: !ruby/object:Gem::Requirement
|
29
|
-
requirements:
|
30
|
-
- - "~>"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 2.4.0
|
33
19
|
- !ruby/object:Gem::Dependency
|
34
20
|
name: concourse
|
35
21
|
requirement: !ruby/object:Gem::Requirement
|
36
22
|
requirements:
|
37
23
|
- - "~>"
|
38
24
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0.
|
25
|
+
version: '0.32'
|
40
26
|
type: :development
|
41
27
|
prerelease: false
|
42
28
|
version_requirements: !ruby/object:Gem::Requirement
|
43
29
|
requirements:
|
44
30
|
- - "~>"
|
45
31
|
- !ruby/object:Gem::Version
|
46
|
-
version: '0.
|
32
|
+
version: '0.32'
|
47
33
|
- !ruby/object:Gem::Dependency
|
48
34
|
name: hoe
|
49
35
|
requirement: !ruby/object:Gem::Requirement
|
50
36
|
requirements:
|
51
37
|
- - "~>"
|
52
38
|
- !ruby/object:Gem::Version
|
53
|
-
version: '3.
|
39
|
+
version: '3.22'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 3.22.1
|
54
43
|
type: :development
|
55
44
|
prerelease: false
|
56
45
|
version_requirements: !ruby/object:Gem::Requirement
|
57
46
|
requirements:
|
58
47
|
- - "~>"
|
59
48
|
- !ruby/object:Gem::Version
|
60
|
-
version: '3.
|
49
|
+
version: '3.22'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 3.22.1
|
61
53
|
- !ruby/object:Gem::Dependency
|
62
54
|
name: hoe-bundler
|
63
55
|
requirement: !ruby/object:Gem::Requirement
|