nokogiri 1.6.0-x86-mingw32 → 1.6.1-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.

@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA512:
3
+ metadata.gz: 319b0905964f71a2d6e5f4bb849c92585ec8b2236eb2b995035a05cf8881857fb2992e13a766b65c20b18ccd8cb45525639b8bfd24c647dca885cde8831a85b8
4
+ data.tar.gz: 0662cd682fb7d7959f691a6f1835bf48d1aca2a6d7af2854dca5ebb8b98225bde141ac249703f7dba0542ac97faa6faab6f60695f27a952cf286c266eb7ef302
5
+ SHA1:
6
+ metadata.gz: ea01d9875034f4d018b736c5410e78e83636c1ae
7
+ data.tar.gz: 8ba77f5e66a3d23feb1fbf045857dce5f9a123df
@@ -1,22 +1,25 @@
1
- === 1.6.1 / 未リリース
1
+ === 1.6.1 / 2013年12月14日
2
2
 
3
- * 機能
3
+ * Bugfixes
4
4
 
5
- * FreeBSDなど、libiconvがシステム標準ディレクトリ外にある環境でlibxml2がiconvサポート付きで正しくビルドされるようになった
5
+ * (JRuby) Fix out of memory bug when certain invalid documents are parsed.
6
+ * (JRuby) Fix regression of billion-laughs vulnerability. #586
6
7
 
7
8
 
8
9
  === 1.6.0 / 2013年6月8日
9
10
 
10
- 本リリースは1.5.10および1.6.0.rc1を元にしているため、両リリースの改善点を含む
11
+ This release was based on v1.5.10 and 1.6.0.rc1, and contains changes
12
+ mentioned in both.
11
13
 
12
14
  * 廃止
13
15
 
14
- * TravisのCI対象からRuby 1.8を外した
16
+ * Remove pre 1.9 monitoring from Travis.
15
17
 
16
18
 
17
19
  === 1.6.0.rc1 / 2013年4月14日
18
20
 
19
- 本リリースは1.5.9を元にしているため、1.5.10の変更点は含まない
21
+ This release was based on v1.5.9, and so does not contain any fixes
22
+ mentioned in the notes for v1.5.10.
20
23
 
21
24
  * 註
22
25
 
@@ -28,7 +31,7 @@
28
31
 
29
32
  * (MRI) libxml 2.8.0 と libxslt 1.2.26 を同梱。
30
33
  環境変数 NOKOGIRI_USE_SYSTEM_LIBRARIES を設定しない限り、 gem のインストール時にコンパイルして使われる。
31
- VERSION_INFO (および `nokogiri -v`) には、同梱の libxml またはシステムの libxml のいずれが使われているかの情報が含まれる
34
+ VERSION_INFO (および `nokogiri -v`) には、同梱の libxml またはシステムの libxml のいずれが使われているかの情報が含まれる。
32
35
  * (Windows) libxml 2.8.0 に更新
33
36
 
34
37
 
@@ -37,6 +40,14 @@
37
40
  * Ruby 1.8.7以下のサポートを終了
38
41
 
39
42
 
43
+ === 1.5.11 / 2013-11-09
44
+
45
+ * Bugfixes
46
+
47
+ * (JRuby) Fix out of memory bug when certain invalid documents are parsed.
48
+ * (JRuby) Fix regression of billion-laughs vulnerability. #568
49
+
50
+
40
51
  === 1.5.10 / 2013年6月7日
41
52
 
42
53
  * バグ修正
@@ -114,7 +125,7 @@
114
125
  * SAXパーザに不正なエンコーディングに渡された場合はArgumentErrorを投げるようにした。#756 (ありがとう、Bradley Schaefer!)
115
126
  * (JRuby) XML宣言の前にスペースがあると、ドキュメントのパーズに失敗する。(#748の修正でこれもなおっている) #790
116
127
  * (JRuby) Nokogiri::XML::Node#content のJRubyの振る舞いがCRubyと同じではない。#794, #797
117
- * (JRuby) で '#' で始まる文字列を名前とする EntityReference を作ろうとすると INVALID_CHARACTER_ERR という例外がはっせいする。 #719
128
+ * (JRuby) で '#' で始まる文字列を名前とする EntityReference を作ろうとすると INVALID_CHARACTER_ERR という例外が発生する。 #719
118
129
  * (JRuby) では Nodeのサブクラスのnamespaceを正しく文字列に変換しない。 #715
119
130
  * (JRuby) Node#contentがこのバージョンから改行コードを正しく表示するようになった。#737 (ありがとう、Piotr Szmielew!)
120
131
  * (JRuby) recover optionが指定されている場合は宣言の無い名前空間を無視するようにした。#748
@@ -147,7 +158,7 @@
147
158
  * JRuby で US-ASCII にエンコードされた文字列が正しくないエンコードを返してくる。 #583
148
159
  * 512 文字以上が与えられたときに XmlSaxPushParser が IndexOutOfBoundsException を投げる。#567, #615
149
160
  * Xpath を評価した結果、空の NodeSet が帰ってくる場合に、NodeSet が持っている Document の decorate に失敗して例外が投げられる。#514
150
- * JRuby で xpath を namespace 付きで指定した場合に、エラーが発生する。pull request #681 (ありがとう, Piotr Szmielew)
161
+ * JRuby で xpath を namespace 付きで指定した場合に、エラーが発生する。pull request #681 (ありがとう, Piotr Szmielew)
151
162
  * JRuby で Nokogiri::XML::Node を継承したクラスを定義すると、namespace が表示されない。 #695
152
163
  * JRuby で RDF::RDFXML::Writer をインスタンス化しようとすると NAMESPACE_ERR (org.w3c.dom.DOMException) が発生する. #683
153
164
  * JRuby で xpath に namespaces を指定すると例外が発生する. #493
@@ -174,7 +185,7 @@
174
185
  パース時にネットワークに接続して外部のドキュメントを見にいかせたい場合には、以下のように `nonoet` オプションを設定する:
175
186
 
176
187
  Nokogiri::XML::Document.parse(xml) { |config| config.nononet }
177
-
188
+
178
189
  ここに、自分ならではの二重否定のジョークをうめこむとなおよし。
179
190
 
180
191
 
@@ -211,45 +222,38 @@
211
222
  * 新機能
212
223
 
213
224
  * XML::Builder#comment はコメントノードを作れるようになった.
214
- * CSS searches now support namespaced attributes. #593
215
- * Java integration 機能が追加された. このバージョンから,
225
+ * CSSセレクター検索が名前空間付き属性に対応 #593
226
+ * Java integration 機能が追加された. このバージョンから,
216
227
  XML::Document.wrap と XML::Document#to_java メソッドが利用可能。
217
- * RelaxNG validator support in the `nokogiri` cli utility. #591 (thanks, Dan Radez!)
228
+ * `nokogiri` CLIユーティリティがRelaxNGバリデーションに対応 #591 (thanks, Dan Radez!)
218
229
 
219
230
  * バグの修正
220
231
 
221
- * エンコーディング自動認識において発生しうるメモリリークを修正.
232
+ * エンコーディング自動認識において発生しうるメモリリークを修正
222
233
  Tim Elliottに感謝!
223
- * homebrew はインストールしたら、extconf は homebrew のパスを読む。
224
- * Inconsistent behavior of Nokogiri 1.5.0 Java #620
225
- * Inheriting from Nokogiri::XML::Node on JRuby (1.6.4/5) fails #560
226
- * XML::Attr nodes are not allowed to be added as node children, so an
227
- exception is raised. #558
228
- * No longer defensively "pickle" adjacent text nodes on
229
- Node#add_next_sibling and Node#add_previous_sibling calls. #595.
230
- * Java version inconsistency: it returns nil for empty attributes #589
231
- * to_xhtml incorrectly generates <p /></p> when tag is empty #557
232
- * Document#add_child now accepts a Node, NodeSet, DocumentFragment,
233
- or String. #546.
234
- * Document#create_element now recognizes namespaces containing
235
- non-word characters (like "SOAP-ENV"). This is mostly relevant to
236
- users of Builder, which calls Document#create_element for nearly
237
- everything. #531.
238
- * File encoding broken in 1.5.0 / jruby / windows #529
239
- * Java version does not return namespace defs as attrs for ::HTML #542
240
- * Bad file descriptor with Nokogiri 1.5.0 #495
241
- * remove_namespace! doesn't work in pure java version #492
242
- * The Nokogiri Java native build throws a null pointer exception when
243
- ActiveSupport's .blank? method is called directly on a parsed object.
244
- #489
245
- * 1.5.0 Not using correct character encoding #488
246
- * Raw XML string in XML Builder broken on JRuby #486
247
- * Nokogiri 1.5.0 XML generation broken on JRuby #484
248
- * Do not allow multiple root nodes. #550
249
- * Fixes for custom XPath functions. #605, #606 (thanks, Juan Wajnerman!)
250
- * Node#to_xml does not override :save_with if it is provided. #505
251
- * Node#set is a private method (JRuby). #564 (thanks, Nick Sieger!)
252
- * C14n cleanup and Node#canonicalize (thanks, Ivan Pirlik!) #563
234
+ * homebrew がインストールされていたら、extconf は homebrew のパスを読む。
235
+ * Java版の一貫性のない挙動 #620
236
+ * JRuby (1.6.4/5) Nokogiri::XML::Node を継承できなかった #560
237
+ * XML::Attr ノードは子ノードとして追加できないので例外を出す #558
238
+ * Node#add_next_sibling Node#add_previous_sibling で隣接テキストノードをdupする条件を緩和 #595
239
+ * Java版の一貫性のない挙動: 空の属性値をnilとして返していた #589
240
+ * to_xhtml が要素が空のときに <p /></p> と誤ったタグを生成していた #557
241
+ * Document#add_child Node, NodeSet, DocumentFragment および
242
+ String を受け付けるようになった #546
243
+ * Document#create_element が("SOAP-ENV"のように)非単語構成文字を含む名前空間を認識するようになった. これは主に Builder を使う際に効いてくる. Builder はほぼすべてのものに Document#create_element を適用するためである #531
244
+ * ファイルエンコーディングが効かなかった (1.5.0 / jruby / windows) #529
245
+ * Java版において、<html>タグに含まれる名前空間定義を属性として返さなかった #542
246
+ * Nokogiri 1.5.0で Bad file descriptor が発生していた #495
247
+ * remove_namespace! がpure Java版で動かなかった #492
248
+ * Javaネイティブ版でパースされたオブジェクトに対して ActiveSupport の .blank? メソッドを呼ぶと null pointer exception が発生していた #489
249
+ * 1.5.0 で正しい文字エンコーディングが仕様されなかった #488
250
+ * XML Builder に生のXML文字列を渡した際の問題 (JRuby) #486
251
+ * Nokogiri 1.5.0でXML生成が壊れていた (JRuby) #484
252
+ * ルートノードを複数持つことを認めない #550
253
+ * カスタムXPath関数を修正 #606 (Juan Wajnermanに感謝!)
254
+ * Node#to_xml :save_with が指定されている場合は上書きしないように修正 #505
255
+ * Node#set をプライベートメソッドに (JRuby) #564 (Nick Siegerに感謝!)
256
+ * C14nの整理と Node#canonicalize (Ivan Pirlikに感謝!) #563
253
257
 
254
258
 
255
259
  === 1.5.0 / 2011年7月1日
@@ -433,7 +437,7 @@
433
437
 
434
438
  * ノート
435
439
 
436
- * 今日4月18日現在、Windows gems は libxml 2.7.7 とlibxslt
440
+ * 今日4月18日現在、Windows gems は libxml 2.7.7 とlibxslt
437
441
  1.1.26にDLLsを標準装備しています。このリリース以前にも既にDLLsはlibxml
438
442
  2.7.3 と libxslt 1.1.24に標準装備済み。
439
443
 
@@ -725,26 +729,26 @@
725
729
 
726
730
  * バグの修正
727
731
 
728
- * HTML のノードを \r のエンティティを含まない
732
+ * HTML のノードに \r のエンティティを含めない
729
733
  * CSS::SelectorHandler と XML::XPathHandler を除去
730
- * XML::Node#attributes が Attr node を value値に返す
731
- * XML::NodeSet が to_xml へ実行
734
+ * XML::Node#attributes が Attr node を値として返す
735
+ * XML::NodeSet が to_xml を実装
732
736
 
733
737
 
734
738
  === 1.1.0
735
739
 
736
740
  * 新しい機能
737
741
 
738
- * カスタム XPath 機能はある。( Nokogiri::XML::Node#xpath 参照 )
739
- * カスタム CSS 擬似クラスと機能はある。( Nokogiri::XML::Node#css 参照 )
742
+ * カスタム XPath 機能を追加。( Nokogiri::XML::Node#xpath 参照 )
743
+ * カスタム CSS 擬似クラスと機能を追加。( Nokogiri::XML::Node#css 参照 )
740
744
  * Nokogiri::XML::Node#<< が作成中に子ノードを自動追加
741
745
 
742
746
  * バグの修正
743
747
 
744
748
  * mutex が CSS のキャッシュのアクセスをロックする
745
749
  * GCC 3.3.5 のビルドに関する問題を修正
746
- * XML::Node#to_xml が引数indentationを取る
747
- * XML::Node#dup が引数任意のdepthを取る
750
+ * XML::Node#to_xml が引数indentationを取る
751
+ * XML::Node#dup が引数任意のdepthを取る
748
752
  * XML::Node#add_previous_sibling が新しい兄弟ノードで返す
749
753
 
750
754
 
@@ -753,10 +757,10 @@
753
757
  * バグの修正
754
758
 
755
759
  * Dike 使用時中のメモリーリークの修正
756
- * SAX パーサーが現在 IO Stream 同時解析
760
+ * SAX パーサーが IO Stream を逐次解析
757
761
  * コメント nodes が独自のクラスを継承する
758
762
  * Nokogiri() は Nokogiri.parse() へデリゲートする
759
- * ENV['PATH'] に付加せれる代わりに先頭へデータ挿入される
763
+ * ENV['PATH'] に付加する代わりに先頭へ挿入する (Windows)
760
764
  * 複雑な CSS 内のバグを修正完了 :not selector ではありません
761
765
 
762
766
 
@@ -775,7 +779,7 @@
775
779
 
776
780
  * バグフィックス
777
781
 
778
- * メーリンクリストを作成
782
+ * メーリングリストを作成
779
783
  * バグファイルを作成
780
784
  * Windows 内で ENV['PATH'] が存在しない場合でも、存在出来るように設定完了
781
785
  * Document 内の NodeSet#[] の結果をキャッシュする
@@ -795,7 +799,7 @@
795
799
 
796
800
  * 5つのバグ修正
797
801
 
798
- * NodeSet が to_ary へ実行
802
+ * NodeSet が to_ary を実装
799
803
  * XML::Document#parent を除去
800
804
  * GCバグ修正済み (Mike は最高!)
801
805
  * 1.8.5互換性の為の RARRAY_LEN 除去
@@ -806,7 +810,7 @@
806
810
 
807
811
  * 1つのバグ修正
808
812
 
809
- * extconf.rb は frex や racc を調べないはず
813
+ * extconf.rb は frex や racc の存在をチェックすべきでない
810
814
 
811
815
 
812
816
  === 1.0.1
@@ -1,10 +1,9 @@
1
- === 1.6.1 / unreleased
1
+ === 1.6.1 / 2013-12-14
2
2
 
3
- * Features
3
+ * Bugfixes
4
4
 
5
- * Nokogiri now builds libxml2 properly with iconv support on platforms
6
- where libiconv is installed outside the system default directories,
7
- such as FreeBSD.
5
+ * (JRuby) Fix out of memory bug when certain invalid documents are parsed.
6
+ * (JRuby) Fix regression of billion-laughs vulnerability. #586
8
7
 
9
8
 
10
9
  === 1.6.0 / 2013-06-08
@@ -43,12 +42,20 @@ mentioned in the notes for v1.5.10.
43
42
  * Support for Ruby 1.8.7 and prior has been dropped
44
43
 
45
44
 
45
+ === 1.5.11 / 2013-11-09
46
+
47
+ * Bugfixes
48
+
49
+ * (JRuby) Fix out of memory bug when certain invalid documents are parsed.
50
+ * (JRuby) Fix regression of billion-laughs vulnerability. #568
51
+
52
+
46
53
  === 1.5.10 / 2013-06-07
47
54
 
48
55
  * Bugfixes
49
56
 
50
57
  * (JRuby) Fix "null document" error when parsing an empty IO in jruby 1.7.3. #883
51
- * (JRuby) Fix schema validation when XSD has DOCTYPE set to DTD. #912 (Thanks, Patrick Cheng!)
58
+ * (JRuby) Fix schema validation when XSD has DOCTYPE set to DTD. #861 (Thanks, Patrick Cheng!)
52
59
  * (MRI) Fix segfault when there is no default subelement for an HTML node. #917
53
60
 
54
61
 
data/Gemfile CHANGED
@@ -16,6 +16,6 @@ gem "rake-compiler", "~>0.8.0", :group => [:development, :test]
16
16
  gem "racc", ">=1.4.6", :group => [:development, :test], :platform => :ruby
17
17
  gem "rexical", ">=1.0.5", :group => [:development, :test], :platform => :ruby
18
18
  gem "rdoc", "~>3.10", :group => [:development, :test]
19
- gem "hoe", "~>2.16", :group => [:development, :test]
19
+ gem "hoe", "~>3.7", :group => [:development, :test]
20
20
 
21
21
  # vim: syntax=ruby
data/Rakefile CHANGED
@@ -32,6 +32,8 @@ HOE = Hoe.spec 'nokogiri' do
32
32
 
33
33
  self.extra_rdoc_files = FileList['*.rdoc','ext/nokogiri/*.c']
34
34
 
35
+ self.licenses = ['MIT']
36
+
35
37
  self.clean_globs += [
36
38
  'nokogiri.gemspec',
37
39
  'lib/nokogiri/nokogiri.{bundle,jar,rb,so}',
@@ -240,7 +242,7 @@ task "gem:windows" => "gem" do
240
242
  raise "rbconfig #{rbconfig_20} needs --export-all in its DLDFLAGS value" if File.read(rbconfig_20).split("\n").grep(/CONFIG\["DLDFLAGS"\].*--export-all/).empty?
241
243
 
242
244
  pkg_config_path = %w[libxslt libxml2].collect { |pkg| File.join($recipes[pkg].path, "lib/pkgconfig") }.join(":")
243
- sh("env PKG_CONFIG_PATH=#{pkg_config_path} RUBY_CC_VERSION=#{ruby_cc_version} rake cross2 native gem") || raise("build failed!")
245
+ sh("env PKG_CONFIG_PATH=#{pkg_config_path} RUBY_CC_VERSION=#{ruby_cc_version} rake cross native gem") || raise("build failed!")
244
246
  end
245
247
 
246
248
  # vim: syntax=Ruby
data/build_all CHANGED
@@ -53,7 +53,7 @@ function rvm_use {
53
53
  set -o errexit
54
54
 
55
55
  # initialize
56
- rvm_use 1.9.3
56
+ rvm_use 1.8.7
57
57
  bundle install --quiet --local || bundle install
58
58
  rm -rf tmp pkg
59
59
  bundle exec rake clean
@@ -70,7 +70,15 @@ if [[ $platform =~ "64" ]] ; then
70
70
  echo ""
71
71
  exit 1
72
72
  fi
73
- rvm_use 1.9.3
73
+ rvm_use 1.8.7
74
+ if [[ ! -a ${HOME}/.rake-compiler/ruby/ruby-1.8.7-p358/lib/ruby/1.8.7/x86_64-linux/rbconfig.rb ]] ; then
75
+
76
+ # if this fails around the purelib.rb thing, try varying the ruby
77
+ # used to run this script, and whether the HOST env var is set
78
+ # below.
79
+
80
+ bundle exec rake-compiler cross-ruby VERSION=1.8.7-p358 # HOST=i386-mingw32
81
+ fi
74
82
  if [[ ! -a ${HOME}/.rake-compiler/ruby/ruby-1.9.3-p194/lib/ruby/1.9.1/x86_64-linux/rbconfig.rb ]] ; then
75
83
  bundle exec rake-compiler cross-ruby VERSION=1.9.3-p194
76
84
  fi
@@ -82,7 +90,7 @@ bundle exec rake gem:windows
82
90
  cp -v pkg/nokogiri*x86-{mingw32,mswin32}*.gem gems
83
91
 
84
92
  # MRI
85
- rvm_use 1.9.3
93
+ rvm_use 1.8.7
86
94
  bundle exec rake gem
87
95
  cp -v pkg/nokogiri*.gem gems # should only be one at this point in the script
88
96
 
@@ -90,7 +98,7 @@ cp -v pkg/nokogiri*.gem gems # should only be one at this point in the script
90
98
  rvm_use jruby
91
99
  bundle install --quiet --local || bundle install
92
100
  bundle exec rake clean clobber
93
- rvm_use 1.9.3
101
+ rvm_use 1.8.7
94
102
  bundle exec rake generate
95
103
  rvm_use jruby
96
104
  bundle exec rake gem
@@ -18,31 +18,6 @@ end
18
18
  $CFLAGS << " #{ENV["CFLAGS"]}"
19
19
  $LIBS << " #{ENV["LIBS"]}"
20
20
 
21
- def preserving_globals
22
- values =
23
- $arg_config,
24
- $CFLAGS, $CPPFLAGS,
25
- $LDFLAGS, $LIBPATH, $libs
26
- yield
27
- ensure
28
- $arg_config,
29
- $CFLAGS, $CPPFLAGS,
30
- $LDFLAGS, $LIBPATH, $libs =
31
- values
32
- end
33
-
34
- def asplode(lib)
35
- abort "-----\n#{lib} is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.\n-----"
36
- end
37
-
38
- def have_iconv?
39
- have_header('iconv.h') or return false
40
- %w{ iconv_open libiconv_open }.any? do |method|
41
- have_func(method, 'iconv.h') or
42
- have_library('iconv', method, 'iconv.h')
43
- end
44
- end
45
-
46
21
  windows_p = RbConfig::CONFIG['target_os'] == 'mingw32' || RbConfig::CONFIG['target_os'] =~ /mswin/
47
22
 
48
23
  if windows_p
@@ -70,20 +45,18 @@ if windows_p
70
45
  XML2_HEADER_DIRS = [File.join(INCLUDEDIR, "libxml2"), INCLUDEDIR]
71
46
 
72
47
  else
73
- opt_header_dirs = [
74
- # First search /opt/local for macports
75
- '/opt/local/include',
48
+ if ENV['NOKOGIRI_USE_SYSTEM_LIBRARIES']
49
+ HEADER_DIRS = [
50
+ # First search /opt/local for macports
51
+ '/opt/local/include',
76
52
 
77
- # Then search /usr/local for people that installed from source
78
- '/usr/local/include',
53
+ # Then search /usr/local for people that installed from source
54
+ '/usr/local/include',
79
55
 
80
- # Check the ruby install locations
81
- INCLUDEDIR,
82
- ]
56
+ # Check the ruby install locations
57
+ INCLUDEDIR,
83
58
 
84
- if ENV['NOKOGIRI_USE_SYSTEM_LIBRARIES']
85
- HEADER_DIRS = opt_header_dirs + [
86
- # Fall back to /usr
59
+ # Finally fall back to /usr
87
60
  '/usr/include',
88
61
  '/usr/include/libxml2',
89
62
  ]
@@ -102,9 +75,11 @@ else
102
75
  '/usr/lib',
103
76
  ]
104
77
 
105
- XML2_HEADER_DIRS = opt_header_dirs.map { |idir|
106
- File.join(idir, "libxml2")
107
- } + HEADER_DIRS
78
+ XML2_HEADER_DIRS = [
79
+ '/opt/local/include/libxml2',
80
+ '/usr/local/include/libxml2',
81
+ File.join(INCLUDEDIR, "libxml2")
82
+ ] + HEADER_DIRS
108
83
 
109
84
  # If the user has homebrew installed, use the libxml2 inside homebrew
110
85
  brew_prefix = `brew --prefix libxml2 2> /dev/null`.chomp
@@ -129,50 +104,6 @@ else
129
104
  recipe.activate
130
105
  end
131
106
 
132
- def each_idir
133
- # If --with-iconv-dir is given, it should be the first priority
134
- idir = preserving_globals {
135
- dir_config('iconv')
136
- }.first and yield idirta
137
-
138
- # Then --with-opt-dir
139
- idir = preserving_globals {
140
- dir_config('opt')
141
- }.first and yield idir
142
-
143
- # Try the system default
144
- yield "/usr/include"
145
-
146
- opt_header_dirs.each { |dir|
147
- yield dir
148
- }
149
-
150
- cflags, = preserving_globals {
151
- pkg_config('libiconv')
152
- }
153
- if cflags
154
- cflags.shellsplit.each { |arg|
155
- arg.sub!(/\A-I/, '') and
156
- yield arg
157
- }
158
- end
159
-
160
- nil
161
- end
162
-
163
- # Make sure libxml2 is built with iconv
164
- iconv_prefix = each_idir { |idir|
165
- prefix = %r{\A(.+)?/include\z} === idir && $1 or next
166
- File.exist?(File.join(idir, 'iconv.h')) or next
167
- preserving_globals {
168
- # Follow the way libxml2's configure uses a value given with
169
- # --with-iconv[=DIR]
170
- $CPPFLAGS << " -I#{idir}"
171
- $LDFLAGS << " -L#{prefix}/lib"
172
- have_iconv?
173
- } and break prefix
174
- } or asplode "libiconv"
175
-
176
107
  dependencies = YAML.load_file(File.join(ROOT, "dependencies.yml"))
177
108
 
178
109
  libxml2_recipe = MiniPortile.new("libxml2", dependencies["libxml2"]).tap do |recipe|
@@ -181,7 +112,6 @@ else
181
112
  "--disable-static",
182
113
  "--without-python",
183
114
  "--without-readline",
184
- "--with-iconv=#{iconv_prefix}",
185
115
  "--with-c14n",
186
116
  "--with-debug",
187
117
  "--with-threads"
@@ -217,10 +147,22 @@ dir_config('iconv', HEADER_DIRS, LIB_DIRS)
217
147
  dir_config('xml2', XML2_HEADER_DIRS, LIB_DIRS)
218
148
  dir_config('xslt', HEADER_DIRS, LIB_DIRS)
219
149
 
150
+ def asplode(lib)
151
+ abort "-----\n#{lib} is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.\n-----"
152
+ end
153
+
220
154
  pkg_config('libxslt')
221
155
  pkg_config('libxml-2.0')
222
156
  pkg_config('libiconv')
223
157
 
158
+ def have_iconv?
159
+ %w{ iconv_open libiconv_open }.any? do |method|
160
+ have_func(method, 'iconv.h') or
161
+ have_library('iconv', method, 'iconv.h') or
162
+ find_library('iconv', method, 'iconv.h')
163
+ end
164
+ end
165
+
224
166
  asplode "libxml2" unless find_header('libxml/parser.h')
225
167
  asplode "libxslt" unless find_header('libxslt/xslt.h')
226
168
  asplode "libexslt" unless find_header('libexslt/exslt.h')
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  module Nokogiri
2
2
  # The version of Nokogiri you are using
3
- VERSION = '1.6.0'
3
+ VERSION = '1.6.1'
4
4
 
5
5
  class VersionInfo # :nodoc:
6
6
  def jruby?
@@ -12,7 +12,7 @@ module Nokogiri
12
12
  end
13
13
 
14
14
  def loaded_parser_version
15
- LIBXML_PARSER_VERSION.scan(/^(.*)(..)(..)$/).first.collect{ |j|
15
+ LIBXML_PARSER_VERSION.scan(/^(\d+)(\d\d)(\d\d)(?!\d)/).first.collect{ |j|
16
16
  j.to_i
17
17
  }.join(".")
18
18
  end
@@ -2,6 +2,8 @@ gem 'rake-compiler'
2
2
  require 'rake/extensioncompiler'
3
3
  HOST = Rake::ExtensionCompiler.mingw_host
4
4
 
5
+ require 'resolv'
6
+
5
7
  require 'mini_portile'
6
8
  dependencies = YAML.load_file("dependencies.yml")
7
9
  $recipes = {}
@@ -121,12 +123,12 @@ namespace :cross do
121
123
  end
122
124
 
123
125
  task :file_list do
124
- add_file_to_gem "lib/nokogiri/nokogiri.rb"
126
+ HOE.spec.files += Dir["lib/nokogiri/nokogiri.rb"]
127
+ HOE.spec.files += Dir["lib/nokogiri/{1.9,2.0}/nokogiri.so"]
125
128
  end
126
-
127
129
  end
128
130
 
129
131
  require 'rake/clean'
130
132
  CLOBBER.include("#{CROSS_DIR}/*.installed", "#{CROSS_DIR}/#{HOST}", "tmp/#{HOST}")
131
133
 
132
- task :cross2 => ["cross:libxslt", "lib/nokogiri/nokogiri.rb", "cross", "cross:file_list"]
134
+ task :cross => ["cross:libxslt", "lib/nokogiri/nokogiri.rb", "cross:file_list"]
@@ -45,17 +45,14 @@ class TestReader < Nokogiri::TestCase
45
45
  node_out = node
46
46
  break
47
47
  end
48
- rd.close
49
48
  end
50
49
  sleep(1) # sleep for one second to make sure the reader will actually block for input
51
- begin
52
- wr.puts "<foo>"
53
- wr.puts "<bar/>" * 10000
54
- wr.flush
55
- rescue Errno::EPIPE
56
- end
50
+ wr.puts "<foo>"
51
+ wr.puts "<bar/>" * 10000
52
+ wr.flush
57
53
  res = t.join(5) # wait 5 seconds for the thread to finish
58
54
  wr.close
55
+ rd.close
59
56
  refute_nil node_out, "Didn't read any nodes, exclude the trivial case"
60
57
  refute_nil res, "Reader blocks trying to read the entire stream"
61
58
  end
@@ -60,6 +60,40 @@ module Nokogiri
60
60
  assert_equal nil, @xml.root
61
61
  end
62
62
 
63
+ def test_million_laugh_attach
64
+ doc = Nokogiri::XML '<?xml version="1.0"?>
65
+ <!DOCTYPE lolz [
66
+ <!ENTITY lol "lol">
67
+ <!ENTITY lol2 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
68
+ <!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
69
+ <!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
70
+ <!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
71
+ <!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
72
+ <!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
73
+ <!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
74
+ <!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
75
+ ]>
76
+ <lolz>&lol9;</lolz>'
77
+ assert_not_nil doc
78
+ end
79
+
80
+ def test_million_laugh_attach_2
81
+ doc = Nokogiri::XML '<?xml version="1.0" encoding="UTF-8"?>
82
+ <!DOCTYPE member [
83
+ <!ENTITY a "&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;">
84
+ <!ENTITY b "&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;">
85
+ <!ENTITY c "&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;">
86
+ <!ENTITY d "&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;">
87
+ <!ENTITY e "&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;">
88
+ <!ENTITY f "&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;">
89
+ <!ENTITY g "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">
90
+ ]>
91
+ <member>
92
+ &a;
93
+ </member>'
94
+ assert_not_nil doc
95
+ end
96
+
63
97
  def test_ignore_unknown_namespace
64
98
  doc = Nokogiri::XML(<<-eoxml)
65
99
  <xml>
@@ -519,6 +553,12 @@ module Nokogiri
519
553
  end
520
554
  end
521
555
 
556
+ def test_memory_explosion_on_invalid_xml
557
+ doc = Nokogiri::XML("<<<")
558
+ refute_nil doc
559
+ refute_empty doc.errors
560
+ end
561
+
522
562
  def test_document_has_errors
523
563
  doc = Nokogiri::XML(<<-eoxml)
524
564
  <foo><bar></foo>
metadata CHANGED
@@ -1,10 +1,9 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: nokogiri
3
- version: !ruby/object:Gem::Version
4
- version: 1.6.0
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.6.1
6
5
  platform: x86-mingw32
7
- authors:
6
+ authors:
8
7
  - Aaron Patterson
9
8
  - Mike Dalessio
10
9
  - Yoko Harada
@@ -12,223 +11,152 @@ authors:
12
11
  autorequire:
13
12
  bindir: bin
14
13
  cert_chain: []
15
- date: 2013-06-10 00:00:00.000000000 Z
16
- dependencies:
17
- - !ruby/object:Gem::Dependency
18
- name: mini_portile
19
- requirement: !ruby/object:Gem::Requirement
20
- none: false
21
- requirements:
14
+
15
+ date: 2013-12-14 00:00:00 Z
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
18
+ version_requirements: &id001 !ruby/object:Gem::Requirement
19
+ requirements:
22
20
  - - ~>
23
- - !ruby/object:Gem::Version
21
+ - !ruby/object:Gem::Version
24
22
  version: 0.5.0
25
23
  type: :runtime
24
+ name: mini_portile
26
25
  prerelease: false
27
- version_requirements: !ruby/object:Gem::Requirement
28
- none: false
29
- requirements:
26
+ requirement: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ version_requirements: &id002 !ruby/object:Gem::Requirement
29
+ requirements:
30
30
  - - ~>
31
- - !ruby/object:Gem::Version
32
- version: 0.5.0
33
- - !ruby/object:Gem::Dependency
34
- name: hoe-bundler
35
- requirement: !ruby/object:Gem::Requirement
36
- none: false
37
- requirements:
38
- - - ! '>='
39
- - !ruby/object:Gem::Version
40
- version: '1.1'
31
+ - !ruby/object:Gem::Version
32
+ version: "4.0"
41
33
  type: :development
34
+ name: rdoc
42
35
  prerelease: false
43
- version_requirements: !ruby/object:Gem::Requirement
44
- none: false
45
- requirements:
46
- - - ! '>='
47
- - !ruby/object:Gem::Version
48
- version: '1.1'
49
- - !ruby/object:Gem::Dependency
50
- name: hoe-debugging
51
- requirement: !ruby/object:Gem::Requirement
52
- none: false
53
- requirements:
54
- - - ! '>='
55
- - !ruby/object:Gem::Version
56
- version: 1.0.3
36
+ requirement: *id002
37
+ - !ruby/object:Gem::Dependency
38
+ version_requirements: &id003 !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: "1.1"
57
43
  type: :development
44
+ name: hoe-bundler
58
45
  prerelease: false
59
- version_requirements: !ruby/object:Gem::Requirement
60
- none: false
61
- requirements:
62
- - - ! '>='
63
- - !ruby/object:Gem::Version
46
+ requirement: *id003
47
+ - !ruby/object:Gem::Dependency
48
+ version_requirements: &id004 !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
64
52
  version: 1.0.3
65
- - !ruby/object:Gem::Dependency
66
- name: hoe-gemspec
67
- requirement: !ruby/object:Gem::Requirement
68
- none: false
69
- requirements:
70
- - - ! '>='
71
- - !ruby/object:Gem::Version
72
- version: '1.0'
73
53
  type: :development
54
+ name: hoe-debugging
74
55
  prerelease: false
75
- version_requirements: !ruby/object:Gem::Requirement
76
- none: false
77
- requirements:
78
- - - ! '>='
79
- - !ruby/object:Gem::Version
80
- version: '1.0'
81
- - !ruby/object:Gem::Dependency
82
- name: hoe-git
83
- requirement: !ruby/object:Gem::Requirement
84
- none: false
85
- requirements:
86
- - - ! '>='
87
- - !ruby/object:Gem::Version
88
- version: '1.4'
56
+ requirement: *id004
57
+ - !ruby/object:Gem::Dependency
58
+ version_requirements: &id005 !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: "1.0"
89
63
  type: :development
64
+ name: hoe-gemspec
90
65
  prerelease: false
91
- version_requirements: !ruby/object:Gem::Requirement
92
- none: false
93
- requirements:
94
- - - ! '>='
95
- - !ruby/object:Gem::Version
96
- version: '1.4'
97
- - !ruby/object:Gem::Dependency
98
- name: minitest
99
- requirement: !ruby/object:Gem::Requirement
100
- none: false
101
- requirements:
102
- - - ~>
103
- - !ruby/object:Gem::Version
104
- version: 2.2.2
66
+ requirement: *id005
67
+ - !ruby/object:Gem::Dependency
68
+ version_requirements: &id006 !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: "1.4"
105
73
  type: :development
74
+ name: hoe-git
106
75
  prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- none: false
109
- requirements:
76
+ requirement: *id006
77
+ - !ruby/object:Gem::Dependency
78
+ version_requirements: &id007 !ruby/object:Gem::Requirement
79
+ requirements:
110
80
  - - ~>
111
- - !ruby/object:Gem::Version
81
+ - !ruby/object:Gem::Version
112
82
  version: 2.2.2
113
- - !ruby/object:Gem::Dependency
114
- name: rake
115
- requirement: !ruby/object:Gem::Requirement
116
- none: false
117
- requirements:
118
- - - ! '>='
119
- - !ruby/object:Gem::Version
120
- version: '0.9'
121
83
  type: :development
84
+ name: minitest
122
85
  prerelease: false
123
- version_requirements: !ruby/object:Gem::Requirement
124
- none: false
125
- requirements:
126
- - - ! '>='
127
- - !ruby/object:Gem::Version
128
- version: '0.9'
129
- - !ruby/object:Gem::Dependency
130
- name: rake-compiler
131
- requirement: !ruby/object:Gem::Requirement
132
- none: false
133
- requirements:
134
- - - ~>
135
- - !ruby/object:Gem::Version
136
- version: 0.8.0
86
+ requirement: *id007
87
+ - !ruby/object:Gem::Dependency
88
+ version_requirements: &id008 !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: "0.9"
137
93
  type: :development
94
+ name: rake
138
95
  prerelease: false
139
- version_requirements: !ruby/object:Gem::Requirement
140
- none: false
141
- requirements:
96
+ requirement: *id008
97
+ - !ruby/object:Gem::Dependency
98
+ version_requirements: &id009 !ruby/object:Gem::Requirement
99
+ requirements:
142
100
  - - ~>
143
- - !ruby/object:Gem::Version
101
+ - !ruby/object:Gem::Version
144
102
  version: 0.8.0
145
- - !ruby/object:Gem::Dependency
146
- name: racc
147
- requirement: !ruby/object:Gem::Requirement
148
- none: false
149
- requirements:
150
- - - ! '>='
151
- - !ruby/object:Gem::Version
152
- version: 1.4.6
153
103
  type: :development
104
+ name: rake-compiler
154
105
  prerelease: false
155
- version_requirements: !ruby/object:Gem::Requirement
156
- none: false
157
- requirements:
158
- - - ! '>='
159
- - !ruby/object:Gem::Version
106
+ requirement: *id009
107
+ - !ruby/object:Gem::Dependency
108
+ version_requirements: &id010 !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
160
112
  version: 1.4.6
161
- - !ruby/object:Gem::Dependency
162
- name: rexical
163
- requirement: !ruby/object:Gem::Requirement
164
- none: false
165
- requirements:
166
- - - ! '>='
167
- - !ruby/object:Gem::Version
168
- version: 1.0.5
169
113
  type: :development
114
+ name: racc
170
115
  prerelease: false
171
- version_requirements: !ruby/object:Gem::Requirement
172
- none: false
173
- requirements:
174
- - - ! '>='
175
- - !ruby/object:Gem::Version
116
+ requirement: *id010
117
+ - !ruby/object:Gem::Dependency
118
+ version_requirements: &id011 !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
176
122
  version: 1.0.5
177
- - !ruby/object:Gem::Dependency
178
- name: rdoc
179
- requirement: !ruby/object:Gem::Requirement
180
- none: false
181
- requirements:
182
- - - ~>
183
- - !ruby/object:Gem::Version
184
- version: '3.10'
185
123
  type: :development
124
+ name: rexical
186
125
  prerelease: false
187
- version_requirements: !ruby/object:Gem::Requirement
188
- none: false
189
- requirements:
126
+ requirement: *id011
127
+ - !ruby/object:Gem::Dependency
128
+ version_requirements: &id012 !ruby/object:Gem::Requirement
129
+ requirements:
190
130
  - - ~>
191
- - !ruby/object:Gem::Version
192
- version: '3.10'
193
- - !ruby/object:Gem::Dependency
194
- name: hoe
195
- requirement: !ruby/object:Gem::Requirement
196
- none: false
197
- requirements:
198
- - - ~>
199
- - !ruby/object:Gem::Version
200
- version: '2.16'
131
+ - !ruby/object:Gem::Version
132
+ version: "3.7"
201
133
  type: :development
134
+ name: hoe
202
135
  prerelease: false
203
- version_requirements: !ruby/object:Gem::Requirement
204
- none: false
205
- requirements:
206
- - - ~>
207
- - !ruby/object:Gem::Version
208
- version: '2.16'
209
- description: ! 'Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser. Among Nokogiri''s
210
-
211
- many features is the ability to search documents via XPath or CSS3 selectors.
212
-
213
-
214
- XML is like violence - if it doesn’t solve your problems, you are not using
215
-
216
- enough of it.'
217
- email:
136
+ requirement: *id012
137
+ description: "Nokogiri (\xE9\x8B\xB8) is an HTML, XML, SAX, and Reader parser. Among Nokogiri's\n\
138
+ many features is the ability to search documents via XPath or CSS3 selectors.\n\n\
139
+ XML is like violence - if it doesn\xE2\x80\x99t solve your problems, you are not using\n\
140
+ enough of it."
141
+ email:
218
142
  - aaronp@rubyforge.org
219
143
  - mike.dalessio@gmail.com
220
144
  - yokolet@gmail.com
221
145
  - tle@holymonkey.com
222
- executables:
146
+ executables:
223
147
  - nokogiri
224
148
  extensions: []
225
- extra_rdoc_files:
149
+
150
+ extra_rdoc_files:
226
151
  - CHANGELOG.ja.rdoc
227
152
  - CHANGELOG.rdoc
228
153
  - C_CODING_STYLE.rdoc
229
154
  - Manifest.txt
230
155
  - README.ja.rdoc
231
156
  - README.rdoc
157
+ - ROADMAP.md
158
+ - STANDARD_RESPONSES.md
159
+ - Y_U_NO_GEMSPEC.md
232
160
  - ext/nokogiri/html_document.c
233
161
  - ext/nokogiri/html_element_description.c
234
162
  - ext/nokogiri/html_entity_lookup.c
@@ -263,7 +191,7 @@ extra_rdoc_files:
263
191
  - ext/nokogiri/xml_text.c
264
192
  - ext/nokogiri/xml_xpath_context.c
265
193
  - ext/nokogiri/xslt_stylesheet.c
266
- files:
194
+ files:
267
195
  - .autotest
268
196
  - .gemtest
269
197
  - .travis.yml
@@ -519,32 +447,34 @@ files:
519
447
  - lib/nokogiri/1.9/nokogiri.so
520
448
  - lib/nokogiri/2.0/nokogiri.so
521
449
  homepage: http://nokogiri.org
522
- licenses: []
450
+ licenses:
451
+ - MIT
452
+ metadata: {}
453
+
523
454
  post_install_message:
524
- rdoc_options:
455
+ rdoc_options:
525
456
  - --main
526
457
  - README.rdoc
527
- require_paths:
458
+ require_paths:
528
459
  - lib
529
- required_ruby_version: !ruby/object:Gem::Requirement
530
- none: false
531
- requirements:
532
- - - ! '>='
533
- - !ruby/object:Gem::Version
460
+ required_ruby_version: !ruby/object:Gem::Requirement
461
+ requirements:
462
+ - - ">="
463
+ - !ruby/object:Gem::Version
534
464
  version: 1.9.2
535
- required_rubygems_version: !ruby/object:Gem::Requirement
536
- none: false
537
- requirements:
538
- - - ! '>='
539
- - !ruby/object:Gem::Version
540
- version: '0'
465
+ required_rubygems_version: !ruby/object:Gem::Requirement
466
+ requirements:
467
+ - - ">="
468
+ - !ruby/object:Gem::Version
469
+ version: "0"
541
470
  requirements: []
471
+
542
472
  rubyforge_project: nokogiri
543
- rubygems_version: 1.8.25
473
+ rubygems_version: 2.0.13
544
474
  signing_key:
545
- specification_version: 3
546
- summary: Nokogiri () is an HTML, XML, SAX, and Reader parser
547
- test_files:
475
+ specification_version: 4
476
+ summary: "Nokogiri (\xE9\x8B\xB8) is an HTML, XML, SAX, and Reader parser"
477
+ test_files:
548
478
  - test/decorators/test_slop.rb
549
479
  - test/test_encoding_handler.rb
550
480
  - test/css/test_parser.rb