nokogiri 1.2.3 → 1.3.0

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.

Files changed (200) hide show
  1. data/.autotest +14 -2
  2. data/CHANGELOG.ja.rdoc +38 -0
  3. data/CHANGELOG.rdoc +43 -0
  4. data/Manifest.txt +80 -5
  5. data/README.ja.rdoc +12 -11
  6. data/README.rdoc +4 -2
  7. data/Rakefile +103 -173
  8. data/bin/nokogiri +47 -0
  9. data/ext/nokogiri/extconf.rb +19 -13
  10. data/ext/nokogiri/html_document.c +39 -3
  11. data/ext/nokogiri/html_document.h +1 -1
  12. data/ext/nokogiri/html_element_description.c +272 -0
  13. data/ext/nokogiri/html_element_description.h +10 -0
  14. data/ext/nokogiri/html_entity_lookup.h +1 -1
  15. data/ext/nokogiri/html_sax_parser.h +1 -1
  16. data/ext/nokogiri/{native.c → nokogiri.c} +11 -3
  17. data/ext/nokogiri/{native.h → nokogiri.h} +18 -4
  18. data/ext/nokogiri/xml_attr.c +14 -5
  19. data/ext/nokogiri/xml_attr.h +1 -1
  20. data/ext/nokogiri/xml_cdata.c +15 -6
  21. data/ext/nokogiri/xml_cdata.h +1 -1
  22. data/ext/nokogiri/xml_comment.c +13 -4
  23. data/ext/nokogiri/xml_comment.h +1 -1
  24. data/ext/nokogiri/xml_document.c +50 -41
  25. data/ext/nokogiri/xml_document.h +1 -1
  26. data/ext/nokogiri/xml_document_fragment.c +12 -4
  27. data/ext/nokogiri/xml_document_fragment.h +1 -1
  28. data/ext/nokogiri/xml_dtd.c +1 -1
  29. data/ext/nokogiri/xml_dtd.h +1 -1
  30. data/ext/nokogiri/xml_entity_reference.c +13 -4
  31. data/ext/nokogiri/xml_entity_reference.h +1 -1
  32. data/ext/nokogiri/xml_io.h +1 -1
  33. data/ext/nokogiri/xml_namespace.c +69 -0
  34. data/ext/nokogiri/xml_namespace.h +12 -0
  35. data/ext/nokogiri/xml_node.c +232 -124
  36. data/ext/nokogiri/xml_node.h +3 -4
  37. data/ext/nokogiri/xml_node_set.c +206 -19
  38. data/ext/nokogiri/xml_node_set.h +1 -1
  39. data/ext/nokogiri/xml_processing_instruction.c +14 -4
  40. data/ext/nokogiri/xml_processing_instruction.h +1 -1
  41. data/ext/nokogiri/xml_reader.c +87 -7
  42. data/ext/nokogiri/xml_reader.h +1 -1
  43. data/ext/nokogiri/xml_relax_ng.c +106 -0
  44. data/ext/nokogiri/xml_relax_ng.h +9 -0
  45. data/ext/nokogiri/xml_sax_parser.c +122 -2
  46. data/ext/nokogiri/xml_sax_parser.h +1 -1
  47. data/ext/nokogiri/xml_sax_push_parser.c +1 -0
  48. data/ext/nokogiri/xml_sax_push_parser.h +1 -1
  49. data/ext/nokogiri/xml_schema.c +107 -0
  50. data/ext/nokogiri/xml_schema.h +9 -0
  51. data/ext/nokogiri/xml_syntax_error.h +1 -1
  52. data/ext/nokogiri/xml_text.c +10 -3
  53. data/ext/nokogiri/xml_text.h +1 -1
  54. data/ext/nokogiri/xml_xpath.h +1 -1
  55. data/ext/nokogiri/xml_xpath_context.h +1 -1
  56. data/ext/nokogiri/xslt_stylesheet.c +29 -16
  57. data/ext/nokogiri/xslt_stylesheet.h +1 -1
  58. data/lib/action-nokogiri.rb +7 -1
  59. data/lib/nokogiri.rb +21 -5
  60. data/lib/nokogiri/css/generated_parser.rb +49 -14
  61. data/lib/nokogiri/css/generated_tokenizer.rb +2 -2
  62. data/lib/nokogiri/css/node.rb +13 -3
  63. data/lib/nokogiri/css/parser.rb +8 -0
  64. data/lib/nokogiri/css/parser.y +7 -7
  65. data/lib/nokogiri/css/tokenizer.rb +2 -0
  66. data/lib/nokogiri/css/xpath_visitor.rb +10 -6
  67. data/lib/nokogiri/decorators/hpricot/node.rb +1 -1
  68. data/lib/nokogiri/decorators/hpricot/node_set.rb +2 -2
  69. data/lib/nokogiri/decorators/hpricot/xpath_visitor.rb +2 -0
  70. data/lib/nokogiri/decorators/slop.rb +3 -1
  71. data/lib/nokogiri/ffi/html/document.rb +37 -0
  72. data/lib/nokogiri/ffi/html/element_description.rb +85 -0
  73. data/lib/nokogiri/ffi/html/entity_lookup.rb +16 -0
  74. data/lib/nokogiri/ffi/html/sax/parser.rb +21 -0
  75. data/lib/nokogiri/ffi/io_callbacks.rb +32 -0
  76. data/lib/nokogiri/ffi/libxml.rb +314 -0
  77. data/lib/nokogiri/ffi/structs/common_node.rb +26 -0
  78. data/lib/nokogiri/ffi/structs/html_elem_desc.rb +24 -0
  79. data/lib/nokogiri/ffi/structs/html_entity_desc.rb +13 -0
  80. data/lib/nokogiri/ffi/structs/xml_alloc.rb +16 -0
  81. data/lib/nokogiri/ffi/structs/xml_attr.rb +19 -0
  82. data/lib/nokogiri/ffi/structs/xml_buffer.rb +16 -0
  83. data/lib/nokogiri/ffi/structs/xml_document.rb +108 -0
  84. data/lib/nokogiri/ffi/structs/xml_dtd.rb +26 -0
  85. data/lib/nokogiri/ffi/structs/xml_node.rb +28 -0
  86. data/lib/nokogiri/ffi/structs/xml_node_set.rb +53 -0
  87. data/lib/nokogiri/ffi/structs/xml_notation.rb +11 -0
  88. data/lib/nokogiri/ffi/structs/xml_ns.rb +15 -0
  89. data/lib/nokogiri/ffi/structs/xml_relax_ng.rb +14 -0
  90. data/lib/nokogiri/ffi/structs/xml_sax_handler.rb +51 -0
  91. data/lib/nokogiri/ffi/structs/xml_sax_push_parser_context.rb +14 -0
  92. data/lib/nokogiri/ffi/structs/xml_schema.rb +13 -0
  93. data/lib/nokogiri/ffi/structs/xml_syntax_error.rb +31 -0
  94. data/lib/nokogiri/ffi/structs/xml_text_reader.rb +12 -0
  95. data/lib/nokogiri/ffi/structs/xml_xpath_context.rb +37 -0
  96. data/lib/nokogiri/ffi/structs/xml_xpath_object.rb +35 -0
  97. data/lib/nokogiri/ffi/structs/xml_xpath_parser_context.rb +20 -0
  98. data/lib/nokogiri/ffi/structs/xslt_stylesheet.rb +13 -0
  99. data/lib/nokogiri/ffi/xml/attr.rb +41 -0
  100. data/lib/nokogiri/ffi/xml/cdata.rb +19 -0
  101. data/lib/nokogiri/ffi/xml/comment.rb +18 -0
  102. data/lib/nokogiri/ffi/xml/document.rb +107 -0
  103. data/lib/nokogiri/ffi/xml/document_fragment.rb +26 -0
  104. data/lib/nokogiri/ffi/xml/dtd.rb +42 -0
  105. data/lib/nokogiri/ffi/xml/entity_reference.rb +19 -0
  106. data/lib/nokogiri/ffi/xml/namespace.rb +38 -0
  107. data/lib/nokogiri/ffi/xml/node.rb +380 -0
  108. data/lib/nokogiri/ffi/xml/node_set.rb +130 -0
  109. data/lib/nokogiri/ffi/xml/processing_instruction.rb +20 -0
  110. data/lib/nokogiri/ffi/xml/reader.rb +217 -0
  111. data/lib/nokogiri/ffi/xml/relax_ng.rb +51 -0
  112. data/lib/nokogiri/ffi/xml/sax/parser.rb +148 -0
  113. data/lib/nokogiri/ffi/xml/sax/push_parser.rb +38 -0
  114. data/lib/nokogiri/ffi/xml/schema.rb +55 -0
  115. data/lib/nokogiri/ffi/xml/syntax_error.rb +76 -0
  116. data/lib/nokogiri/ffi/xml/text.rb +18 -0
  117. data/lib/nokogiri/ffi/xml/xpath.rb +19 -0
  118. data/lib/nokogiri/ffi/xml/xpath_context.rb +135 -0
  119. data/lib/nokogiri/ffi/xslt/stylesheet.rb +47 -0
  120. data/lib/nokogiri/hpricot.rb +14 -3
  121. data/lib/nokogiri/html.rb +11 -46
  122. data/lib/nokogiri/html/builder.rb +27 -1
  123. data/lib/nokogiri/html/document.rb +62 -6
  124. data/lib/nokogiri/html/document_fragment.rb +15 -0
  125. data/lib/nokogiri/html/element_description.rb +23 -0
  126. data/lib/nokogiri/html/entity_lookup.rb +2 -0
  127. data/lib/nokogiri/html/sax/parser.rb +27 -1
  128. data/lib/nokogiri/version.rb +26 -1
  129. data/lib/nokogiri/version_warning.rb +11 -0
  130. data/lib/nokogiri/xml.rb +25 -51
  131. data/lib/nokogiri/xml/builder.rb +166 -10
  132. data/lib/nokogiri/xml/cdata.rb +3 -1
  133. data/lib/nokogiri/xml/document.rb +39 -6
  134. data/lib/nokogiri/xml/document_fragment.rb +41 -1
  135. data/lib/nokogiri/xml/dtd.rb +3 -1
  136. data/lib/nokogiri/xml/entity_declaration.rb +3 -1
  137. data/lib/nokogiri/xml/fragment_handler.rb +24 -3
  138. data/lib/nokogiri/xml/namespace.rb +7 -0
  139. data/lib/nokogiri/xml/node.rb +314 -65
  140. data/lib/nokogiri/xml/node/save_options.rb +12 -2
  141. data/lib/nokogiri/xml/node_set.rb +58 -8
  142. data/lib/nokogiri/xml/parse_options.rb +80 -0
  143. data/lib/nokogiri/xml/processing_instruction.rb +2 -0
  144. data/lib/nokogiri/xml/reader.rb +42 -3
  145. data/lib/nokogiri/xml/relax_ng.rb +32 -0
  146. data/lib/nokogiri/xml/sax.rb +0 -7
  147. data/lib/nokogiri/xml/sax/document.rb +84 -0
  148. data/lib/nokogiri/xml/sax/parser.rb +38 -2
  149. data/lib/nokogiri/xml/sax/push_parser.rb +12 -0
  150. data/lib/nokogiri/xml/schema.rb +65 -0
  151. data/lib/nokogiri/xml/syntax_error.rb +11 -0
  152. data/lib/nokogiri/xml/xpath.rb +1 -1
  153. data/lib/nokogiri/xml/xpath_context.rb +2 -0
  154. data/lib/nokogiri/xslt.rb +21 -1
  155. data/lib/nokogiri/xslt/stylesheet.rb +19 -0
  156. data/lib/xsd/xmlparser/nokogiri.rb +12 -2
  157. data/tasks/test.rb +42 -19
  158. data/test/css/test_parser.rb +29 -0
  159. data/test/ffi/test_document.rb +35 -0
  160. data/test/files/address_book.rlx +12 -0
  161. data/test/files/address_book.xml +10 -0
  162. data/test/files/po.xml +32 -0
  163. data/test/files/po.xsd +66 -0
  164. data/test/helper.rb +38 -8
  165. data/test/html/sax/test_parser.rb +12 -0
  166. data/test/html/test_builder.rb +25 -2
  167. data/test/html/test_document.rb +91 -20
  168. data/test/html/test_document_fragment.rb +97 -0
  169. data/test/html/test_element_description.rb +95 -0
  170. data/test/html/test_node.rb +66 -3
  171. data/test/test_convert_xpath.rb +1 -1
  172. data/test/test_memory_leak.rb +57 -18
  173. data/test/test_nokogiri.rb +24 -2
  174. data/test/test_reader.rb +77 -0
  175. data/test/test_xslt_transforms.rb +120 -82
  176. data/test/xml/node/test_subclass.rb +44 -0
  177. data/test/xml/sax/test_parser.rb +9 -0
  178. data/test/xml/sax/test_push_parser.rb +24 -0
  179. data/test/xml/test_attr.rb +7 -0
  180. data/test/xml/test_builder.rb +48 -0
  181. data/test/xml/test_cdata.rb +19 -0
  182. data/test/xml/test_comment.rb +6 -0
  183. data/test/xml/test_document.rb +101 -2
  184. data/test/xml/test_document_fragment.rb +55 -3
  185. data/test/xml/test_entity_reference.rb +4 -0
  186. data/test/xml/test_namespace.rb +43 -0
  187. data/test/xml/test_node.rb +255 -8
  188. data/test/xml/test_node_attributes.rb +34 -0
  189. data/test/xml/test_node_encoding.rb +9 -2
  190. data/test/xml/test_node_set.rb +197 -1
  191. data/test/xml/test_parse_options.rb +52 -0
  192. data/test/xml/test_processing_instruction.rb +5 -0
  193. data/test/xml/test_relax_ng.rb +60 -0
  194. data/test/xml/test_schema.rb +65 -0
  195. data/test/xml/test_text.rb +5 -0
  196. data/test/xml/test_unparented_node.rb +3 -3
  197. metadata +128 -12
  198. data/lib/nokogiri/xml/comment.rb +0 -6
  199. data/lib/nokogiri/xml/element.rb +0 -6
  200. data/lib/nokogiri/xml/text.rb +0 -6
data/.autotest CHANGED
@@ -1,13 +1,25 @@
1
1
  # -*- ruby -*-
2
2
 
3
+ begin
4
+ require 'autotest/fsevent'
5
+ rescue LoadError
6
+ end
7
+
3
8
  Autotest.add_hook :run_command do |at|
9
+ at.unit_diff = 'cat'
4
10
  if ENV['ONENINE']
5
- system "rake1.9 build"
11
+ system "rake1.9 compile"
6
12
  else
7
- system "rake build"
13
+ system "rake compile"
8
14
  end
9
15
  end
10
16
 
17
+ Autotest.add_hook :ran_command do |at|
18
+ File.open('/tmp/autotest.txt', 'wb') { |f|
19
+ f.write(at.results.join)
20
+ }
21
+ end
22
+
11
23
  class Autotest
12
24
  def ruby
13
25
  'ruby1.9'
@@ -1,3 +1,41 @@
1
+ === 1.3.0 / 2009年5月30日
2
+
3
+ * 新しい機能
4
+
5
+ * ビルダーはブロックのアリティによりスコープを変換出来るようになった
6
+ * ビルダーはアンダースコア、アンダーラインで終わるメソッドをtagzと同様の機能でサポートするようになった
7
+ * Nokogiri::XML::Node#<=> はドキュメントの位置によりノードを比較するようになった
8
+ * Nokogiri::XML::Node#matches?は与えられたセレクタ内でノードが認知されたらtrueを返す事が出来るようになった
9
+ * Nokogiri::XML::Node#ancestors はNokogiri::XML::NodeSetを返すようになった
10
+ * Nokogiri::XML::Node#ancestorsはオプションのセレクタに対応する親をマッチするようになった
11
+ * Nokogiri::HTML::Document#meta_encoding はメタデータのエンコードを返すようになった
12
+ * Nokogiri::HTML::Document#meta_encoding= はメタデータのエンコードを設定するようになった
13
+ * Nokogiri::XML::Document#encoding= はドキュメントのエンコードを設定するようになった
14
+ * Nokogiri::XML::Schema はドキュメントがXSDのスキーマに沿って記述されているかを検証するようになった
15
+ * Nokogiri::XML::RelaxNG はドキュメントがRelaxNGのスキーマに沿って記述されているかを検証するようになった
16
+ * Nokogiri::HTML::ElementDescription はHTML要素の説明フェッチ動作するようになった
17
+ * Nokogiri::XML::Node#descriptionは ノードの説明をフェッチ動作するようになった
18
+ * Nokogiri::XML::Node#accept は Visitor パターンを実行するようになった
19
+ * bin/nokogiri にドキュメントを簡単に監査するようになった (Yataka HARAさんに感謝感激)
20
+ * Nokogiri::XML::NodeSetが更にArrayとEnumerableの演算をサポートするようになった:
21
+ index, delete, slice, - (差分), + (連結), & (共通部分),
22
+ push, pop, shift, ==
23
+ * Nokogiri.XML, Nokogiri.HTML はNokogiri::XML::ParseOptions objectと一緒に呼び出されるブロックを受け入れるようになった
24
+ * Nokogiri::XML::Node#namespace は Nokogiri::XML::Namespaceを返すようになった
25
+ * Nokogiri::XML::Node#namespaceはノードの名前空間を設定するようになった
26
+ * FFI 経由で JRuby 1.3.0 をサポートするようになった
27
+
28
+ * バグの修正
29
+
30
+ * nilがCDATAsonstructorに渡される際の問題を修正
31
+ * Fragment メソッドが正規表現を抜け出させるようになった (Thanks Joel!) (LH #73)
32
+ * Builder スコープのLH #61, LH #74, LH #70に関しての様々な問題を修正
33
+ * 名前空間を付け加える時、名前空間が LH#78より除去されてしまう問題を修正
34
+ * 連結しないノードが発生し、再育成してしまう問題を修正(GH#22)
35
+ * XSLT が解析中にエラーを発見し損なう問題を修正(GH#32)
36
+ * CSS selectors内での条件属性のバグ問題を修正(GH#36)
37
+ * Node#before/after/inner_html=で値なしのHTML属性が受け入れられなかった問題を修正 (GH#35)
38
+
1
39
  === 1.2.3 / 2009年3月22日
2
40
 
3
41
  * バグの修正
@@ -1,3 +1,46 @@
1
+ === 1.3.0 / 2009-05-30
2
+
3
+ * New Features
4
+
5
+ * Builder changes scope based on block arity
6
+ * Builder supports methods ending in underscore similar to tagz
7
+ * Nokogiri::XML::Node#<=> compares nodes based on Document position
8
+ * Nokogiri::XML::Node#matches? returns true if Node can be found with
9
+ given selector.
10
+ * Nokogiri::XML::Node#ancestors now returns an Nokogiri::XML::NodeSet
11
+ * Nokogiri::XML::Node#ancestors will match parents against optional selector
12
+ * Nokogiri::HTML::Document#meta_encoding for getting the meta encoding
13
+ * Nokogiri::HTML::Document#meta_encoding= for setting the meta encoding
14
+ * Nokogiri::XML::Document#encoding= to set the document encoding
15
+ * Nokogiri::XML::Schema for validating documents against XSD schema
16
+ * Nokogiri::XML::RelaxNG for validating documents against RelaxNG schema
17
+ * Nokogiri::HTML::ElementDescription for fetching HTML element descriptions
18
+ * Nokogiri::XML::Node#description to fetch the node description
19
+ * Nokogiri::XML::Node#accept implements Visitor pattern
20
+ * bin/nokogiri for easily examining documents (Thanks Yutaka HARA!)
21
+ * Nokogiri::XML::NodeSet now supports more Array and Enumerable operators:
22
+ index, delete, slice, - (difference), + (concatenation), & (intersection),
23
+ push, pop, shift, ==
24
+ * Nokogiri.XML, Nokogiri.HTML take blocks that receive
25
+ Nokogiri::XML::ParseOptions objects
26
+ * Nokogiri::XML::Node#namespace returns a Nokogiri::XML::Namespace
27
+ * Nokogiri::XML::Node#namespace= for setting a node's namespace
28
+ * Nokogiri::XML::DocumentFragment and Nokogiri::HTML::DocumentFragment
29
+ have a sensible API and a more robust implementation.
30
+ * JRuby 1.3.0 support via FFI.
31
+
32
+ * Bugfixes
33
+
34
+ * Fixed a problem with nil passed to CDATA constructor
35
+ * Fragment method deals with regular expression characters
36
+ (Thanks Joel!) LH #73
37
+ * Fixing builder scope issues LH #61, LH #74, LH #70
38
+ * Fixed a problem when adding a child could remove the child namespace LH#78
39
+ * Fixed bug with unlinking a node then reparenting it. (GH#22)
40
+ * Fixed failure to catch errors during XSLT parsing (GH#32)
41
+ * Fixed a bug with attribute conditions in CSS selectors (GH#36)
42
+ * Fixed intolerance of HTML attributes without values in Node#before/after/inner_html=. (GH#35)
43
+
1
44
  === 1.2.3 / 2009-03-22
2
45
 
3
46
  * Bugfixes
@@ -5,15 +5,18 @@ Manifest.txt
5
5
  README.ja.rdoc
6
6
  README.rdoc
7
7
  Rakefile
8
+ bin/nokogiri
8
9
  ext/nokogiri/extconf.rb
9
10
  ext/nokogiri/html_document.c
10
11
  ext/nokogiri/html_document.h
12
+ ext/nokogiri/html_element_description.c
13
+ ext/nokogiri/html_element_description.h
11
14
  ext/nokogiri/html_entity_lookup.c
12
15
  ext/nokogiri/html_entity_lookup.h
13
16
  ext/nokogiri/html_sax_parser.c
14
17
  ext/nokogiri/html_sax_parser.h
15
- ext/nokogiri/native.c
16
- ext/nokogiri/native.h
18
+ ext/nokogiri/nokogiri.c
19
+ ext/nokogiri/nokogiri.h
17
20
  ext/nokogiri/xml_attr.c
18
21
  ext/nokogiri/xml_attr.h
19
22
  ext/nokogiri/xml_cdata.c
@@ -30,6 +33,8 @@ ext/nokogiri/xml_entity_reference.c
30
33
  ext/nokogiri/xml_entity_reference.h
31
34
  ext/nokogiri/xml_io.c
32
35
  ext/nokogiri/xml_io.h
36
+ ext/nokogiri/xml_namespace.c
37
+ ext/nokogiri/xml_namespace.h
33
38
  ext/nokogiri/xml_node.c
34
39
  ext/nokogiri/xml_node.h
35
40
  ext/nokogiri/xml_node_set.c
@@ -38,10 +43,14 @@ ext/nokogiri/xml_processing_instruction.c
38
43
  ext/nokogiri/xml_processing_instruction.h
39
44
  ext/nokogiri/xml_reader.c
40
45
  ext/nokogiri/xml_reader.h
46
+ ext/nokogiri/xml_relax_ng.c
47
+ ext/nokogiri/xml_relax_ng.h
41
48
  ext/nokogiri/xml_sax_parser.c
42
49
  ext/nokogiri/xml_sax_parser.h
43
50
  ext/nokogiri/xml_sax_push_parser.c
44
51
  ext/nokogiri/xml_sax_push_parser.h
52
+ ext/nokogiri/xml_schema.c
53
+ ext/nokogiri/xml_schema.h
45
54
  ext/nokogiri/xml_syntax_error.c
46
55
  ext/nokogiri/xml_syntax_error.h
47
56
  ext/nokogiri/xml_text.c
@@ -70,37 +79,90 @@ lib/nokogiri/decorators/hpricot/node.rb
70
79
  lib/nokogiri/decorators/hpricot/node_set.rb
71
80
  lib/nokogiri/decorators/hpricot/xpath_visitor.rb
72
81
  lib/nokogiri/decorators/slop.rb
82
+ lib/nokogiri/ffi/html/document.rb
83
+ lib/nokogiri/ffi/html/element_description.rb
84
+ lib/nokogiri/ffi/html/entity_lookup.rb
85
+ lib/nokogiri/ffi/html/sax/parser.rb
86
+ lib/nokogiri/ffi/io_callbacks.rb
87
+ lib/nokogiri/ffi/libxml.rb
88
+ lib/nokogiri/ffi/structs/common_node.rb
89
+ lib/nokogiri/ffi/structs/html_elem_desc.rb
90
+ lib/nokogiri/ffi/structs/html_entity_desc.rb
91
+ lib/nokogiri/ffi/structs/xml_alloc.rb
92
+ lib/nokogiri/ffi/structs/xml_attr.rb
93
+ lib/nokogiri/ffi/structs/xml_buffer.rb
94
+ lib/nokogiri/ffi/structs/xml_document.rb
95
+ lib/nokogiri/ffi/structs/xml_dtd.rb
96
+ lib/nokogiri/ffi/structs/xml_node.rb
97
+ lib/nokogiri/ffi/structs/xml_node_set.rb
98
+ lib/nokogiri/ffi/structs/xml_notation.rb
99
+ lib/nokogiri/ffi/structs/xml_ns.rb
100
+ lib/nokogiri/ffi/structs/xml_relax_ng.rb
101
+ lib/nokogiri/ffi/structs/xml_sax_handler.rb
102
+ lib/nokogiri/ffi/structs/xml_sax_push_parser_context.rb
103
+ lib/nokogiri/ffi/structs/xml_schema.rb
104
+ lib/nokogiri/ffi/structs/xml_syntax_error.rb
105
+ lib/nokogiri/ffi/structs/xml_text_reader.rb
106
+ lib/nokogiri/ffi/structs/xml_xpath_context.rb
107
+ lib/nokogiri/ffi/structs/xml_xpath_object.rb
108
+ lib/nokogiri/ffi/structs/xml_xpath_parser_context.rb
109
+ lib/nokogiri/ffi/structs/xslt_stylesheet.rb
110
+ lib/nokogiri/ffi/xml/attr.rb
111
+ lib/nokogiri/ffi/xml/cdata.rb
112
+ lib/nokogiri/ffi/xml/comment.rb
113
+ lib/nokogiri/ffi/xml/document.rb
114
+ lib/nokogiri/ffi/xml/document_fragment.rb
115
+ lib/nokogiri/ffi/xml/dtd.rb
116
+ lib/nokogiri/ffi/xml/entity_reference.rb
117
+ lib/nokogiri/ffi/xml/namespace.rb
118
+ lib/nokogiri/ffi/xml/node.rb
119
+ lib/nokogiri/ffi/xml/node_set.rb
120
+ lib/nokogiri/ffi/xml/processing_instruction.rb
121
+ lib/nokogiri/ffi/xml/reader.rb
122
+ lib/nokogiri/ffi/xml/relax_ng.rb
123
+ lib/nokogiri/ffi/xml/sax/parser.rb
124
+ lib/nokogiri/ffi/xml/sax/push_parser.rb
125
+ lib/nokogiri/ffi/xml/schema.rb
126
+ lib/nokogiri/ffi/xml/syntax_error.rb
127
+ lib/nokogiri/ffi/xml/text.rb
128
+ lib/nokogiri/ffi/xml/xpath.rb
129
+ lib/nokogiri/ffi/xml/xpath_context.rb
130
+ lib/nokogiri/ffi/xslt/stylesheet.rb
73
131
  lib/nokogiri/hpricot.rb
74
132
  lib/nokogiri/html.rb
75
133
  lib/nokogiri/html/builder.rb
76
134
  lib/nokogiri/html/document.rb
135
+ lib/nokogiri/html/document_fragment.rb
136
+ lib/nokogiri/html/element_description.rb
77
137
  lib/nokogiri/html/entity_lookup.rb
78
138
  lib/nokogiri/html/sax/parser.rb
79
139
  lib/nokogiri/syntax_error.rb
80
140
  lib/nokogiri/version.rb
141
+ lib/nokogiri/version_warning.rb
81
142
  lib/nokogiri/xml.rb
82
143
  lib/nokogiri/xml/attr.rb
83
144
  lib/nokogiri/xml/builder.rb
84
145
  lib/nokogiri/xml/cdata.rb
85
- lib/nokogiri/xml/comment.rb
86
146
  lib/nokogiri/xml/document.rb
87
147
  lib/nokogiri/xml/document_fragment.rb
88
148
  lib/nokogiri/xml/dtd.rb
89
- lib/nokogiri/xml/element.rb
90
149
  lib/nokogiri/xml/entity_declaration.rb
91
150
  lib/nokogiri/xml/fragment_handler.rb
151
+ lib/nokogiri/xml/namespace.rb
92
152
  lib/nokogiri/xml/node.rb
93
153
  lib/nokogiri/xml/node/save_options.rb
94
154
  lib/nokogiri/xml/node_set.rb
95
155
  lib/nokogiri/xml/notation.rb
156
+ lib/nokogiri/xml/parse_options.rb
96
157
  lib/nokogiri/xml/processing_instruction.rb
97
158
  lib/nokogiri/xml/reader.rb
159
+ lib/nokogiri/xml/relax_ng.rb
98
160
  lib/nokogiri/xml/sax.rb
99
161
  lib/nokogiri/xml/sax/document.rb
100
162
  lib/nokogiri/xml/sax/parser.rb
101
163
  lib/nokogiri/xml/sax/push_parser.rb
164
+ lib/nokogiri/xml/schema.rb
102
165
  lib/nokogiri/xml/syntax_error.rb
103
- lib/nokogiri/xml/text.rb
104
166
  lib/nokogiri/xml/xpath.rb
105
167
  lib/nokogiri/xml/xpath/syntax_error.rb
106
168
  lib/nokogiri/xml/xpath_context.rb
@@ -112,9 +174,14 @@ test/css/test_nthiness.rb
112
174
  test/css/test_parser.rb
113
175
  test/css/test_tokenizer.rb
114
176
  test/css/test_xpath_visitor.rb
177
+ test/ffi/test_document.rb
178
+ test/files/address_book.rlx
179
+ test/files/address_book.xml
115
180
  test/files/dont_hurt_em_why.xml
116
181
  test/files/exslt.xml
117
182
  test/files/exslt.xslt
183
+ test/files/po.xml
184
+ test/files/po.xsd
118
185
  test/files/staff.xml
119
186
  test/files/staff.xslt
120
187
  test/files/tlm.html
@@ -140,6 +207,8 @@ test/html/sax/test_parser.rb
140
207
  test/html/test_builder.rb
141
208
  test/html/test_document.rb
142
209
  test/html/test_document_encoding.rb
210
+ test/html/test_document_fragment.rb
211
+ test/html/test_element_description.rb
143
212
  test/html/test_named_characters.rb
144
213
  test/html/test_node.rb
145
214
  test/test_convert_xpath.rb
@@ -150,6 +219,7 @@ test/test_nokogiri.rb
150
219
  test/test_reader.rb
151
220
  test/test_xslt_transforms.rb
152
221
  test/xml/node/test_save_options.rb
222
+ test/xml/node/test_subclass.rb
153
223
  test/xml/sax/test_parser.rb
154
224
  test/xml/sax/test_push_parser.rb
155
225
  test/xml/test_attr.rb
@@ -162,11 +232,16 @@ test/xml/test_document_fragment.rb
162
232
  test/xml/test_dtd.rb
163
233
  test/xml/test_dtd_encoding.rb
164
234
  test/xml/test_entity_reference.rb
235
+ test/xml/test_namespace.rb
165
236
  test/xml/test_node.rb
237
+ test/xml/test_node_attributes.rb
166
238
  test/xml/test_node_encoding.rb
167
239
  test/xml/test_node_set.rb
240
+ test/xml/test_parse_options.rb
168
241
  test/xml/test_processing_instruction.rb
169
242
  test/xml/test_reader_encoding.rb
243
+ test/xml/test_relax_ng.rb
244
+ test/xml/test_schema.rb
170
245
  test/xml/test_text.rb
171
246
  test/xml/test_unparented_node.rb
172
247
  test/xml/test_xpath.rb
@@ -4,7 +4,7 @@
4
4
  * http://github.com/tenderlove/nokogiri/wikis
5
5
  * http://github.com/tenderlove/nokogiri/tree/master
6
6
  * http://rubyforge.org/mailman/listinfo/nokogiri-talk
7
- * http://nokogiri.lighthouseapp.com/projects/19607-nokogiri/overview
7
+ * http://github.com/tenderlove/nokogiri/issues
8
8
 
9
9
  == DESCRIPTION:
10
10
 
@@ -12,28 +12,29 @@ Nokogiri はHTMLやXMLやSAXやXSLTやReaderのパーサーです。
12
12
 
13
13
  == FEATURES:
14
14
 
15
- * XPath で探せる
16
- * CSS3 のセレクターで探せる
17
- * XML/HTMLのビルダーはある
15
+ * XPath による探索
16
+ * CSS3 のセレクターによる探索
17
+ * XML/HTMLのビルダー
18
18
 
19
- 検索出来たり、正確にCSS3XPathをサポート出来たりする。
19
+ XML/HTMLの高速な解析と探索検索、ならびにCSS3セレクタとXPathをサポートしています。
20
20
 
21
- これはスピードテストです:
21
+ スピードテスト:
22
22
 
23
23
  * http://gist.github.com/24605
24
24
 
25
- NokogiriはHpricotの代わりに使用出来る。
26
- その互換性は簡単に正しいCSSとXPathを使用する事が出来る。
25
+ また、NokogiriはHpricot互換の特徴を持ち、CSSやXPathも簡単に取り扱うことが出来ます。
27
26
 
28
27
  == SUPPORT:
29
28
 
30
- ノコギリのメーリングリストは:
29
+ Nokogiriのメーリングリスト:
31
30
 
32
31
  * http://rubyforge.org/mailman/listinfo/nokogiri-talk
33
32
 
34
- バグファイルは:
33
+ バグ報告:
35
34
 
36
- * http://nokogiri.lighthouseapp.com/projects/19607-nokogiri/overview
35
+ * http://github.com/tenderlove/nokogiri/issues
36
+
37
+ IRCのチャンネルはfreenodeの #nokogiri です。
37
38
 
38
39
  == SYNOPSIS:
39
40
 
@@ -4,7 +4,7 @@
4
4
  * http://github.com/tenderlove/nokogiri/wikis
5
5
  * http://github.com/tenderlove/nokogiri/tree/master
6
6
  * http://rubyforge.org/mailman/listinfo/nokogiri-talk
7
- * http://nokogiri.lighthouseapp.com/projects/19607-nokogiri/overview
7
+ * http://github.com/tenderlove/nokogiri/issues
8
8
 
9
9
  == DESCRIPTION:
10
10
 
@@ -35,7 +35,9 @@ The Nokogiri mailing list is available here:
35
35
 
36
36
  The bug tracker is available here:
37
37
 
38
- * http://nokogiri.lighthouseapp.com/projects/19607-nokogiri/overview
38
+ * http://github.com/tenderlove/nokogiri/issues
39
+
40
+ The IRC channel is #nokogiri on freenode.
39
41
 
40
42
  == SYNOPSIS:
41
43
 
data/Rakefile CHANGED
@@ -4,17 +4,14 @@ require 'rubygems'
4
4
  require 'rake'
5
5
  require 'hoe'
6
6
 
7
-
8
- kind = Config::CONFIG['DLEXT']
9
- windows = RUBY_PLATFORM =~ /mswin/i ? true : false
10
-
11
7
  LIB_DIR = File.expand_path(File.join(File.dirname(__FILE__), 'lib'))
12
8
  $LOAD_PATH << LIB_DIR
13
9
 
14
- GENERATED_PARSER = "lib/nokogiri/css/generated_parser.rb"
15
- GENERATED_TOKENIZER = "lib/nokogiri/css/generated_tokenizer.rb"
10
+ windows = RUBY_PLATFORM =~ /(mswin|mingw)/i ? true : false
11
+ java = RUBY_PLATFORM =~ /java/ ? true : false
16
12
 
17
- EXT = "ext/nokogiri/native.#{kind}"
13
+ GENERATED_PARSER = "lib/nokogiri/css/generated_parser.rb"
14
+ GENERATED_TOKENIZER = "lib/nokogiri/css/generated_tokenizer.rb"
18
15
 
19
16
  require 'nokogiri/version'
20
17
 
@@ -25,21 +22,65 @@ HOE = Hoe.new('nokogiri', Nokogiri::VERSION) do |p|
25
22
  p.history_file = ['CHANGELOG', ENV['HLANG'], 'rdoc'].compact.join('.')
26
23
  p.extra_rdoc_files = FileList['*.rdoc']
27
24
  p.clean_globs = [
28
- 'ext/nokogiri/Makefile',
29
- 'ext/nokogiri/*.{o,so,bundle,a,log,dll}',
30
- 'ext/nokogiri/conftest.dSYM',
25
+ 'lib/nokogiri/*.{o,so,bundle,a,log,dll}',
31
26
  GENERATED_PARSER,
32
27
  GENERATED_TOKENIZER,
33
28
  'cross',
34
29
  ]
30
+
31
+ p.extra_dev_deps << "racc"
32
+ p.extra_dev_deps << "tenderlove-frex"
33
+ p.extra_dev_deps << "rake-compiler"
34
+
35
35
  p.spec_extras = { :extensions => ["ext/nokogiri/extconf.rb"] }
36
36
  end
37
37
 
38
- namespace :libxml do
39
- desc "What version of LibXML are we building against?"
40
- task :version => :build do
41
- sh "#{RUBY} -Ilib:ext -rnokogiri -e 'puts Nokogiri::LIBXML_VERSION'"
42
- end
38
+ unless java
39
+
40
+ gem 'rake-compiler', '>= 0.4.1'
41
+ require "rake/extensiontask"
42
+
43
+ RET = Rake::ExtensionTask.new("nokogiri", HOE.spec) do |ext|
44
+ ext.lib_dir = File.join(*['lib', 'nokogiri', ENV['FAT_DIR']].compact)
45
+
46
+ ext.config_options << ENV['EXTOPTS']
47
+ cross_dir = File.join(File.dirname(__FILE__), 'tmp', 'cross')
48
+ ext.cross_compile = true
49
+ ext.cross_platform = 'i386-mswin32'
50
+ ext.cross_config_options <<
51
+ "--with-iconv-dir=#{File.join(cross_dir, 'iconv')}"
52
+ ext.cross_config_options <<
53
+ "--with-xml2-dir=#{File.join(cross_dir, 'libxml2')}"
54
+ ext.cross_config_options <<
55
+ "--with-xslt-dir=#{File.join(cross_dir, 'libxslt')}"
56
+ end
57
+
58
+ ###
59
+ # To build the windows fat binary, do:
60
+ #
61
+ # rake fat_binary native gem
62
+ #
63
+ # I keep my ruby in multiruby, so my command is like this:
64
+ #
65
+ # RAKE19=~/.multiruby/install/1.9.1-p129/bin/rake \
66
+ # rake fat_binary native gem
67
+ task 'fat_binary' do
68
+ rake19 = ENV['RAKE19'] || 'rake1.9'
69
+ system("rake clean cross compile RUBY_CC_VERSION=1.8.6 FAT_DIR=1.8")
70
+ system("#{rake19} clean cross compile RUBY_CC_VERSION=1.9.1 FAT_DIR=1.9")
71
+ File.open("lib/#{HOE.name}/#{HOE.name}.rb", 'wb') do |f|
72
+ f.write <<-eoruby
73
+ require "#{HOE.name}/\#{RUBY_VERSION.sub(/\\.\\d+$/, '')}/#{HOE.name}"
74
+ eoruby
75
+ end
76
+ HOE.spec.extensions = []
77
+ HOE.spec.platform = 'i386-mingw32'
78
+ HOE.spec.files += Dir["lib/#{HOE.name}/#{HOE.name}.rb"]
79
+ HOE.spec.files += Dir["lib/#{HOE.name}/1.{8,9}/*"]
80
+ HOE.spec.files += Dir["ext/nokogiri/*.dll"]
81
+ end
82
+ CLOBBER.include("lib/nokogiri/nokogiri.rb")
83
+ CLOBBER.include("lib/nokogiri/1.{8,9}")
43
84
  end
44
85
 
45
86
  namespace :gem do
@@ -52,23 +93,15 @@ namespace :gem do
52
93
  end
53
94
  end
54
95
 
55
- namespace :win32 do
56
- task :spec => ['build:win32'] do
57
- File.open("#{HOE.name}.gemspec", 'w') do |f|
58
- HOE.spec.files += Dir['ext/nokogiri/**.{dll,so}']
59
- if windows
60
- HOE.spec.platform = Gem::Platform::CURRENT
61
- else
62
- HOE.spec.platform = 'x86-mswin32-60'
63
- end
64
- HOE.spec.extensions = []
65
- f.write(HOE.spec.to_ruby)
66
- end
67
- end
96
+ desc "Build a gem targetted for JRuby"
97
+ task :jruby => ['gem:jruby:spec'] do
98
+ system "gem build nokogiri.gemspec"
99
+ FileUtils.mkdir_p "pkg"
100
+ FileUtils.mv Dir.glob("nokogiri*-java.gem"), "pkg"
68
101
  end
69
102
 
70
103
  namespace :jruby do
71
- task :spec => ['build'] do
104
+ task :spec => [GENERATED_PARSER, GENERATED_TOKENIZER] do
72
105
  File.open("#{HOE.name}.gemspec", 'w') do |f|
73
106
  HOE.spec.platform = 'java'
74
107
  HOE.spec.files << GENERATED_PARSER
@@ -79,14 +112,6 @@ namespace :gem do
79
112
  end
80
113
  end
81
114
 
82
- namespace :unix do
83
- task :spec do
84
- File.open("#{HOE.name}.gemspec", 'w') do |f|
85
- f.write(HOE.spec.to_ruby)
86
- end
87
- end
88
- end
89
-
90
115
  task :spec => ['gem:dev:spec']
91
116
  end
92
117
 
@@ -104,140 +129,44 @@ file GENERATED_TOKENIZER => "lib/nokogiri/css/tokenizer.rex" do |t|
104
129
  begin
105
130
  sh "frex --independent -o #{t.name} #{t.prerequisites.first}"
106
131
  rescue
107
- abort "need frex, sudo gem install tenderlove-frex -s http://gems.github.com"
108
- end
109
- end
110
-
111
- task 'ext/nokogiri/Makefile' do
112
- Dir.chdir('ext/nokogiri') do
113
- ruby "extconf.rb #{ENV['EXTOPTS']}"
132
+ abort "need frex, sudo gem install tenderlove-frex -s http://gems.github.com"
114
133
  end
115
134
  end
116
135
 
117
- task EXT => 'ext/nokogiri/Makefile' do
118
- Dir.chdir('ext/nokogiri') do
119
- sh 'make'
120
- end
121
- end
122
-
123
- if RUBY_PLATFORM == 'java'
124
- task :build => [GENERATED_PARSER, GENERATED_TOKENIZER]
125
- else
126
- task :build => [EXT, GENERATED_PARSER, GENERATED_TOKENIZER]
127
- end
128
-
129
- namespace :build do
130
- namespace :win32 do
131
- file 'cross/bin/ruby.exe' => ['cross/ruby-1.8.6-p287'] do
132
- Dir.chdir('cross/ruby-1.8.6-p287') do
133
- str = ''
134
- File.open('Makefile.in', 'rb') do |f|
135
- f.each_line do |line|
136
- if line =~ /^\s*ALT_SEPARATOR =/
137
- str += "\t\t " + 'ALT_SEPARATOR = "\\\\\"; \\'
138
- str += "\n"
139
- else
140
- str += line
141
- end
142
- end
143
- end
144
- File.open('Makefile.in', 'wb') { |f| f.write str }
145
- buildopts = if File.exists?('/usr/bin/i586-mingw32msvc-gcc')
146
- "--host=i586-mingw32msvc --target=i386-mingw32 --build=i686-linux"
147
- else
148
- "--host=i386-mingw32 --target=i386-mingw32"
149
- end
150
- sh(<<-eocommand)
151
- env ac_cv_func_getpgrp_void=no \
152
- ac_cv_func_setpgrp_void=yes \
153
- rb_cv_negative_time_t=no \
154
- ac_cv_func_memcmp_working=yes \
155
- rb_cv_binary_elf=no \
156
- ./configure \
157
- #{buildopts} \
158
- --prefix=#{File.expand_path(File.join(Dir.pwd, '..'))}
159
- eocommand
160
- sh 'make'
161
- sh 'make install'
162
- end
163
- end
164
-
165
- desc 'build cross compiled ruby'
166
- task :ruby => 'cross/bin/ruby.exe'
167
- end
168
-
169
- desc 'build nokogiri for win32'
170
- task :win32 => [GENERATED_PARSER, GENERATED_TOKENIZER, 'build:externals', 'build:win32:ruby'] do
171
- dash_i = File.expand_path(
172
- File.join(File.dirname(__FILE__), 'cross/lib/ruby/1.8/i386-mingw32/')
173
- )
174
-
175
- xml2_lib =
176
- File.join(File.dirname(__FILE__), 'cross/libxml2-2.7.3.win32/bin')
177
- xml2_inc =
178
- File.join(File.dirname(__FILE__), 'cross/libxml2-2.7.3.win32/include')
179
-
180
- xslt_lib =
181
- File.join(File.dirname(__FILE__), 'cross/libxslt-1.1.24.win32/bin')
182
- xslt_inc =
183
- File.join(File.dirname(__FILE__), 'cross/libxslt-1.1.24.win32/include')
184
-
185
- Dir.chdir('ext/nokogiri') do
186
- ruby " -I #{dash_i} extconf.rb --with-xml2-lib=#{xml2_lib} --with-xml2-include=#{xml2_inc} --with-xslt-lib=#{xslt_lib} --with-xslt-include=#{xslt_inc}"
187
- sh 'make'
188
- end
189
- dlls = Dir[File.join(File.dirname(__FILE__), 'cross', '**/*.dll')]
190
- dlls.each do |dll|
191
- next if dll =~ /ruby/
192
- cp dll, 'ext/nokogiri'
193
- end
194
- end
195
-
196
- libs = %w{
197
- iconv-1.9.2.win32
198
- zlib-1.2.3.win32
199
- libxml2-2.7.3.win32
200
- libxslt-1.1.24.win32
201
- }
202
-
203
- libs.each do |lib|
204
- file "stash/#{lib}.zip" do |t|
205
- puts "downloading #{lib}"
206
- FileUtils.mkdir_p('stash')
207
- Dir.chdir('stash') do
208
- url = "http://www.zlatkovic.com/pub/libxml/#{lib}.zip"
209
- system("wget #{url} || curl -O #{url}")
210
- end
211
- end
212
- file "cross/#{lib}" => ["stash/#{lib}.zip"] do |t|
213
- puts "unzipping #{lib}.zip"
214
- FileUtils.mkdir_p('cross')
215
- Dir.chdir('cross') do
216
- sh "unzip ../stash/#{lib}.zip"
217
- sh "touch #{lib}"
218
- end
219
- end
220
- end
221
-
222
- file "stash/ruby-1.8.6-p287.tar.gz" do |t|
223
- puts "downloading ruby"
224
- FileUtils.mkdir_p('stash')
225
- Dir.chdir('stash') do
226
- url = ("ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p287.tar.gz")
136
+ libs = %w{
137
+ iconv-1.9.2.win32
138
+ zlib-1.2.3.win32
139
+ libxml2-2.7.3.win32
140
+ libxslt-1.1.24.win32
141
+ }
142
+
143
+ libs.each do |lib|
144
+ file "tmp/stash/#{lib}.zip" do |t|
145
+ puts "downloading #{lib}"
146
+ FileUtils.mkdir_p('tmp/stash')
147
+ Dir.chdir('tmp/stash') do
148
+ url = "ftp://ftp.xmlsoft.org/libxml2/win32/#{lib}.zip"
227
149
  system("wget #{url} || curl -O #{url}")
228
150
  end
229
151
  end
230
- file 'cross/ruby-1.8.6-p287' => ["stash/ruby-1.8.6-p287.tar.gz"] do |t|
231
- puts "unzipping ruby"
232
- FileUtils.mkdir_p('cross')
233
- Dir.chdir('cross') do
234
- sh "tar zxvf ../stash/ruby-1.8.6-p287.tar.gz"
152
+ file "tmp/cross/#{lib.split('-').first}" => ["tmp/stash/#{lib}.zip"] do |t|
153
+ puts "unzipping #{lib}.zip"
154
+ FileUtils.mkdir_p('tmp/cross')
155
+ Dir.chdir('tmp/cross') do
156
+ sh "unzip ../stash/#{lib}.zip"
157
+ sh "cp #{lib}/bin/* #{lib}/lib" # put DLL in lib, so dirconfig works
158
+ sh "cp #{lib}/bin/*.dll ../../ext/nokogiri/"
159
+ sh "mv #{lib} #{lib.split('-').first}"
160
+ sh "touch #{lib.split('-').first}"
235
161
  end
236
162
  end
237
-
238
- task :externals => libs.map { |x| "cross/#{x}" } + ['cross/ruby-1.8.6-p287']
163
+ if Rake::Task.task_defined?(:cross)
164
+ Rake::Task[:cross].prerequisites << "tmp/cross/#{lib.split('-').first}"
165
+ end
239
166
  end
240
167
 
168
+ require 'tasks/test'
169
+
241
170
  desc "set environment variables to build and/or test with debug options"
242
171
  task :debug do
243
172
  ENV['NOKOGIRI_DEBUG'] = "true"
@@ -245,12 +174,20 @@ task :debug do
245
174
  ENV['CFLAGS'] += " -DDEBUG"
246
175
  end
247
176
 
248
- require 'tasks/test'
177
+ # required_ruby_version
249
178
 
250
- Rake::Task['test:valgrind'].prerequisites << :build
251
- Rake::Task['test:valgrind_mem'].prerequisites << :build
252
- Rake::Task['test:valgrind_mem0'].prerequisites << :build
253
- Rake::Task['test:coverage'].prerequisites << :build
179
+ # Only do this on unix, since we can't build on windows
180
+ unless windows || java || ENV['NOKOGIRI_FFI']
181
+ [:compile, :check_manifest].each do |task_name|
182
+ Rake::Task[task_name].prerequisites << GENERATED_PARSER
183
+ Rake::Task[task_name].prerequisites << GENERATED_TOKENIZER
184
+ end
185
+
186
+ Rake::Task[:test].prerequisites << :compile
187
+ ['valgrind', 'valgrind_mem', 'valgrind_mem0', 'coverage'].each do |task_name|
188
+ Rake::Task["test:#{task_name}"].prerequisites << :compile
189
+ end
190
+ end
254
191
 
255
192
  namespace :install do
256
193
  desc "Install frex and racc for development"
@@ -265,11 +202,4 @@ namespace :install do
265
202
  end
266
203
  end
267
204
 
268
- # Only do this on unix, since we can't build on windows
269
- unless windows
270
- Rake::Task[:test].prerequisites << :build
271
- Rake::Task[:check_manifest].prerequisites << GENERATED_PARSER
272
- Rake::Task[:check_manifest].prerequisites << GENERATED_TOKENIZER
273
- end
274
-
275
205
  # vim: syntax=Ruby