nokogiri 1.5.9-x86-mswin32-60 → 1.5.10-x86-mswin32-60

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.

@@ -1,48 +1,62 @@
1
+ === 1.5.10 / 2013年6月7日
1
2
 
2
- === 1.5.9 / 2013年03月21日
3
+ * バグ修正
3
4
 
4
- * Bugfixes
5
+ * (JRuby) Fix "null document" error when parsing an empty IO in jruby 1.7.3. #883
6
+ * (JRuby) Fix schema validation when XSD has DOCTYPE set to DTD. #861 (Thanks, Patrick Cheng!)
7
+ * (MRI) Fix segfault when there is no default subelement for an HTML node. #917
5
8
 
6
- * Ensure that prefixed attributes are properly namespaced when reparented. #869
7
- * Fix for inconsistent namespaced attribute access for SVG nested in HTML. #861
8
- * (MRI) Fixed a memory leak in fragment parsing if nodes are not all subsequently reparented. #856
9
9
 
10
+ * 註
11
+
12
+ * Use rb_ary_entry instead of RARRAY_PTR (you know, for Rubinius). #877 (Thanks, Dirkjan Bussink!)
13
+ * Fix TypeError when running tests. #900 (Thanks, Cédric Boutillier!)
14
+
15
+
16
+ === 1.5.9 / 2013年3月21日
10
17
 
11
- === 1.5.8 / 2013年03月19日
18
+ * バグ修正
12
19
 
13
- * Bugfixes
20
+ * prefixed attributes を持つ要素が親を付け替えられたとき名前空間を適切に扱う #869
21
+ * ネストされた HTML のなかの SVG 要素が持つ名前空間つき属性を参照したときの返り値が一致しないバグを修正 #861
22
+ * (MRI) 部分ノードをパースしたときメモリリークするバグを修正 #856
14
23
 
15
- * (JRuby) Fix EmptyStackException thrown by elements with xlink:href attributes and no base_uri #534, #805. (Thanks, Patrick Quinn and Brian Hoffman!)
16
- * Fixes duplicate attributes issue introduced in 1.5.7. #865
17
- * Allow use of a prefixed namespace on a root node using Nokogiri::XML::Builder #868
18
24
 
25
+ === 1.5.8 / 2013年3月19日
19
26
 
20
- === 1.5.7 / 2013年03月18日
27
+ * バグ修正
21
28
 
22
- * Features
29
+ * (JRuby) xlink:href 属性があり base_uri が無いとき、 EmptyStackException 例外が発生するのを修正 #534, #805. (ありがとう, Patrick Quinn と Brian Hoffman!)
30
+ * 1.5.7 から xmlns 属性が重複するバグを修正 #865
31
+ * Nokogiri::XML::Builder を使って prefixed 名前空間をルートノードに対しても使えるようにした。 #868
23
32
 
24
- * Windows support for Ruby 2.0.
25
33
 
34
+ === 1.5.7 / 2013年3月18日
26
35
 
27
- * Bugfixes
36
+ * 機能
28
37
 
29
- * SAX::Parser.parse_io throw an error when used with lower case encoding. #828
30
- * (JRuby) Java Nokogiri is finally green (passes all tests) under 1.8 and 1.9 mode. High five everyone. #798, #705
31
- * (JRuby) Nokogiri::XML::Reader broken (as a pull parser) on jruby - reads the whole XML document. #831
32
- * (JRuby) JRuby hangs parsing "&". #837
33
- * (JRuby) JRuby NPE parsing an invalid XML instruction. #838
34
- * (JRuby) Node#content= incompatibility. #839
35
- * (JRuby) to_xhtml doesn't print the last slash for self-closing tags in JRuby. #834
36
- * (JRuby) Adding an EntityReference after a Text node mangles the entity in JRuby. #835
37
- * (JRuby) JRuby version inconsistency: nil for empty attributes. #818
38
- * CSS queries for classes (e.g., ".foo") now treat all whitespace identically. #854
39
- * Namespace behavior cleaned up and made consistent between JRuby and MRI. #846, #801 (Thanks, Michael Klein!)
40
- * (MRI) SAX parser handles empty processing instructions. #845
38
+ * Ruby 2.0 Windows 環境をサポート
39
+
40
+
41
+ * バグ修正
42
+
43
+ * エンコーディング名が小文字のとき SAX::Parser.parse_io が例外を投げるようになった。 #828
44
+ * (JRuby) Java Nokogiri はついに 1.8 1.9 両方のモードで全てのテストがグリーンになった!イェーイ! #798, #705
45
+ * (JRuby) Nokogiri::XML::Reader jruby で壊れていたのを修正 (pull parser なのに全ての xml ドキュメントをメモリ上にロードしていた) #831
46
+ * (JRuby) JRuby "&" をパースすると停止してしまう #837
47
+ * (JRuby) JRuby で不正な XML 命令をパースさせると NullPointerException 例外が発生する #838
48
+ * (JRuby) Node#content= JRuby MRI で一致しない #839
49
+ * (JRuby) to_xhtml が自分自身に閉じタグを表すスラッシュを含む要素を正しく表示しない #834
50
+ * (JRuby) テキストノードの後ろに続くエンティティが壊れてしまう (`&` や `;` が消える) #835
51
+ * (JRuby) 空の attributes を参照すると nil が返る #818
52
+ * ".foo" のような CSS クラス名の問い合わせ時に連続した空白を単一とみなす #854
53
+ * 名前空間の扱いが MRI と JRuby の間で統一された #846, #801 (ありがとう, Michael Klein!)
54
+ * (MRI) SAX パーサーが空の xml 命令をパースできるようにする #845
41
55
 
42
56
 
43
57
  === 1.5.6 / 2012年12月19日
44
58
 
45
- * Features
59
+ * 新機能
46
60
 
47
61
  * XML::Document#collect_namespaces メソッドのパフォーマンスを改善した。 #761 (ありがとう、Juergen Mangler!)
48
62
  * SAX::Document#processing_instructionに新しいcallbackが追加 (ありがとう、Kitaiti Makoto!)
@@ -51,41 +65,41 @@
51
65
  * XML::Node#[]= メソッド内で受け取った引数を文字列に変換するようにした。#729 (ありがとう、Ben Langfeld.)
52
66
  * bin/nokogiri コマンドが $stdin からドキュメントを読んで処理できるようにした。
53
67
  * bin/nokogiri -e を指定することでコマンドラインプログラムを実行できるようにした。
54
- * bin/nokogiri --version will print the Xerces and NekoHTML versions when ran with JRuby.
68
+ * (JRuby) bin/nokogiri --version Xerces および NekoHTML のバージョンを表示。
55
69
 
56
70
 
57
- * Bugfixes
71
+ * バグ修正
58
72
 
59
73
  * Nokogiri はこのバージョンからXSLT変換のエラーを検出するようになった。#731 (ありがとう、Justin Fitzsimmons!)
60
- * Don't throw an Error when trying to replace top-level text node in DocumentFragment. #775
74
+ * DocumentFragment のトップレベルノードを置き換えようとした際に Error を出さない。 #775
61
75
  * SAXパーザに不正なエンコーディングに渡された場合はArgumentErrorを投げるようにした。#756 (ありがとう、Bradley Schaefer!)
62
76
  * (JRuby) XML宣言の前にスペースがあると、ドキュメントのパーズに失敗する。(#748の修正でこれもなおっている) #790
63
77
  * (JRuby) Nokogiri::XML::Node#content のJRubyの振る舞いがCRubyと同じではない。#794, #797
64
78
  * (JRuby) で '#' で始まる文字列を名前とする EntityReference を作ろうとすると INVALID_CHARACTER_ERR という例外がはっせいする。 #719
65
79
  * (JRuby) では Nodeのサブクラスのnamespaceを正しく文字列に変換しない。 #715
66
80
  * (JRuby) Node#contentがこのバージョンから改行コードを正しく表示するようになった。#737 (ありがとう、Piotr Szmielew!)
67
- * (JRuby) recover optionが指定されている場合は宣言の無いネームスペースを無視するようにした。#748
68
- * (JRuby) ネームスペースを検出するXPathが続けて実行されても例外を投げてはいけない。#764
81
+ * (JRuby) recover optionが指定されている場合は宣言の無い名前空間を無視するようにした。#748
82
+ * (JRuby) 名前空間を検出するXPathが続けて実行されても例外を投げてはいけない。#764
69
83
  * (JRuby) XMLを表示(出力)する際のホワイトスペースの扱いをlibxml2バージョンとさらに同様になるようにした。#771
70
- * (JRuby) ネームスペース付きの属性を含むXMLドキュメントを文字列でbuilderに追加しようとすると失敗する。#770
84
+ * (JRuby) 名前空間付きの属性を含むXMLドキュメントを文字列でbuilderに追加しようとすると失敗する。#770
71
85
  * (JRuby) Nokogiri::XML::Document#wrapを使って生成したドキュメントに << でノードを追加しようとすると
72
86
  undefined method `length' for nil:NilClassのエラーが発生する #781
73
87
  * (JRuby) 開いているファイルのデスクリプタを閉じようとすると、"bad file descriptor" が発生する。#495
74
- * (JRuby) JRuby/CRuby incompatibility for attribute decorators. #785
75
- * (JRuby) Issues parsing valid XML with no internal subset in the DTD. #547, #811
76
- * (JRuby) Issues parsing valid node content when it contains colons. #728
77
- * (JRuby) Correctly parse the doc type of html documents. #733
78
- * (JRuby) Include dtd in the xml output when a builder is used with create_internal_subset. #751
79
- * (JRuby) builder requires textwrappers for valid utf8 in jruby, not in mri. #784
88
+ * (JRuby) 属性デコレータに関するJRubyCRubyの非互換性 #785
89
+ * (JRuby) DOCTYPE宣言内に内部サブセットを持たない(正しい)XMLをパースする際の問題 #547, #811
90
+ * (JRuby) テキストにコロンを含むノードをパースする際の問題 #728
91
+ * (JRuby) HTML文書のDOCTYPEを正しくパース #733
92
+ * (JRuby) Builder create_internal_subset を使った場合のXML出力にDOCTYPE宣言を含める #751
93
+ * (JRuby) JRubyでのみ、 Builder でUTF-8テキストを #text で括る必要があった #784
80
94
 
81
95
 
82
- === 1.5.5 / 2012年6月24日
96
+ === 1.5.5 / 2012年6月24日
83
97
 
84
- * Features
98
+ * 機能
85
99
 
86
- * Much-improved support for JRuby in 1.9 mode! Yay!
100
+ * JRuby 1.9モードのサポートを大幅改善!イェイ!
87
101
 
88
- * Bugfixes
102
+ * バグ修正
89
103
 
90
104
  * JRuby Nokogiri の add_previous_sibling が以前は動いていたのに今は動かない(1.5.0 -> 1.5.1)。 #691 (ありがとう, John Shahid!)
91
105
  * JRuby バーションは URL が引数にあたえられると HTML ドキュメントを作れない。 #674 (ありがとう, John Shahid!)
@@ -101,16 +115,16 @@
101
115
  * JRuby の Entity 解決は C version の Nokogiri と同じ結果にならないといけない。#704, #647, #703
102
116
 
103
117
 
104
- === 1.5.4 / 2012年6月12日
118
+ === 1.5.4 / 2012年6月12日
105
119
 
106
- * Features
120
+ * 機能
107
121
 
108
122
  * "nokogiri" コマンドに `--rng` オプションが与えられと、より詳しい説明を表示するようになった。 #675 (ありがとう, Dan Radez!)
109
123
  * `-Werror=format-security` CFLAGを使っている hardened な Debian 系 Linux でのビルドをサポート #680.
110
124
  * pkg-config ありのシステム上でのよりよいビルドをサポート。 #584
111
125
  * 複数の iconv がイストールされているシステムでのよりよいビルドをサポート。
112
126
 
113
- * Bugfixes
127
+ * バグ修正
114
128
 
115
129
  * DocumentFragment をベースにしてコメントノードを作ったときに Segmentation fault する。 #677, #678.
116
130
  * at() と search() メソッドで '.' をxpathとして扱う。 #690
@@ -125,37 +139,32 @@
125
139
  ここに、自分ならではの二重否定のジョークをうめこむとなおよし。
126
140
 
127
141
 
128
- === 1.5.3 / 2012年6月1日
142
+ === 1.5.3 / 2012年6月1日
129
143
 
130
- * Features
144
+ * 機能
131
145
 
132
146
  * jQuery のような "prefixless" CSS セレクタ, ~ や >, + をサポート。#621, #623. (ありがとう, David Lee!)
133
- * Attempting to improve installation on homebrew 0.9 (with regards
134
- to iconv). Isn't package management convenient?
147
+ * homebrew 0.9でのインストールを改善してみる。(iconv周り)
148
+ パッケージ管理って便利じゃない?
135
149
 
136
- * Bugfixes
150
+ * バグ修正
137
151
 
138
152
  * カスタム xpath 関数が空の nodeset を引数に含む場合、segfault を起こす。 #634.
139
- * Nokogiri::XML::Node#css now works for XML documents with default
140
- namespaces when the rule contains attribute selector without
141
- namespace.
142
- * Fixed marshalling bugs around how arguments are passed to (and
143
- returned from) XSLT custom xpath functions. #640.
153
+ * Nokogiri::XML::Node#css は、デフォルトの名前空間を持つXML文書に対して名前空間なしの属性セレクタをルールに含めても動作するようになった。
154
+ * Marshalにおいて、XSLTのカスタムXPath関数への引数の渡し方(および戻し方)に関するバグを修正 #640.
144
155
  * Nokogiri::XML::Reader#outer_xml がJRubyで正しく動作しない #617
145
156
  * Nokogiri::XML::Attribute が JRuby 上で nil namespace を返す #647
146
157
  * Nokogiri::XML::Node#namespace= メソッドが JRuby 上で prefix
147
158
   が無い namespace を設定できない #648
148
159
  * (JRuby) 1.9 モードで rake を実行するとデッドロックを引き起こす #571
149
- * HTML::Document#meta_encoding does not raise exception on docs with
150
- malformed content-type. #655
151
- * Fixing segfault related to unsupported encodings in in-context
152
- parsing on 1.8.7. #643
153
- * (JRuby) Concurrency issue in XPath parsing. #682
160
+ * HTML::Document#meta_encoding は誤った Content-Type (charset部)を含む文書で例外を起こさなくなった #655
161
+ * コンテキスト付きフラグメントのパースで非サポートのエンコーディングが原因でRuby 1.8.7がSEGVを起こすのを修正 #643
162
+ * (JRuby) XPathパースにおける並行実行時の問題 #682
154
163
 
155
164
 
156
- === 1.5.2 / 2012-03-09
165
+ === 1.5.2 / 2012年3月9日
157
166
 
158
- Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631, #632.
167
+ 古いRuby用にgemspecを修正しての再パッケージ. #631, #632.
159
168
 
160
169
 
161
170
  === 1.5.1 / 2012年3月9日
@@ -224,7 +233,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
224
233
  * <meta charset="..."> を認識するようになった.
225
234
 
226
235
 
227
- === 1.5.0 beta3 2010年12月2日
236
+ === 1.5.0 beta3 2010年12月2日
228
237
 
229
238
  * 註
230
239
 
@@ -236,14 +245,14 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
236
245
  * Node#inner_textはnilを返さなくなった. (JRuby) #264
237
246
 
238
247
 
239
- === 1.5.0 beta2 2010年7月30日
248
+ === 1.5.0 beta2 2010年7月30日
240
249
 
241
250
  * 註
242
251
 
243
252
  * 1.4.3からの変更点を参照
244
253
 
245
254
 
246
- === 1.5.0 beta1 2010年5月22日
255
+ === 1.5.0 beta1 2010年5月22日
247
256
 
248
257
  * 註
249
258
 
@@ -271,7 +280,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
271
280
  * Rubyの1.8.6のサポートが復元されている
272
281
 
273
282
 
274
- === 1.4.5 / 未リリース
283
+ === 1.4.5 / 2011年5月19日
275
284
 
276
285
  * 新機能
277
286
 
@@ -288,7 +297,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
288
297
  * Document#remove_namespaces! は名前空間付きの属性に対応した. #396
289
298
 
290
299
 
291
- === 1.4.4 2010年11月15日
300
+ === 1.4.4 2010年11月15日
292
301
 
293
302
  * 新機能
294
303
 
@@ -315,7 +324,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
315
324
  * フレグメント内のノードの中にあるNodeSet#wrapの修正 #331
316
325
 
317
326
 
318
- === 1.4.3 2010年7月28日
327
+ === 1.4.3 2010年7月28日
319
328
 
320
329
  * 新しい機能
321
330
 
@@ -339,7 +348,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
339
348
  誤変換されてしまうのを修正
340
349
 
341
350
 
342
- === 1.4.2 2010年5月22日
351
+ === 1.4.2 2010年5月22日
343
352
 
344
353
  * 新機能
345
354
 
@@ -390,7 +399,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
390
399
  2.7.3 と libxslt 1.1.24に標準装備済み。
391
400
 
392
401
 
393
- === 1.4.1 2009年12月10日
402
+ === 1.4.1 2009年12月10日
394
403
 
395
404
  * 新しい機能
396
405
  * Nokogiri::LIBXML_ICONV_ENABLED を追加
@@ -427,7 +436,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
427
436
  解析出来るようになった GH #178
428
437
 
429
438
 
430
- === 1.4.0 2009年10月30日
439
+ === 1.4.0 2009年10月30日
431
440
 
432
441
  * 今日はノコギリの満一歳のお誕生日です
433
442
 
@@ -473,7 +482,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
473
482
  * Hpricot用の互換性レイヤーを削除
474
483
 
475
484
 
476
- === 1.3.3 / 2009年7月26日
485
+ === 1.3.3 / 2009年7月26日
477
486
 
478
487
  * 新しい機能
479
488
 
@@ -495,7 +504,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
495
504
  * Hpricotの互換性レイヤーがNokogiriの1.4.0で除去される予定
496
505
 
497
506
 
498
- === 1.3.2 / 2009年6月22日
507
+ === 1.3.2 / 2009年6月22日
499
508
 
500
509
  * 新しい機能
501
510
 
@@ -521,7 +530,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
521
530
  Nokogiri::XML::SAX::Document#end_element_namespaceを代わりに使用して下さい
522
531
 
523
532
 
524
- === 1.3.1 / 2009年6月7日
533
+ === 1.3.1 / 2009年6月7日
525
534
 
526
535
  * バグの修正
527
536
 
@@ -529,7 +538,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
529
538
  * ドキュメントのノードキャッシュに名前空間のノードが入るようになった
530
539
 
531
540
 
532
- === 1.3.0 / 2009年5月30日
541
+ === 1.3.0 / 2009年5月30日
533
542
 
534
543
  * 新しい機能
535
544
 
@@ -583,7 +592,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
583
592
  修正 (GH#35)
584
593
 
585
594
 
586
- === 1.2.3 / 2009年3月22日
595
+ === 1.2.3 / 2009年3月22日
587
596
 
588
597
  * バグの修正
589
598
 
@@ -595,7 +604,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
595
604
  * ビルダ方法はハッシュを第二引数とする
596
605
 
597
606
 
598
- === 1.2.2 / 2009年3月14日
607
+ === 1.2.2 / 2009年3月14日
599
608
 
600
609
  * 新しい機能
601
610
 
@@ -623,7 +632,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
623
632
  * Document#parent は存在しない (LH #64)
624
633
 
625
634
 
626
- === 1.2.1 / 2009年2月23日
635
+ === 1.2.1 / 2009年2月23日
627
636
 
628
637
  * 修正
629
638
 
@@ -631,7 +640,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
631
640
  * Ruby 1.9 のStringのエンコードを修正 (角谷さんに感謝!)
632
641
 
633
642
 
634
- === 1.2.0 / 2009年2月22日
643
+ === 1.2.0 / 2009年2月22日
635
644
 
636
645
  * 新しい機能
637
646
  * CSSサーチが CSS3 名前空間クエリをサポートするようになった
@@ -769,7 +778,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
769
778
  それによって、ports libxml/ruby が正しくリンクする (lucsky に感謝!)
770
779
 
771
780
 
772
- === 1.0.0 / 2008-07-13
781
+ === 1.0.0 / 20080713
773
782
 
774
783
  * 1つの偉大な増進
775
784
 
@@ -1,3 +1,17 @@
1
+ === 1.5.10 / 2013-06-07
2
+
3
+ * Bugfixes
4
+
5
+ * (JRuby) Fix "null document" error when parsing an empty IO in jruby 1.7.3. #883
6
+ * (JRuby) Fix schema validation when XSD has DOCTYPE set to DTD. #861 (Thanks, Patrick Cheng!)
7
+ * (MRI) Fix segfault when there is no default subelement for an HTML node. #917
8
+
9
+
10
+ * Notes
11
+
12
+ * Use rb_ary_entry instead of RARRAY_PTR (you know, for Rubinius). #877 (Thanks, Dirkjan Bussink!)
13
+ * Fix TypeError when running tests. #900 (Thanks, Cédric Boutillier!)
14
+
1
15
 
2
16
  === 1.5.9 / 2013-03-21
3
17
 
@@ -51,7 +65,7 @@
51
65
  * XML::Node#[]= stringifies values. #729 (Thanks, Ben Langfeld.)
52
66
  * bin/nokogiri will process a document from $stdin
53
67
  * bin/nokogiri -e will execute a program from the command line
54
- * bin/nokogiri --version will print the Xerces and NekoHTML versions when ran with JRuby.
68
+ * (JRuby) bin/nokogiri --version will print the Xerces and NekoHTML versions.
55
69
 
56
70
 
57
71
  * Bugfixes
@@ -86,7 +86,10 @@ static VALUE default_sub_element(VALUE self)
86
86
  htmlElemDesc * description;
87
87
  Data_Get_Struct(self, htmlElemDesc, description);
88
88
 
89
- return NOKOGIRI_STR_NEW2(description->defaultsubelt);
89
+ if (description->defaultsubelt)
90
+ return NOKOGIRI_STR_NEW2(description->defaultsubelt);
91
+
92
+ return Qnil;
90
93
  }
91
94
 
92
95
  /*
@@ -209,7 +209,7 @@ static void * initFunc(xsltTransformContextPtr ctxt, const xmlChar *uri)
209
209
  int i;
210
210
 
211
211
  for(i = 0; i < RARRAY_LEN(methods); i++) {
212
- VALUE method_name = rb_obj_as_string(RARRAY_PTR(methods)[i]);
212
+ VALUE method_name = rb_obj_as_string(rb_ary_entry(methods, i));
213
213
  xsltRegisterExtFunction(ctxt,
214
214
  (unsigned char *)StringValuePtr(method_name), uri, method_caller);
215
215
  }
Binary file
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  module Nokogiri
2
2
  # The version of Nokogiri you are using
3
- VERSION = '1.5.9'
3
+ VERSION = '1.5.10'
4
4
 
5
5
  class VersionInfo # :nodoc:
6
6
  def jruby?
@@ -45,12 +45,13 @@ module Nokogiri
45
45
  # Give the options to the user
46
46
  yield options if block_given?
47
47
 
48
+ return new if empty_doc?(string_or_io)
49
+
48
50
  doc = if string_or_io.respond_to?(:read)
49
51
  url ||= string_or_io.respond_to?(:path) ? string_or_io.path : nil
50
52
  read_io(string_or_io, url, encoding, options.to_i)
51
53
  else
52
54
  # read_memory pukes on empty docs
53
- return new if string_or_io.nil? or string_or_io.empty?
54
55
  read_memory(string_or_io, url, encoding, options.to_i)
55
56
  end
56
57
 
@@ -260,6 +261,12 @@ module Nokogiri
260
261
  end
261
262
 
262
263
  private
264
+ def self.empty_doc? string_or_io
265
+ string_or_io.nil? ||
266
+ (string_or_io.respond_to?(:empty?) && string_or_io.empty?) ||
267
+ (string_or_io.respond_to?(:eof?) && string_or_io.eof?)
268
+ end
269
+
263
270
  def implied_xpath_context
264
271
  "/"
265
272
  end
@@ -917,18 +917,23 @@ module Nokogiri
917
917
  end
918
918
 
919
919
  def coerce data # :nodoc:
920
- return data if data.is_a?(XML::NodeSet)
921
- return data.children if data.is_a?(XML::DocumentFragment)
922
- return fragment(data).children if data.is_a?(String)
920
+ case data
921
+ when XML::NodeSet
922
+ return data
923
+ when XML::DocumentFragment
924
+ return data.children
925
+ when String
926
+ return fragment(data).children
927
+ when Document, XML::Attr
928
+ # unacceptable
929
+ when XML::Node
930
+ return data
931
+ end
923
932
 
924
- if data.is_a?(Document) || data.is_a?(XML::Attr) || !data.is_a?(XML::Node)
925
- raise ArgumentError, <<-EOERR
933
+ raise ArgumentError, <<-EOERR
926
934
  Requires a Node, NodeSet or String argument, and cannot accept a #{data.class}.
927
935
  (You probably want to select a node from the Document with at() or search(), or create a new Node via Node.new().)
928
- EOERR
929
- end
930
-
931
- data
936
+ EOERR
932
937
  end
933
938
 
934
939
  def implied_xpath_context
@@ -23,16 +23,14 @@ module Nokogiri
23
23
  def first n = nil
24
24
  return self[0] unless n
25
25
  list = []
26
- 0.upto(n - 1) do |i|
27
- list << self[i]
28
- end
26
+ n.times { |i| list << self[i] }
29
27
  list
30
28
  end
31
29
 
32
30
  ###
33
31
  # Get the last element of the NodeSet.
34
32
  def last
35
- self[length - 1]
33
+ self[-1]
36
34
  end
37
35
 
38
36
  ###
@@ -17,7 +17,7 @@ module XSD # :nodoc:
17
17
  # gem 'soap4r'
18
18
  # require 'defaultDriver'
19
19
  # require 'xsd/xmlparser/nokogiri'
20
- #
20
+ #
21
21
  # obj = AvlPortType.new
22
22
  # obj.getLatestByRoute(obj.getAgencies.first, 8).each do |bus|
23
23
  # p "#{bus.routeID}, #{bus.longitude}, #{bus.latitude}"
@@ -62,6 +62,13 @@ module XSD # :nodoc:
62
62
  characters string
63
63
  end
64
64
 
65
+ ###
66
+ # Called at the beginning of an element
67
+ # +name+ is the element name
68
+ # +attrs+ is a list of attributes
69
+ # +prefix+ is the namespace prefix for the element
70
+ # +uri+ is the associated namespace URI
71
+ # +ns+ is a hash of namespace prefix:urls associated with the element
65
72
  def start_element_namespace name, attrs = [], prefix = nil, uri = nil, ns = []
66
73
  ###
67
74
  # Deal with SAX v1 interface
@@ -74,6 +81,11 @@ module XSD # :nodoc:
74
81
  start_element name, attributes
75
82
  end
76
83
 
84
+ ###
85
+ # Called at the end of an element
86
+ # +name+ is the element's name
87
+ # +prefix+ is the namespace prefix associated with the element
88
+ # +uri+ is the associated namespace URI
77
89
  def end_element_namespace name, prefix = nil, uri = nil
78
90
  ###
79
91
  # Deal with SAX v1 interface
@@ -69,6 +69,11 @@ module Nokogiri
69
69
  assert_equal 'div', ElementDescription['body'].default_sub_element
70
70
  end
71
71
 
72
+ def test_null_default_sub_element
73
+ doc = Nokogiri::HTML('foo')
74
+ doc.root.description.default_sub_element
75
+ end
76
+
72
77
  def test_optional_attributes
73
78
  attrs = ElementDescription['table'].optional_attributes
74
79
  assert attrs
@@ -47,7 +47,7 @@ module Nokogiri
47
47
  root << txt
48
48
  root << ent
49
49
  d << root
50
- assert_match d.to_html, /&#8217;/
50
+ assert_match /&#8217;/, d.to_html
51
51
  end
52
52
 
53
53
  def test_document_with_initial_space
@@ -580,6 +580,11 @@ module Nokogiri
580
580
  assert set.length > 0
581
581
  end
582
582
 
583
+ def test_parsing_empty_io
584
+ doc = Nokogiri::XML.parse(StringIO.new(''))
585
+ refute_nil doc
586
+ end
587
+
583
588
  def test_search_on_empty_documents
584
589
  doc = Nokogiri::XML::Document.new
585
590
  ns = doc.search('//foo')
@@ -26,7 +26,7 @@ EOF
26
26
  doc = Nokogiri::XML xml
27
27
  lf_node = Nokogiri::XML::EntityReference.new(doc, "#xa")
28
28
  doc.xpath('/item').first.add_child(lf_node)
29
- assert_match doc.to_xml, /&#xa;/
29
+ assert_match /&#xa;/, doc.to_xml
30
30
  end
31
31
  end
32
32
 
@@ -830,7 +830,7 @@ b"></div>
830
830
  ne = d1.root.xpath('//a').first.dup(1)
831
831
  ne.content += "& < & > \" &"
832
832
  d2.root << ne
833
- assert_match d2.to_s, /<a>&amp;&amp; &lt; &amp; &gt; " &amp;<\/a>/
833
+ assert_match /<a>&amp;&amp; &lt; &amp; &gt; " &amp;<\/a>/, d2.to_s
834
834
  end
835
835
 
836
836
  def test_content_after_appending_text
@@ -89,6 +89,15 @@ module Nokogiri
89
89
  assert(@xsd.valid?(valid_doc))
90
90
  assert(!@xsd.valid?(invalid_doc))
91
91
  end
92
+
93
+ def test_xsd_with_dtd
94
+ Dir.chdir(File.join(ASSETS_DIR, 'saml')) do
95
+ # works
96
+ Nokogiri::XML::Schema(IO.read('xmldsig_schema.xsd'))
97
+ # was not working
98
+ Nokogiri::XML::Schema(IO.read('saml20protocol_schema.xsd'))
99
+ end
100
+ end
92
101
  end
93
102
  end
94
103
  end
@@ -63,6 +63,10 @@ EOXSL
63
63
  skip("Pure Java version doesn't support this feature.") if !Nokogiri.uses_libxml?
64
64
  foo = Class.new do
65
65
  include MiniTest::Assertions
66
+ # Minitest 5 uses `self.assertions` in `assert()` which is not
67
+ # defined in the Minitest::Assertions module :-(
68
+ attr_writer :assertions
69
+ def assertions; @assertions ||= 0; end
66
70
 
67
71
  def multiarg *args
68
72
  assert_equal ["abc", "xyz"], args
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokogiri
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 5
9
- - 9
10
- version: 1.5.9
9
+ - 10
10
+ version: 1.5.10
11
11
  platform: x86-mswin32-60
12
12
  authors:
13
13
  - Aaron Patterson
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2013-03-21 00:00:00 Z
21
+ date: 2013-06-07 00:00:00 Z
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
24
  prerelease: false