nokogiri 1.6.2.rc2-x86-mingw32 → 1.6.2.rc3-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
  SHA1:
3
- metadata.gz: f700fa686295e7402887e83be2ab219387028112
4
- data.tar.gz: 37249fa84088c7c88c10615c547207acc7543a14
3
+ metadata.gz: 9e8e335502d656a1a706a918e9e86b54e4b8748b
4
+ data.tar.gz: baa9e373d52787c20920d2401e44dcf0534a8ffd
5
5
  SHA512:
6
- metadata.gz: 27323997da402024e20785ca0026c7f3571995e090bf6807f055a47c22d7bf6330c79221e4ee452eba0de5ff1278348eb7626ab83b81f944a728f48d8b1150b7
7
- data.tar.gz: 06a9d0cfb3902345672a20b5ed21a7db0b5d6da361a5efc739502e35045bb98f3dd9ad7de2336ecfc120d52e93a5d1f861781a3d087dde593c6d675822efa98f
6
+ metadata.gz: 75e8c35de4edfbb18bdbf9ea7fce1b8bb53c51c77f9bd2f052373ad1f513400f719fa0b6cdf296f6529cc5144f3e6d0efe59713c63a18d8de166436cd84839da
7
+ data.tar.gz: 75fd14c75100ad5a9cccde184cbf68a4e71e42ba2c8aec904815094ea5e7dd30ce1b72635b998e654c9760a4c2529d4b17498ac60487d1eb016543afa829a6cc
@@ -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
@@ -39,15 +41,22 @@
39
41
  (Thanks, Yamagishi Kazutoshi!)
40
42
  * Don't call pkg_config when using bundled libraries in extconf.rb
41
43
  #931 (Thanks, Shota Fukumori!)
42
- * Nokogiri.parse() does not mistake a non-HTML document like a RSS
43
- document as HTML document. #932 (Thanks, Yamagishi Kazutoshi!)
44
+ * Nokogiri.parse() does not mistake a non-HTML document like a RSS document as HTML document. #932 (Thanks, Yamagishi Kazutoshi!)
45
+ * (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
46
  * (JRuby) XSD validation crashes in Java version. #373
45
47
  * (JRuby) Document already has a root node error while using Builder. #646
46
48
  * (JRuby) c14n tests are all passing on JRuby. #226
47
49
  * Parsing empty documents raise SyntaxError in strict mode. #1005
48
50
  * (JRuby) Make xpath faster by caching the xpath context. #741
49
51
  * (JRuby) XML SAX push parser leaks memory on JRuby, but not on MRI. #998
50
-
52
+ * (JRUby) Inconsistent behavior aliasing the default namespace. #940
53
+ * (JRuby) Inconsistent behavior between parsing and adding namespaces. #943
54
+ * (JRuby) Xpath returns inconsistent result set on cloned document with
55
+ namespaces and attributes. #1034
56
+ * (JRuby) Java-Implementation forgets element namespaces #902
57
+ * (JRuby) JRuby-Nokogiri does not recognise attributes inside namespaces #1081
58
+ * (JRuby) JRuby-Nokogiri has different comment node name #1080
59
+ * (JRuby) JAXPExtensionsProvider / Java 7 / Secure Processing #1070
51
60
 
52
61
  === 1.6.1 / 2013-12-14
53
62
 
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
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: x86-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
@@ -453,10 +453,12 @@ files:
453
453
  - test/html/test_node.rb
454
454
  - test/html/test_node_encoding.rb
455
455
  - test/namespaces/test_additional_namespaces_in_builder_doc.rb
456
+ - test/namespaces/test_namespaces_aliased_default.rb
456
457
  - test/namespaces/test_namespaces_in_builder_doc.rb
457
458
  - test/namespaces/test_namespaces_in_cloned_doc.rb
458
459
  - test/namespaces/test_namespaces_in_created_doc.rb
459
460
  - test/namespaces/test_namespaces_in_parsed_doc.rb
461
+ - test/namespaces/test_namespaces_preservation.rb
460
462
  - test/test_convert_xpath.rb
461
463
  - test/test_css_cache.rb
462
464
  - test/test_encoding_handler.rb
@@ -594,7 +596,9 @@ test_files:
594
596
  - test/css/test_xpath_visitor.rb
595
597
  - test/test_encoding_handler.rb
596
598
  - test/namespaces/test_namespaces_in_parsed_doc.rb
599
+ - test/namespaces/test_namespaces_aliased_default.rb
597
600
  - test/namespaces/test_namespaces_in_cloned_doc.rb
601
+ - test/namespaces/test_namespaces_preservation.rb
598
602
  - test/namespaces/test_namespaces_in_created_doc.rb
599
603
  - test/namespaces/test_additional_namespaces_in_builder_doc.rb
600
604
  - test/namespaces/test_namespaces_in_builder_doc.rb