nokogiri 1.6.2.rc2-x64-mingw32 → 1.6.2.rc3-x64-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
  SHA1:
3
- metadata.gz: de101b84c4208bdda19e3f40b47de1f352cdfd97
4
- data.tar.gz: b9a9d52af790ee572cd3f584afcfd99add72790e
3
+ metadata.gz: 30e872b65fe9992c8eebd403e74898e541e67a28
4
+ data.tar.gz: 434d4ccf6fbe2f67185c0d6eb17f38017da8fd96
5
5
  SHA512:
6
- metadata.gz: 03d17858687adca2480eb39cb374cf6c4cb0522368f6b447cb4b59ae72b6f50a793ddcf67168bc2f7094b916b43e5cf389869c3f4f60d0cf92893b1b6d6c4108
7
- data.tar.gz: 2dabdbfd6ec6f7629f35ae577ea1f0c2027c9d784a835bc147d0728edbbece9efa8cb77cc3603ff8eaaf304d0b761c7a08e11954e1923b5700ee66aa96ecdced
6
+ metadata.gz: d07334a8cd5aabd8860c3ca3dbe8f1e98c4bda917ca0911fdc24a54e2e057a02bb8119a6f20aeb1280a31aab3a6a7751e9aa75a5dfbfb737dfc00657e6e8744e
7
+ data.tar.gz: 7a7aca6ac0cb4bb4360e087d1eb57a8497fdba298306f4f43f7bf179e7ff69046b2565c2468e88db6fcbfe978c2713b0236e35de0da73f7f7a7d91556f1b54c8
@@ -14,6 +14,8 @@ jdk:
14
14
  matrix:
15
15
  allow_failures:
16
16
  - rvm: rbx-19mode
17
+ # currently broken on Travis CI
18
+ - rvm: jruby-20mode
17
19
  exclude:
18
20
  - rvm: 1.9.3
19
21
  jdk: openjdk7
@@ -10,6 +10,7 @@
10
10
  and add support for native builds on Windows. #864, #989, #1072
11
11
  * (MRI) iconvが Windows-31J をサポートしていない場合は CP932 のエイリアスとして扱うようにした #836
12
12
  * (MRI) 同梱ライブラリを静的にリンクするようになった (静的リンクをオフにするにはextconf.rbに --disable-static を渡す) #923
13
+ * (MRI) CRubyのバグ #9760 に起因するライブラリパス(LIBPATH)の優先順位問題に対応した
13
14
  * (MRI) 同梱ライブラリのビルド後に不要になったディレクトリ群を自動的に削除するようになった (デバッグ等の目的で残すようにするにはextconf.rbに --disable-clean を渡す) #952
14
15
  * (MRI) FreeBSDなど、libiconvがシステム標準ディレクトリ外にある環境でlibxml2がiconvサポート付きで正しくビルドされるようになった
15
16
  * nthセレクタにおいてan-bを認識するようになった #886 (Magnus Bergmarkに感謝!)
@@ -27,13 +28,20 @@
27
28
  * :only-child疑似クラスが:not疑似クラスの中にある場合に正常な動作が行われるようになった #858 (Yamagishi Kazutoshiに感謝!)
28
29
  * 同梱のライブラリを使う場合にはextconf.rbでpkg_configを呼ばなくなった #931 (Shota Fukumoriに感謝!)
29
30
  * Nokogiri.parse()がRSS文書などをHTML文書として誤認する問題を修正 #932 (Yamagishi Kazutoshiに感謝!)
31
+ * (MRI) ノードに対して子ノードを追加する際、ノードタイプをチェックするようにした。従来はテキストノードに別のテキストノードを追加する操作によりSEGVが発生していた。 #1092
30
32
  * (JRuby) XSD validation crashes in Java version. #373
31
33
  * (JRuby) Document already has a root node error while using Builder. #646
32
34
  * (JRuby) c14n tests are all passing on JRuby. #226
33
35
  * Parsing empty documents raise SyntaxError in strict mode. #1005
34
36
  * (JRuby) Make xpath faster by caching the xpath context. #741
35
37
  * (JRuby) XML SAX push parser leaks memory on JRuby, but not on MRI. #998
36
-
38
+ * (JRUby) JRubyによるディフォルトネームスペースエイリアスの振る舞いがCRubyと同じではない。#940
39
+ * (JRuby) JRubyによるネームスペースのパースと追加の振る舞いが一致していない。 #943
40
+ * (JRuby) Builderで作ったドキュメントとクローンしたドキュメントではXpathの結果が違う。#1034
41
+ * (JRuby) Javaの実装はネームスペースを忘れることがある。 #902
42
+ * (JRuby) JRuby-Nokogiriはネームスペーススコープ内のアトリビュートを正しく認識しない。#1081
43
+ * (JRuby) JRuby-Nokogiriはコメントノードの名前が違う。#1080
44
+ * (JRuby) JAXPExtensionsProvider / Java 7 / Secure Processingに問題がある。 #1070
37
45
 
38
46
  === 1.6.1 / 2013年12月14日
39
47
 
@@ -11,6 +11,8 @@
11
11
  * (MRI) Alias CP932 to Windows-31J if iconv does not support Windows-31J.
12
12
  * (MRI) Nokogiri now links packaged libraries statically. To
13
13
  disable static linking, pass --disable-static to extconf.rb. #923
14
+ * (MRI) Fix a library path (LIBPATH) precedence problem caused by CRuby
15
+ bug #9760.
14
16
  * (MRI) Nokogiri automatically deletes directories of packaged
15
17
  libraries only used during build. To keep them for debugging
16
18
  purposes, pass --disable-clean to extconf.rb. #952
@@ -41,13 +43,21 @@
41
43
  #931 (Thanks, Shota Fukumori!)
42
44
  * Nokogiri.parse() does not mistake a non-HTML document like a RSS
43
45
  document as HTML document. #932 (Thanks, Yamagishi Kazutoshi!)
46
+ * (MRI) Perform a node type check before adding a child node to another. Previously adding a text node to another as a child could cause a SEGV. #1092
44
47
  * (JRuby) XSD validation crashes in Java version. #373
45
48
  * (JRuby) Document already has a root node error while using Builder. #646
46
49
  * (JRuby) c14n tests are all passing on JRuby. #226
47
50
  * Parsing empty documents raise SyntaxError in strict mode. #1005
48
51
  * (JRuby) Make xpath faster by caching the xpath context. #741
49
52
  * (JRuby) XML SAX push parser leaks memory on JRuby, but not on MRI. #998
50
-
53
+ * (JRUby) Inconsistent behavior aliasing the default namespace. #940
54
+ * (JRuby) Inconsistent behavior between parsing and adding namespaces. #943
55
+ * (JRuby) Xpath returns inconsistent result set on cloned document with
56
+ namespaces and attributes. #1034
57
+ * (JRuby) Java-Implementation forgets element namespaces #902
58
+ * (JRuby) JRuby-Nokogiri does not recognise attributes inside namespaces #1081
59
+ * (JRuby) JRuby-Nokogiri has different comment node name #1080
60
+ * (JRuby) JAXPExtensionsProvider / Java 7 / Secure Processing #1070
51
61
 
52
62
  === 1.6.1 / 2013-12-14
53
63
 
data/Rakefile CHANGED
@@ -110,6 +110,8 @@ HOE = Hoe.spec 'nokogiri' do
110
110
  developer 'Tim Elliott', 'tle@holymonkey.com'
111
111
  developer 'Akinori MUSHA', 'knu@idaemons.org'
112
112
 
113
+ license "MIT"
114
+
113
115
  self.readme_file = ['README', ENV['HLANG'], 'rdoc'].compact.join('.')
114
116
  self.history_file = ['CHANGELOG', ENV['HLANG'], 'rdoc'].compact.join('.')
115
117
 
@@ -157,7 +159,6 @@ HOE = Hoe.spec 'nokogiri' do
157
159
 
158
160
  self.testlib = :minitest
159
161
  end
160
- HOE.spec.licenses = ['MIT']
161
162
 
162
163
  # ----------------------------------------
163
164
 
@@ -51,6 +51,20 @@ ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
51
51
  # https://bugs.ruby-lang.org/issues/8074
52
52
  @libdir_basename = "lib" if RUBY_VERSION < '2.1.0'
53
53
 
54
+ # Workaround for Ruby bug #9760, will be fixed in Ruby 2.2
55
+ class Array
56
+ alias orig_or |
57
+
58
+ def | other
59
+ if self.equal?($DEFLIBPATH) && other.equal?($LIBPATH)
60
+ # Make sure library directories we set take precedence over $(libdir)
61
+ other.orig_or(self)
62
+ else
63
+ self.orig_or(other)
64
+ end
65
+ end
66
+ end if RUBY_VERSION < '2.2.0'
67
+
54
68
  if arg_config('--clean')
55
69
  require 'pathname'
56
70
  require 'fileutils'
@@ -139,7 +139,7 @@ static xmlNodePtr xmlReplaceNodeWrapper(xmlNodePtr pivot, xmlNodePtr new_node)
139
139
  static VALUE reparent_node_with(VALUE pivot_obj, VALUE reparentee_obj, pivot_reparentee_func prf)
140
140
  {
141
141
  VALUE reparented_obj ;
142
- xmlNodePtr reparentee, pivot, reparented, next_text, new_next_text ;
142
+ xmlNodePtr reparentee, pivot, reparented, next_text, new_next_text, parent ;
143
143
 
144
144
  if(!rb_obj_is_kind_of(reparentee_obj, cNokogiriXmlNode))
145
145
  rb_raise(rb_eArgError, "node must be a Nokogiri::XML::Node");
@@ -149,9 +149,71 @@ static VALUE reparent_node_with(VALUE pivot_obj, VALUE reparentee_obj, pivot_rep
149
149
  Data_Get_Struct(reparentee_obj, xmlNode, reparentee);
150
150
  Data_Get_Struct(pivot_obj, xmlNode, pivot);
151
151
 
152
- if(XML_DOCUMENT_NODE == reparentee->type || XML_HTML_DOCUMENT_NODE == reparentee->type)
153
- rb_raise(rb_eArgError, "cannot reparent a document node");
152
+ /*
153
+ * Check if nodes given are appropriate to have a parent-child
154
+ * relationship, based on the DOM specification.
155
+ *
156
+ * cf. http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-1590626202
157
+ */
158
+ if (prf == xmlAddChild) {
159
+ parent = pivot;
160
+ } else {
161
+ parent = pivot->parent;
162
+ }
163
+
164
+ if (parent) {
165
+ switch (parent->type) {
166
+ case XML_DOCUMENT_NODE:
167
+ case XML_HTML_DOCUMENT_NODE:
168
+ switch (reparentee->type) {
169
+ case XML_ELEMENT_NODE:
170
+ case XML_PI_NODE:
171
+ case XML_COMMENT_NODE:
172
+ case XML_DOCUMENT_TYPE_NODE:
173
+ /*
174
+ * The DOM specification says no to adding text-like nodes
175
+ * directly to a document, but we allow it for compatibility.
176
+ */
177
+ case XML_TEXT_NODE:
178
+ case XML_CDATA_SECTION_NODE:
179
+ case XML_ENTITY_REF_NODE:
180
+ goto ok;
181
+ }
182
+ break;
183
+ case XML_DOCUMENT_FRAG_NODE:
184
+ case XML_ENTITY_REF_NODE:
185
+ case XML_ELEMENT_NODE:
186
+ switch (reparentee->type) {
187
+ case XML_ELEMENT_NODE:
188
+ case XML_PI_NODE:
189
+ case XML_COMMENT_NODE:
190
+ case XML_TEXT_NODE:
191
+ case XML_CDATA_SECTION_NODE:
192
+ case XML_ENTITY_REF_NODE:
193
+ goto ok;
194
+ }
195
+ break;
196
+ case XML_ATTRIBUTE_NODE:
197
+ switch (reparentee->type) {
198
+ case XML_TEXT_NODE:
199
+ case XML_ENTITY_REF_NODE:
200
+ goto ok;
201
+ }
202
+ break;
203
+ case XML_TEXT_NODE:
204
+ /*
205
+ * xmlAddChild() breaks the DOM specification in that it allows
206
+ * adding a text node to another, in which case text nodes are
207
+ * coalesced, but since our JRuby version does not support such
208
+ * operation, we should inhibit it.
209
+ */
210
+ break;
211
+ }
212
+
213
+ rb_raise(rb_eArgError, "cannot reparent %s there", rb_obj_classname(reparentee_obj));
214
+ }
154
215
 
216
+ ok:
155
217
  xmlUnlinkNode(reparentee);
156
218
 
157
219
  if (reparentee->doc != pivot->doc || reparentee->type == XML_TEXT_NODE) {
Binary file
Binary file
@@ -36,7 +36,7 @@ module Nokogiri
36
36
  if node.value[1].is_a?(Nokogiri::CSS::Node) and node.value[1].type == :NTH
37
37
  nth(node.value[1], :last => true, :child => true)
38
38
  else
39
- "count(following-sbiling::*) = #{node.value[1].to_i-1}"
39
+ "count(following-sibling::*) = #{node.value[1].to_i-1}"
40
40
  end
41
41
  when /^(first|first-of-type)\(/
42
42
  "position() = 1"
@@ -1,6 +1,6 @@
1
1
  module Nokogiri
2
2
  # The version of Nokogiri you are using
3
- VERSION = '1.6.2.rc2'
3
+ VERSION = '1.6.2.rc3'
4
4
 
5
5
  class VersionInfo # :nodoc:
6
6
  def jruby?
@@ -174,11 +174,11 @@ module Nokogiri
174
174
  end
175
175
 
176
176
  def test_nth_child_selectors
177
- assert_xpath '//a[count(preceding-sibling::*) = 0]', @parser.parse('a:first-child')
178
- assert_xpath '//a[count(preceding-sibling::*) = 98]', @parser.parse('a:nth-child(99)')
179
- assert_xpath '//a[count(following-sibling::*) = 0]', @parser.parse('a:last-child')
180
- assert_xpath '//a[count(following-sbiling::*) = 0]', @parser.parse('a:nth-last-child(1)')
181
- assert_xpath '//a[count(following-sbiling::*) = 98]', @parser.parse('a:nth-last-child(99)')
177
+ assert_xpath '//a[count(preceding-sibling::*) = 0]', @parser.parse('a:first-child')
178
+ assert_xpath '//a[count(preceding-sibling::*) = 98]', @parser.parse('a:nth-child(99)')
179
+ assert_xpath '//a[count(following-sibling::*) = 0]', @parser.parse('a:last-child')
180
+ assert_xpath '//a[count(following-sibling::*) = 0]', @parser.parse('a:nth-last-child(1)')
181
+ assert_xpath '//a[count(following-sibling::*) = 98]', @parser.parse('a:nth-last-child(99)')
182
182
  end
183
183
 
184
184
  def test_miscellaneous_selectors
@@ -164,6 +164,12 @@ module Nokogiri
164
164
  assert_match %r% \n<div>b</div> *%, fragment.to_s
165
165
  end
166
166
 
167
+ def test_html_fragment_with_input_and_intermediate_whitespace
168
+ doc = "<label>Label</label><input type=\"text\"> <span>span</span>"
169
+ fragment = Nokogiri::HTML::Document.new.fragment(doc)
170
+ assert_equal "<label>Label</label><input type=\"text\"> <span>span</span>", fragment.to_s
171
+ end
172
+
167
173
  def test_html_fragment_with_leading_text_and_newline
168
174
  fragment = HTML::Document.new.fragment("First line\nSecond line<br>Broken line")
169
175
  assert_equal fragment.to_s, "First line\nSecond line<br>Broken line"
@@ -0,0 +1,24 @@
1
+ require "helper"
2
+
3
+ module Nokogiri
4
+ module XML
5
+ class TestAliasedDefaultNamespaces < Nokogiri::TestCase
6
+ def setup
7
+ super
8
+ end
9
+
10
+ def test_alised_default_namespace_on_parse
11
+ doc = Nokogiri::XML('<apple xmlns="ns:fruit" xmlns:fruit="ns:fruit" />')
12
+ ns = doc.root.namespaces
13
+ assert_equal "ns:fruit", ns["xmlns:fruit"], "Should have parsed aliased default namespace"
14
+ end
15
+
16
+ def test_add_aliased_default_namespace
17
+ doc = Nokogiri::XML('<apple xmlns="ns:fruit" />')
18
+ doc.root.add_namespace_definition("fruit", "ns:fruit")
19
+ ns = doc.root.namespaces
20
+ assert_equal "ns:fruit", ns["xmlns:fruit"],"Should have added aliased default namespace"
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,31 @@
1
+ require "helper"
2
+
3
+ module Nokogiri
4
+ module XML
5
+ class TestNamespacePreservation < Nokogiri::TestCase
6
+
7
+ def setup
8
+ @xml = Nokogiri.XML <<-eoxml
9
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
10
+ <xs:element xmlns:quer="http://api.geotrust.com/webtrust/query"/>
11
+ <xs:element xmlns:quer="http://api.geotrust.com/webtrust/query"/>
12
+ </xs:schema>
13
+ eoxml
14
+ end
15
+
16
+ def test_xpath
17
+ first = @xml.at_xpath('//xs:element', 'xs' => 'http://www.w3.org/2001/XMLSchema')
18
+ last = @xml.at_xpath('//xs:element[last()]', 'xs' => 'http://www.w3.org/2001/XMLSchema')
19
+ assert_equal 'http://api.geotrust.com/webtrust/query' , first.namespaces['xmlns:quer'], "Should contain quer namespace"
20
+ assert_equal 'http://api.geotrust.com/webtrust/query' , last.namespaces['xmlns:quer'], "Should contain quer namespace"
21
+ end
22
+
23
+ def test_traversing
24
+ first = @xml.root.element_children.first
25
+ last = @xml.root.element_children.last
26
+ assert_equal 'http://api.geotrust.com/webtrust/query' , first.namespaces['xmlns:quer'], "Should contain quer namespace"
27
+ assert_equal 'http://api.geotrust.com/webtrust/query' , last.namespaces['xmlns:quer'], "Should contain quer namespace"
28
+ end
29
+ end
30
+ end
31
+ end
@@ -40,6 +40,21 @@ module Nokogiri
40
40
  assert_equal('& <foo> &amp;', node.content)
41
41
  assert_equal('&amp; &lt;foo&gt; &amp;amp;', node.to_xml)
42
42
  end
43
+
44
+ def test_add_child
45
+ node = Text.new('foo', Document.new)
46
+ if Nokogiri.jruby?
47
+ exc = RuntimeError
48
+ else
49
+ exc = ArgumentError
50
+ end
51
+ assert_raises(exc) {
52
+ node.add_child Text.new('bar', Document.new)
53
+ }
54
+ assert_raises(exc) {
55
+ node << Text.new('bar', Document.new)
56
+ }
57
+ end
43
58
  end
44
59
  end
45
60
  end
data/test_all CHANGED
@@ -10,7 +10,7 @@
10
10
  # (e.g., 1.9.3's glob_helper). ["rake test:valgrind:suppression"]
11
11
  #
12
12
 
13
- RUBIES="ruby-1.9.3-p327 jruby-1.7.3 jruby-1.6.5.1 jruby-1.6.7.2 ruby-1.9.2-p320"
13
+ RUBIES="ruby-1.9.3 ruby-1.9.2 ruby-2.0 ruby-2.1 jruby-1.7"
14
14
  TEST_LOG=test.log
15
15
  VALGRIND_LOG=valgrind.log
16
16
 
@@ -34,7 +34,7 @@ function rvm_use {
34
34
 
35
35
  function generate_parser_and_tokenizer {
36
36
  old_ruby=$current_ruby
37
- rvm_use ruby-1.9.3-p327
37
+ rvm_use ruby-1.9.3
38
38
  bundle exec rake generate 2>&1 > /dev/null
39
39
  rvm_use $old_ruby
40
40
  }
@@ -51,7 +51,7 @@ function compile {
51
51
 
52
52
  for ruby in $RUBIES ; do
53
53
  rvm_use ${ruby}
54
- if ! which bundle ; then
54
+ if ! [[ $(bundle -v) =~ "1.6." ]] ; then
55
55
  gem install bundler
56
56
  fi
57
57
  bundle install --quiet --local || bundle install
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.6.2.rc2
4
+ version: 1.6.2.rc3
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Aaron Patterson
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2014-04-10 00:00:00.000000000 Z
15
+ date: 2014-05-09 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: mini_portile
@@ -452,10 +452,12 @@ files:
452
452
  - test/html/test_node.rb
453
453
  - test/html/test_node_encoding.rb
454
454
  - test/namespaces/test_additional_namespaces_in_builder_doc.rb
455
+ - test/namespaces/test_namespaces_aliased_default.rb
455
456
  - test/namespaces/test_namespaces_in_builder_doc.rb
456
457
  - test/namespaces/test_namespaces_in_cloned_doc.rb
457
458
  - test/namespaces/test_namespaces_in_created_doc.rb
458
459
  - test/namespaces/test_namespaces_in_parsed_doc.rb
460
+ - test/namespaces/test_namespaces_preservation.rb
459
461
  - test/test_convert_xpath.rb
460
462
  - test/test_css_cache.rb
461
463
  - test/test_encoding_handler.rb
@@ -593,7 +595,9 @@ test_files:
593
595
  - test/css/test_xpath_visitor.rb
594
596
  - test/test_encoding_handler.rb
595
597
  - test/namespaces/test_namespaces_in_parsed_doc.rb
598
+ - test/namespaces/test_namespaces_aliased_default.rb
596
599
  - test/namespaces/test_namespaces_in_cloned_doc.rb
600
+ - test/namespaces/test_namespaces_preservation.rb
597
601
  - test/namespaces/test_namespaces_in_created_doc.rb
598
602
  - test/namespaces/test_additional_namespaces_in_builder_doc.rb
599
603
  - test/namespaces/test_namespaces_in_builder_doc.rb