nokogiri 1.10.3-x86-mingw32 → 1.10.4-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be404b59e382195664fee52bb59899ba32bd108075d7ed8dd81f31d1fa1bc34b
4
- data.tar.gz: de58825cac3a1f43a65f5d4525c7d396309565643759f1c3c01d3439aa568599
3
+ metadata.gz: 8f70de8da3aaf4b4e1fa9a8bcfd84a9d94f1e19a4511a4a42e2b937be0a352e1
4
+ data.tar.gz: ceccb76f924df8d1ba4a72388a1bd5201e811fc1e3b262b32c5796e0f2b92237
5
5
  SHA512:
6
- metadata.gz: 926b5e05e649eabf50d7c847d9d96af6c1ef6261c1f5e0ef4cf540aed3fabb1d0a0ad1f9772fcd4efaee16552e58fa6f3a04b7e36bafee56262a9e073cda786b
7
- data.tar.gz: cc8cc08837088f89e60a4f5eed718392b31c5b63c4bbc88c4a7c516786c06cb76fd498bde954ecda69d515fc958f8c1cdeffd855839322c53ca9ba5b77f1c7c5
6
+ metadata.gz: b076f6c33563792dc62634f6dd4fbce0eb846374f0754ce57980aaa0988bf405c38232c83ff9ea250eba5edf83b55e3d3d2bc0363d0b910a4068faa9a2a73ba2
7
+ data.tar.gz: b2a5b945f541413680585efbce14851ef6ab276d54133f270617696dc7466d5a81196ac3ab9520b18ecde908758956c157d3a56e18bb68b4e22ceb2e4807372f
Binary file
Binary file
Binary file
Binary file
@@ -1,151 +1,152 @@
1
1
  #--
2
2
  # DO NOT MODIFY!!!!
3
- # This file is automatically generated by rex 1.0.5
3
+ # This file is automatically generated by rex 1.0.7
4
4
  # from lexical definition file "lib/nokogiri/css/tokenizer.rex".
5
5
  #++
6
6
 
7
7
  module Nokogiri
8
8
  module CSS
9
9
  class Tokenizer # :nodoc:
10
- require 'strscan'
10
+ require 'strscan'
11
11
 
12
- class ScanError < StandardError ; end
12
+ class ScanError < StandardError ; end
13
13
 
14
- attr_reader :lineno
15
- attr_reader :filename
16
- attr_accessor :state
14
+ attr_reader :lineno
15
+ attr_reader :filename
16
+ attr_accessor :state
17
17
 
18
- def scan_setup(str)
19
- @ss = StringScanner.new(str)
20
- @lineno = 1
21
- @state = nil
22
- end
18
+ def scan_setup(str)
19
+ @ss = StringScanner.new(str)
20
+ @lineno = 1
21
+ @state = nil
22
+ end
23
23
 
24
- def action
25
- yield
26
- end
24
+ def action
25
+ yield
26
+ end
27
27
 
28
- def scan_str(str)
29
- scan_setup(str)
30
- do_parse
31
- end
32
- alias :scan :scan_str
28
+ def scan_str(str)
29
+ scan_setup(str)
30
+ do_parse
31
+ end
32
+ alias :scan :scan_str
33
33
 
34
- def load_file( filename )
35
- @filename = filename
36
- open(filename, "r") do |f|
37
- scan_setup(f.read)
38
- end
39
- end
34
+ def load_file( filename )
35
+ @filename = filename
36
+ File.open(filename, "r") do |f|
37
+ scan_setup(f.read)
38
+ end
39
+ end
40
40
 
41
- def scan_file( filename )
42
- load_file(filename)
43
- do_parse
44
- end
41
+ def scan_file( filename )
42
+ load_file(filename)
43
+ do_parse
44
+ end
45
45
 
46
46
 
47
- def next_token
48
- return if @ss.eos?
49
-
50
- # skips empty actions
51
- until token = _next_token or @ss.eos?; end
52
- token
53
- end
47
+ def next_token
48
+ return if @ss.eos?
54
49
 
55
- def _next_token
56
- text = @ss.peek(1)
57
- @lineno += 1 if text == "\n"
58
- token = case @state
59
- when nil
60
- case
61
- when (text = @ss.scan(/has\([\s]*/))
62
- action { [:HAS, text] }
50
+ # skips empty actions
51
+ until token = _next_token or @ss.eos?; end
52
+ token
53
+ end
63
54
 
64
- when (text = @ss.scan(/[-@]?([_A-Za-z]|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])([_A-Za-z0-9-]|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])*\([\s]*/))
65
- action { [:FUNCTION, text] }
55
+ def _next_token
56
+ text = @ss.peek(1)
57
+ @lineno += 1 if text == "\n"
58
+ token = case @state
59
+ when nil
60
+ case
61
+ when (text = @ss.scan(/has\([\s]*/))
62
+ action { [:HAS, text] }
66
63
 
67
- when (text = @ss.scan(/[-@]?([_A-Za-z]|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])([_A-Za-z0-9-]|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])*/))
68
- action { [:IDENT, text] }
64
+ when (text = @ss.scan(/[-@]?([_A-Za-z]|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])([_A-Za-z0-9-]|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])*\([\s]*/))
65
+ action { [:FUNCTION, text] }
69
66
 
70
- when (text = @ss.scan(/\#([_A-Za-z0-9-]|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])+/))
71
- action { [:HASH, text] }
67
+ when (text = @ss.scan(/[-@]?([_A-Za-z]|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])([_A-Za-z0-9-]|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])*/))
68
+ action { [:IDENT, text] }
72
69
 
73
- when (text = @ss.scan(/[\s]*~=[\s]*/))
74
- action { [:INCLUDES, text] }
70
+ when (text = @ss.scan(/\#([_A-Za-z0-9-]|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])+/))
71
+ action { [:HASH, text] }
75
72
 
76
- when (text = @ss.scan(/[\s]*\|=[\s]*/))
77
- action { [:DASHMATCH, text] }
73
+ when (text = @ss.scan(/[\s]*~=[\s]*/))
74
+ action { [:INCLUDES, text] }
78
75
 
79
- when (text = @ss.scan(/[\s]*\^=[\s]*/))
80
- action { [:PREFIXMATCH, text] }
76
+ when (text = @ss.scan(/[\s]*\|=[\s]*/))
77
+ action { [:DASHMATCH, text] }
81
78
 
82
- when (text = @ss.scan(/[\s]*\$=[\s]*/))
83
- action { [:SUFFIXMATCH, text] }
79
+ when (text = @ss.scan(/[\s]*\^=[\s]*/))
80
+ action { [:PREFIXMATCH, text] }
84
81
 
85
- when (text = @ss.scan(/[\s]*\*=[\s]*/))
86
- action { [:SUBSTRINGMATCH, text] }
82
+ when (text = @ss.scan(/[\s]*\$=[\s]*/))
83
+ action { [:SUFFIXMATCH, text] }
87
84
 
88
- when (text = @ss.scan(/[\s]*!=[\s]*/))
89
- action { [:NOT_EQUAL, text] }
85
+ when (text = @ss.scan(/[\s]*\*=[\s]*/))
86
+ action { [:SUBSTRINGMATCH, text] }
90
87
 
91
- when (text = @ss.scan(/[\s]*=[\s]*/))
92
- action { [:EQUAL, text] }
88
+ when (text = @ss.scan(/[\s]*!=[\s]*/))
89
+ action { [:NOT_EQUAL, text] }
93
90
 
94
- when (text = @ss.scan(/[\s]*\)/))
95
- action { [:RPAREN, text] }
91
+ when (text = @ss.scan(/[\s]*=[\s]*/))
92
+ action { [:EQUAL, text] }
96
93
 
97
- when (text = @ss.scan(/\[[\s]*/))
98
- action { [:LSQUARE, text] }
94
+ when (text = @ss.scan(/[\s]*\)/))
95
+ action { [:RPAREN, text] }
99
96
 
100
- when (text = @ss.scan(/[\s]*\]/))
101
- action { [:RSQUARE, text] }
97
+ when (text = @ss.scan(/\[[\s]*/))
98
+ action { [:LSQUARE, text] }
102
99
 
103
- when (text = @ss.scan(/[\s]*\+[\s]*/))
104
- action { [:PLUS, text] }
100
+ when (text = @ss.scan(/[\s]*\]/))
101
+ action { [:RSQUARE, text] }
105
102
 
106
- when (text = @ss.scan(/[\s]*>[\s]*/))
107
- action { [:GREATER, text] }
103
+ when (text = @ss.scan(/[\s]*\+[\s]*/))
104
+ action { [:PLUS, text] }
108
105
 
109
- when (text = @ss.scan(/[\s]*,[\s]*/))
110
- action { [:COMMA, text] }
106
+ when (text = @ss.scan(/[\s]*>[\s]*/))
107
+ action { [:GREATER, text] }
111
108
 
112
- when (text = @ss.scan(/[\s]*~[\s]*/))
113
- action { [:TILDE, text] }
109
+ when (text = @ss.scan(/[\s]*,[\s]*/))
110
+ action { [:COMMA, text] }
114
111
 
115
- when (text = @ss.scan(/\:not\([\s]*/))
116
- action { [:NOT, text] }
112
+ when (text = @ss.scan(/[\s]*~[\s]*/))
113
+ action { [:TILDE, text] }
117
114
 
118
- when (text = @ss.scan(/-?([0-9]+|[0-9]*\.[0-9]+)/))
119
- action { [:NUMBER, text] }
115
+ when (text = @ss.scan(/\:not\([\s]*/))
116
+ action { [:NOT, text] }
120
117
 
121
- when (text = @ss.scan(/[\s]*\/\/[\s]*/))
122
- action { [:DOUBLESLASH, text] }
118
+ when (text = @ss.scan(/-?([0-9]+|[0-9]*\.[0-9]+)/))
119
+ action { [:NUMBER, text] }
123
120
 
124
- when (text = @ss.scan(/[\s]*\/[\s]*/))
125
- action { [:SLASH, text] }
121
+ when (text = @ss.scan(/[\s]*\/\/[\s]*/))
122
+ action { [:DOUBLESLASH, text] }
126
123
 
127
- when (text = @ss.scan(/U\+[0-9a-f?]{1,6}(-[0-9a-f]{1,6})?/))
128
- action {[:UNICODE_RANGE, text] }
124
+ when (text = @ss.scan(/[\s]*\/[\s]*/))
125
+ action { [:SLASH, text] }
129
126
 
130
- when (text = @ss.scan(/[\s]+/))
131
- action { [:S, text] }
127
+ when (text = @ss.scan(/U\+[0-9a-f?]{1,6}(-[0-9a-f]{1,6})?/))
128
+ action {[:UNICODE_RANGE, text] }
132
129
 
133
- when (text = @ss.scan(/"([^\n\r\f"]|\n|\r\n|\r|\f|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])*(?<!\\)(?:\\{2})*"|'([^\n\r\f']|\n|\r\n|\r|\f|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])*(?<!\\)(?:\\{2})*'/))
134
- action { [:STRING, text] }
130
+ when (text = @ss.scan(/[\s]+/))
131
+ action { [:S, text] }
135
132
 
136
- when (text = @ss.scan(/./))
137
- action { [text, text] }
133
+ when (text = @ss.scan(/"([^\n\r\f"]|\n|\r\n|\r|\f|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])*(?<!\\)(?:\\{2})*"|'([^\n\r\f']|\n|\r\n|\r|\f|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])*(?<!\\)(?:\\{2})*'/))
134
+ action { [:STRING, text] }
138
135
 
139
- else
140
- text = @ss.string[@ss.pos .. -1]
141
- raise ScanError, "can not match: '" + text + "'"
142
- end # if
136
+ when (text = @ss.scan(/./))
137
+ action { [text, text] }
143
138
 
144
- else
145
- raise ScanError, "undefined state: '" + state.to_s + "'"
146
- end # case state
147
- token
148
- end # def _next_token
139
+
140
+ else
141
+ text = @ss.string[@ss.pos .. -1]
142
+ raise ScanError, "can not match: '" + text + "'"
143
+ end # if
144
+
145
+ else
146
+ raise ScanError, "undefined state: '" + state.to_s + "'"
147
+ end # case state
148
+ token
149
+ end # def _next_token
149
150
 
150
151
  end # class
151
152
  end
@@ -1,6 +1,6 @@
1
1
  module Nokogiri
2
2
  # The version of Nokogiri you are using
3
- VERSION = "1.10.3"
3
+ VERSION = "1.10.4"
4
4
 
5
5
  class VersionInfo # :nodoc:
6
6
  def jruby?
@@ -213,7 +213,7 @@ module Nokogiri
213
213
  # xml.foo
214
214
  # end
215
215
  # end
216
- #
216
+ #
217
217
  # puts builder.to_xml
218
218
  #
219
219
  # Will output this xml:
@@ -250,7 +250,7 @@ module Nokogiri
250
250
  # xml.awesome # add the "awesome" tag below "some_tag"
251
251
  # end
252
252
  #
253
- def self.with root, &block
253
+ def self.with(root, &block)
254
254
  new({}, root, &block)
255
255
  end
256
256
 
@@ -263,23 +263,25 @@ module Nokogiri
263
263
  # Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|
264
264
  # ...
265
265
  # end
266
- def initialize options = {}, root = nil, &block
267
-
266
+ def initialize(options = {}, root = nil, &block)
268
267
  if root
269
- @doc = root.document
268
+ @doc = root.document
270
269
  @parent = root
271
270
  else
272
- namespace = self.class.name.split('::')
273
- namespace[-1] = 'Document'
274
- @doc = eval(namespace.join('::')).new
275
- @parent = @doc
271
+ klassname = "::" + (self.class.name.split("::")[0..-2] + ["Document"]).join("::")
272
+ klass = begin
273
+ Object.const_get(klassname)
274
+ rescue NameError
275
+ Nokogiri::XML::Document
276
+ end
277
+ @parent = @doc = klass.new
276
278
  end
277
279
 
278
- @context = nil
279
- @arity = nil
280
- @ns = nil
280
+ @context = nil
281
+ @arity = nil
282
+ @ns = nil
281
283
 
282
- options.each do |k,v|
284
+ options.each do |k, v|
283
285
  @doc.send(:"#{k}=", v)
284
286
  end
285
287
 
@@ -287,7 +289,7 @@ module Nokogiri
287
289
 
288
290
  @arity = block.arity
289
291
  if @arity <= 0
290
- @context = eval('self', block.binding)
292
+ @context = eval("self", block.binding)
291
293
  instance_eval(&block)
292
294
  else
293
295
  yield self
@@ -298,26 +300,26 @@ module Nokogiri
298
300
 
299
301
  ###
300
302
  # Create a Text Node with content of +string+
301
- def text string
303
+ def text(string)
302
304
  insert @doc.create_text_node(string)
303
305
  end
304
306
 
305
307
  ###
306
308
  # Create a CDATA Node with content of +string+
307
- def cdata string
309
+ def cdata(string)
308
310
  insert doc.create_cdata(string)
309
311
  end
310
312
 
311
313
  ###
312
314
  # Create a Comment Node with content of +string+
313
- def comment string
315
+ def comment(string)
314
316
  insert doc.create_comment(string)
315
317
  end
316
318
 
317
319
  ###
318
320
  # Build a tag that is associated with namespace +ns+. Raises an
319
321
  # ArgumentError if +ns+ has not been defined higher in the tree.
320
- def [] ns
322
+ def [](ns)
321
323
  if @parent != @doc
322
324
  @ns = @parent.namespace_definitions.find { |x| x.prefix == ns.to_s }
323
325
  end
@@ -348,15 +350,15 @@ module Nokogiri
348
350
 
349
351
  ###
350
352
  # Append the given raw XML +string+ to the document
351
- def << string
353
+ def <<(string)
352
354
  @doc.fragment(string).children.each { |x| insert(x) }
353
355
  end
354
356
 
355
- def method_missing method, *args, &block # :nodoc:
357
+ def method_missing(method, *args, &block) # :nodoc:
356
358
  if @context && @context.respond_to?(method)
357
359
  @context.send(method, *args, &block)
358
360
  else
359
- node = @doc.create_element(method.to_s.sub(/[_!]$/, ''),*args) { |n|
361
+ node = @doc.create_element(method.to_s.sub(/[_!]$/, ""), *args) { |n|
360
362
  # Set up the namespace
361
363
  if @ns.is_a? Nokogiri::XML::Namespace
362
364
  n.namespace = @ns
@@ -377,13 +379,14 @@ module Nokogiri
377
379
  end
378
380
 
379
381
  private
382
+
380
383
  ###
381
384
  # Insert +node+ as a child of the current Node
382
385
  def insert(node, &block)
383
386
  node = @parent.add_child(node)
384
387
  if block_given?
385
388
  old_parent = @parent
386
- @parent = node
389
+ @parent = node
387
390
  @arity ||= block.arity
388
391
  if @arity <= 0
389
392
  instance_eval(&block)
@@ -396,16 +399,16 @@ module Nokogiri
396
399
  end
397
400
 
398
401
  class NodeBuilder # :nodoc:
399
- def initialize node, doc_builder
402
+ def initialize(node, doc_builder)
400
403
  @node = node
401
404
  @doc_builder = doc_builder
402
405
  end
403
406
 
404
- def []= k, v
407
+ def []=(k, v)
405
408
  @node[k] = v
406
409
  end
407
410
 
408
- def [] k
411
+ def [](k)
409
412
  @node[k]
410
413
  end
411
414
 
@@ -413,19 +416,19 @@ module Nokogiri
413
416
  opts = args.last.is_a?(Hash) ? args.pop : {}
414
417
  case method.to_s
415
418
  when /^(.*)!$/
416
- @node['id'] = $1
419
+ @node["id"] = $1
417
420
  @node.content = args.first if args.first
418
421
  when /^(.*)=/
419
422
  @node[$1] = args.first
420
423
  else
421
- @node['class'] =
422
- ((@node['class'] || '').split(/\s/) + [method.to_s]).join(' ')
424
+ @node["class"] =
425
+ ((@node["class"] || "").split(/\s/) + [method.to_s]).join(" ")
423
426
  @node.content = args.first if args.first
424
427
  end
425
428
 
426
429
  # Assign any extra options
427
- opts.each do |k,v|
428
- @node[k.to_s] = ((@node[k.to_s] || '').split(/\s/) + [v]).join(' ')
430
+ opts.each do |k, v|
431
+ @node[k.to_s] = ((@node[k.to_s] || "").split(/\s/) + [v]).join(" ")
429
432
  end
430
433
 
431
434
  if block_given?
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.10.3
4
+ version: 1.10.4
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Aaron Patterson
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2019-04-22 00:00:00.000000000 Z
17
+ date: 2019-08-11 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: mini_portile2
@@ -184,6 +184,20 @@ dependencies:
184
184
  - - "~>"
185
185
  - !ruby/object:Gem::Version
186
186
  version: 1.0.5
187
+ - !ruby/object:Gem::Dependency
188
+ name: rubocop
189
+ requirement: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - "~>"
192
+ - !ruby/object:Gem::Version
193
+ version: '0.73'
194
+ type: :development
195
+ prerelease: false
196
+ version_requirements: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - "~>"
199
+ - !ruby/object:Gem::Version
200
+ version: '0.73'
187
201
  - !ruby/object:Gem::Dependency
188
202
  name: simplecov
189
203
  requirement: !ruby/object:Gem::Requirement
@@ -224,14 +238,14 @@ dependencies:
224
238
  requirements:
225
239
  - - "~>"
226
240
  - !ruby/object:Gem::Version
227
- version: '3.17'
241
+ version: '3.18'
228
242
  type: :development
229
243
  prerelease: false
230
244
  version_requirements: !ruby/object:Gem::Requirement
231
245
  requirements:
232
246
  - - "~>"
233
247
  - !ruby/object:Gem::Version
234
- version: '3.17'
248
+ version: '3.18'
235
249
  description: |-
236
250
  Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser. Among
237
251
  Nokogiri's many features is the ability to search documents via XPath
@@ -460,7 +474,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
460
474
  version: '0'
461
475
  requirements: []
462
476
  rubyforge_project:
463
- rubygems_version: 2.7.8
477
+ rubygems_version: 2.7.9
464
478
  signing_key:
465
479
  specification_version: 4
466
480
  summary: Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser