nokogiri 1.4.7-x86-mingw32 → 1.5.0-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.

Files changed (132) hide show
  1. data/CHANGELOG.ja.rdoc +59 -1
  2. data/CHANGELOG.rdoc +51 -2
  3. data/Manifest.txt +66 -66
  4. data/README.ja.rdoc +4 -0
  5. data/README.rdoc +31 -3
  6. data/Rakefile +111 -135
  7. data/bin/nokogiri +1 -2
  8. data/ext/nokogiri/extconf.rb +9 -3
  9. data/ext/nokogiri/nokogiri.c +21 -3
  10. data/ext/nokogiri/nokogiri.h +0 -2
  11. data/ext/nokogiri/xml_node.c +0 -6
  12. data/ext/nokogiri/xml_relax_ng.c +0 -7
  13. data/ext/nokogiri/xml_sax_parser.c +9 -4
  14. data/ext/nokogiri/xslt_stylesheet.c +5 -1
  15. data/lib/nokogiri.rb +19 -25
  16. data/lib/nokogiri/1.8/nokogiri.so +0 -0
  17. data/lib/nokogiri/1.9/nokogiri.so +0 -0
  18. data/lib/nokogiri/css.rb +0 -1
  19. data/lib/nokogiri/html.rb +1 -0
  20. data/lib/nokogiri/html/document.rb +9 -2
  21. data/lib/nokogiri/html/element_description_defaults.rb +671 -0
  22. data/lib/nokogiri/version.rb +76 -31
  23. data/lib/nokogiri/xml/attribute_decl.rb +1 -1
  24. data/lib/nokogiri/xml/builder.rb +7 -0
  25. data/lib/nokogiri/xml/document.rb +17 -1
  26. data/lib/nokogiri/xml/document_fragment.rb +14 -0
  27. data/lib/nokogiri/xml/dtd.rb +1 -1
  28. data/lib/nokogiri/xml/element_decl.rb +1 -1
  29. data/lib/nokogiri/xml/entity_decl.rb +1 -1
  30. data/lib/nokogiri/xml/node.rb +39 -15
  31. data/lib/nokogiri/xml/node/save_options.rb +14 -5
  32. data/lib/nokogiri/xml/node_set.rb +7 -0
  33. data/lib/nokogiri/xml/reader.rb +2 -2
  34. data/lib/nokogiri/xml/sax/document.rb +2 -2
  35. data/lib/nokogiri/xslt/stylesheet.rb +1 -1
  36. data/nokogiri_help_responses.md +40 -0
  37. data/tasks/cross_compile.rb +134 -155
  38. data/tasks/nokogiri.org.rb +18 -0
  39. data/tasks/test.rb +2 -2
  40. data/test/files/metacharset.html +10 -0
  41. data/test/files/noencoding.html +47 -0
  42. data/test/helper.rb +2 -1
  43. data/test/html/sax/test_parser.rb +22 -5
  44. data/test/html/test_document.rb +21 -2
  45. data/test/html/test_document_encoding.rb +9 -1
  46. data/test/html/test_document_fragment.rb +5 -3
  47. data/test/html/test_element_description.rb +4 -2
  48. data/test/test_memory_leak.rb +4 -39
  49. data/test/test_nokogiri.rb +14 -20
  50. data/test/test_reader.rb +12 -8
  51. data/test/xml/node/test_save_options.rb +10 -2
  52. data/test/xml/sax/test_parser.rb +14 -7
  53. data/test/xml/test_attribute_decl.rb +7 -3
  54. data/test/xml/test_builder.rb +17 -0
  55. data/test/xml/test_document.rb +31 -4
  56. data/test/xml/test_dtd.rb +13 -3
  57. data/test/xml/test_element_content.rb +1 -1
  58. data/test/xml/test_element_decl.rb +1 -1
  59. data/test/xml/test_entity_decl.rb +12 -10
  60. data/test/xml/test_namespace.rb +7 -5
  61. data/test/xml/test_node.rb +21 -10
  62. data/test/xml/test_node_reparenting.rb +16 -3
  63. data/test/xml/test_node_set.rb +34 -0
  64. data/test/xslt/test_custom_functions.rb +2 -2
  65. data/test/xslt/test_exception_handling.rb +37 -0
  66. metadata +110 -88
  67. data/lib/nokogiri/ffi/encoding_handler.rb +0 -42
  68. data/lib/nokogiri/ffi/html/document.rb +0 -28
  69. data/lib/nokogiri/ffi/html/element_description.rb +0 -81
  70. data/lib/nokogiri/ffi/html/entity_lookup.rb +0 -16
  71. data/lib/nokogiri/ffi/html/sax/parser_context.rb +0 -38
  72. data/lib/nokogiri/ffi/io_callbacks.rb +0 -42
  73. data/lib/nokogiri/ffi/libxml.rb +0 -420
  74. data/lib/nokogiri/ffi/structs/common_node.rb +0 -38
  75. data/lib/nokogiri/ffi/structs/html_elem_desc.rb +0 -24
  76. data/lib/nokogiri/ffi/structs/html_entity_desc.rb +0 -13
  77. data/lib/nokogiri/ffi/structs/xml_alloc.rb +0 -16
  78. data/lib/nokogiri/ffi/structs/xml_attr.rb +0 -20
  79. data/lib/nokogiri/ffi/structs/xml_attribute.rb +0 -27
  80. data/lib/nokogiri/ffi/structs/xml_buffer.rb +0 -16
  81. data/lib/nokogiri/ffi/structs/xml_char_encoding_handler.rb +0 -11
  82. data/lib/nokogiri/ffi/structs/xml_document.rb +0 -117
  83. data/lib/nokogiri/ffi/structs/xml_dtd.rb +0 -28
  84. data/lib/nokogiri/ffi/structs/xml_element.rb +0 -26
  85. data/lib/nokogiri/ffi/structs/xml_element_content.rb +0 -17
  86. data/lib/nokogiri/ffi/structs/xml_entity.rb +0 -32
  87. data/lib/nokogiri/ffi/structs/xml_enumeration.rb +0 -12
  88. data/lib/nokogiri/ffi/structs/xml_node.rb +0 -28
  89. data/lib/nokogiri/ffi/structs/xml_node_set.rb +0 -53
  90. data/lib/nokogiri/ffi/structs/xml_notation.rb +0 -11
  91. data/lib/nokogiri/ffi/structs/xml_ns.rb +0 -15
  92. data/lib/nokogiri/ffi/structs/xml_parser_context.rb +0 -20
  93. data/lib/nokogiri/ffi/structs/xml_parser_input.rb +0 -19
  94. data/lib/nokogiri/ffi/structs/xml_relax_ng.rb +0 -14
  95. data/lib/nokogiri/ffi/structs/xml_sax_handler.rb +0 -51
  96. data/lib/nokogiri/ffi/structs/xml_sax_push_parser_context.rb +0 -124
  97. data/lib/nokogiri/ffi/structs/xml_schema.rb +0 -13
  98. data/lib/nokogiri/ffi/structs/xml_syntax_error.rb +0 -31
  99. data/lib/nokogiri/ffi/structs/xml_text_reader.rb +0 -12
  100. data/lib/nokogiri/ffi/structs/xml_xpath_context.rb +0 -38
  101. data/lib/nokogiri/ffi/structs/xml_xpath_object.rb +0 -35
  102. data/lib/nokogiri/ffi/structs/xml_xpath_parser_context.rb +0 -20
  103. data/lib/nokogiri/ffi/structs/xslt_stylesheet.rb +0 -13
  104. data/lib/nokogiri/ffi/weak_bucket.rb +0 -40
  105. data/lib/nokogiri/ffi/xml/attr.rb +0 -41
  106. data/lib/nokogiri/ffi/xml/attribute_decl.rb +0 -27
  107. data/lib/nokogiri/ffi/xml/cdata.rb +0 -19
  108. data/lib/nokogiri/ffi/xml/comment.rb +0 -18
  109. data/lib/nokogiri/ffi/xml/document.rb +0 -174
  110. data/lib/nokogiri/ffi/xml/document_fragment.rb +0 -21
  111. data/lib/nokogiri/ffi/xml/dtd.rb +0 -67
  112. data/lib/nokogiri/ffi/xml/element_content.rb +0 -43
  113. data/lib/nokogiri/ffi/xml/element_decl.rb +0 -19
  114. data/lib/nokogiri/ffi/xml/entity_decl.rb +0 -36
  115. data/lib/nokogiri/ffi/xml/entity_reference.rb +0 -19
  116. data/lib/nokogiri/ffi/xml/namespace.rb +0 -44
  117. data/lib/nokogiri/ffi/xml/node.rb +0 -559
  118. data/lib/nokogiri/ffi/xml/node_set.rb +0 -150
  119. data/lib/nokogiri/ffi/xml/processing_instruction.rb +0 -20
  120. data/lib/nokogiri/ffi/xml/reader.rb +0 -236
  121. data/lib/nokogiri/ffi/xml/relax_ng.rb +0 -85
  122. data/lib/nokogiri/ffi/xml/sax/parser.rb +0 -143
  123. data/lib/nokogiri/ffi/xml/sax/parser_context.rb +0 -79
  124. data/lib/nokogiri/ffi/xml/sax/push_parser.rb +0 -51
  125. data/lib/nokogiri/ffi/xml/schema.rb +0 -109
  126. data/lib/nokogiri/ffi/xml/syntax_error.rb +0 -98
  127. data/lib/nokogiri/ffi/xml/text.rb +0 -18
  128. data/lib/nokogiri/ffi/xml/xpath.rb +0 -9
  129. data/lib/nokogiri/ffi/xml/xpath_context.rb +0 -153
  130. data/lib/nokogiri/ffi/xslt/stylesheet.rb +0 -77
  131. data/lib/nokogiri/version_warning.rb +0 -14
  132. data/test/ffi/test_document.rb +0 -35
@@ -8,7 +8,7 @@ module Nokogiri
8
8
  # The basic way a SAX style parser works is by creating a parser,
9
9
  # telling the parser about the events we're interested in, then giving
10
10
  # the parser some XML to process. The parser will notify you when
11
- # it encounters events you said you would like to know about.
11
+ # it encounters events your said you would like to know about.
12
12
  #
13
13
  # To register for events, you simply subclass Nokogiri::XML::SAX::Document,
14
14
  # and implement the methods for which you would like notification.
@@ -36,7 +36,7 @@ module Nokogiri
36
36
  # parser.parse(File.read(ARGV[0], 'rb'))
37
37
  #
38
38
  # Now my document handler will be called when each node starts, and when
39
- # the document ends. To see what kinds of events are available, take
39
+ # then document ends. To see what kinds of events are available, take
40
40
  # a look at Nokogiri::XML::SAX::Document.
41
41
  #
42
42
  # Two SAX parsers for XML are available, a parser that reads from a string
@@ -6,7 +6,7 @@ module Nokogiri
6
6
  # an XML::Document with a Stylesheet:
7
7
  #
8
8
  # doc = Nokogiri::XML(File.read('some_file.xml'))
9
- # xslt = Nokogir::XSLT(File.read('some_transformer.xslt'))
9
+ # xslt = Nokogiri::XSLT(File.read('some_transformer.xslt'))
10
10
  #
11
11
  # puts xslt.transform(doc)
12
12
  #
@@ -0,0 +1,40 @@
1
+ # not-enough-information
2
+
3
+ Hello!
4
+
5
+ Thanks for asking this question! However, without more information,
6
+ Team Nokogiri cannot reproduce your issue, and so we cannot offer much
7
+ help.
8
+
9
+ Please provide us with:
10
+
11
+ * A self-contained script (one that we can run without modification,
12
+ and preferably without making external network connections).
13
+
14
+ * Please note that you need to include the XML/HTML that you are
15
+ operating on.
16
+
17
+ * The output of `nokogiri -v`, which will provide details about your
18
+ platform and versions of ruby, libxml2 and nokogiri.
19
+
20
+ For more information about requesting help or reporting bugs, please
21
+ take a look at http://bit.ly/nokohelp
22
+
23
+ Thank you so much!
24
+
25
+ # not-a-bug
26
+
27
+ Hello!
28
+
29
+ Thanks for asking this question! Your request for help will not go
30
+ unanswered!
31
+
32
+ However, Nokogiri's Github Issues is reserved for reporting bugs or
33
+ submitting patches. If you ask your question on the mailing list, Team
34
+ Nokogiri promises someone will provide you with an answer in a timely
35
+ manner.
36
+
37
+ If you'd like to read up on Team Nokogiri's rationale for this policy,
38
+ please go to http://bit.ly/nokohelp.
39
+
40
+ Thank you so much for understanding! And thank you for using Nokogiri.
@@ -1,173 +1,152 @@
1
1
  require 'rake/extensioncompiler'
2
2
  HOST = Rake::ExtensionCompiler.mingw_host
3
- TARGET = 'i386-pc-mingw32'
4
3
 
5
- ZLIB = 'zlib-1.2.5'
6
- ICONV = 'libiconv-1.13.1'
7
- LIBXML = 'libxml2-2.7.7'
8
- LIBXSLT = 'libxslt-1.1.26'
9
- RAKE_COMPILER_PKGCONFIG = File.expand_path(File.join(Dir.pwd, "tmp/cross/lib/pkgconfig/"))
4
+ require 'mini_portile'
5
+ $recipes = {}
6
+ $recipes[:zlib] = MiniPortile.new "zlib", "1.2.5"
7
+ $recipes[:libiconv] = MiniPortile.new "libiconv", "1.13.1"
8
+ $recipes[:libxml2] = MiniPortile.new "libxml2", "2.7.7"
9
+ $recipes[:libxslt] = MiniPortile.new "libxslt", "1.1.26"
10
+ $recipes.each { |_, recipe| recipe.host = HOST }
10
11
 
11
- ### Build zlib ###
12
- file "tmp/cross/download/#{ZLIB}" do |t|
13
- FileUtils.mkdir_p('tmp/cross/download')
14
-
15
- file = ZLIB
16
- url = "http://zlib.net/#{file}.tar.gz"
17
-
18
- Dir.chdir('tmp/cross/download') do
19
- sh "wget #{url} || curl -O #{url}"
20
- sh "tar zxvf #{file}.tar.gz"
21
- end
22
-
23
- Dir.chdir t.name do
24
- mk = File.read('win32/Makefile.gcc')
25
- File.open('win32/Makefile.gcc', 'wb') do |f|
26
- f.puts "BINARY_PATH = #{CROSS_DIR}/bin"
27
- f.puts "LIBRARY_PATH = #{CROSS_DIR}/lib"
28
- f.puts "INCLUDE_PATH = #{CROSS_DIR}/include"
29
-
30
- f.puts mk.sub(/^PREFIX\s*=\s*$/, "PREFIX = #{HOST}-") #.
31
- #sub(/^SHARED_MODE=0$/, 'SHARED_MODE=1').
32
- #sub(/^IMPLIB\s*=.*$/, 'IMPLIB=libz.dll.a')
33
- end
34
- end
35
- end
36
-
37
- file 'tmp/cross/lib/libz.a' => "tmp/cross/download/#{ZLIB}" do |t|
38
- Dir.chdir t.prerequisites.first do
39
- sh 'make -f win32/Makefile.gcc'
40
- sh 'make -f win32/Makefile.gcc install'
41
- end
42
- end
43
- ### End build zlib ###
44
-
45
- ### Build iconv ###
46
- file "tmp/cross/download/#{ICONV}" do |t|
47
- FileUtils.mkdir_p('tmp/cross/download')
48
-
49
- file = ICONV
50
- url = "http://ftp.gnu.org/pub/gnu/libiconv/#{file}.tar.gz"
51
-
52
- Dir.chdir('tmp/cross/download') do
53
- sh "wget #{url} || curl -O #{url}"
54
- sh "tar zxvf #{file}.tar.gz"
55
- end
56
-
57
- Dir.chdir t.name do
58
- sh "./configure --disable-shared --enable-static --host=#{HOST} --target=#{TARGET} --prefix=#{CROSS_DIR} CPPFLAGS='-mno-cygwin -Wall' CFLAGS='-mno-cygwin -O2 -g' CXXFLAGS='-mno-cygwin -O2 -g' LDFLAGS=-mno-cygwin"
59
- end
60
- end
61
-
62
- file 'tmp/cross/bin/iconv.exe' => "tmp/cross/download/#{ICONV}" do |t|
63
- Dir.chdir t.prerequisites.first do
64
- sh 'make'
65
- sh 'make install'
66
- end
67
- end
68
- ### End build iconv ###
69
-
70
- ### Build libxml2 ###
71
- file "tmp/cross/download/#{LIBXML}" do |t|
72
- FileUtils.mkdir_p('tmp/cross/download')
73
-
74
- file = LIBXML
75
- url = "ftp://ftp.xmlsoft.org/libxml2/#{file}.tar.gz"
76
-
77
- Dir.chdir('tmp/cross/download') do
78
- sh "wget #{url} || curl -O #{url}"
79
- sh "tar zxvf #{file}.tar.gz"
80
- end
81
-
82
- Dir.chdir t.name do
83
- sh "CFLAGS='-DIN_LIBXML' ./configure --host=#{HOST} --target=#{TARGET} --enable-static --disable-shared --prefix=#{CROSS_DIR} --with-zlib=#{CROSS_DIR} --with-iconv=#{CROSS_DIR} --without-python --without-readline"
12
+ file "lib/nokogiri/nokogiri.rb" do
13
+ File.open("lib/nokogiri/nokogiri.rb", 'wb') do |f|
14
+ f.write %Q{require "nokogiri/\#{RUBY_VERSION.sub(/\\.\\d+$/, '')}/nokogiri"\n}
84
15
  end
85
16
  end
86
17
 
87
- file 'tmp/cross/bin/xml2-config' => "tmp/cross/download/#{LIBXML}" do |t|
88
- Dir.chdir t.prerequisites.first do
89
- sh 'make LDFLAGS="-avoid-version"'
90
- sh 'make install'
91
- end
92
- end
93
- ### End build libxml2 ###
94
-
95
- ### Build libxslt ###
96
- file "tmp/cross/download/#{LIBXSLT}" do |t|
97
- FileUtils.mkdir_p('tmp/cross/download')
98
-
99
- file = LIBXSLT
100
- url = "ftp://ftp.xmlsoft.org/libxml2/#{file}.tar.gz"
101
-
102
- Dir.chdir('tmp/cross/download') do
103
- sh "wget #{url} || curl -O #{url}"
104
- sh "tar zxvf #{file}.tar.gz"
105
- end
106
-
107
- Dir.chdir t.name do
108
- sh "CFLAGS='-DIN_LIBXML' ./configure --host=#{HOST} --target=#{TARGET} --enable-static --disable-shared --prefix=#{CROSS_DIR} --with-libxml-prefix=#{CROSS_DIR} --without-python --without-crypto"
109
- end
110
- end
18
+ namespace :cross do
19
+ task :zlib do
20
+ recipe = $recipes[:zlib]
21
+ recipe.files = ["http://zlib.net/#{recipe.name}-#{recipe.version}.tar.gz"]
22
+ class << recipe
23
+ def configure
24
+ Dir.chdir work_path do
25
+ mk = File.read 'win32/Makefile.gcc'
26
+ File.open 'win32/Makefile.gcc', 'wb' do |f|
27
+ f.puts "BINARY_PATH = #{CROSS_DIR}/bin"
28
+ f.puts "LIBRARY_PATH = #{CROSS_DIR}/lib"
29
+ f.puts "INCLUDE_PATH = #{CROSS_DIR}/include"
30
+ f.puts mk.sub(/^PREFIX\s*=\s*$/, "PREFIX = #{HOST}-")
31
+ end
32
+ end
33
+ end
34
+
35
+ def configured?
36
+ Dir.chdir work_path do
37
+ !! (File.read('win32/Makefile.gcc') =~ /^BINARY_PATH/)
38
+ end
39
+ end
40
+
41
+ def compile
42
+ execute "compile", "make -f win32/Makefile.gcc"
43
+ end
44
+
45
+ def install
46
+ execute "install", "make -f win32/Makefile.gcc install"
47
+ end
48
+ end
111
49
 
112
- file 'tmp/cross/bin/xslt-config' => "tmp/cross/download/#{LIBXSLT}" do |t|
113
- Dir.chdir t.prerequisites.first do
114
- sh 'make LDFLAGS="-avoid-version"'
115
- sh 'make install'
116
- end
117
- end
118
- ### End build libxslt ###
50
+ checkpoint = "#{CROSS_DIR}/#{recipe.name}-#{recipe.version}.installed"
51
+ unless File.exist?(checkpoint)
52
+ recipe.cook
53
+ touch checkpoint
54
+ end
55
+ recipe.activate
56
+ end
57
+
58
+ task :libiconv do
59
+ recipe = $recipes[:libiconv]
60
+ recipe.files = ["http://ftp.gnu.org/pub/gnu/libiconv/#{recipe.name}-#{recipe.version}.tar.gz"]
61
+ recipe.configure_options = [
62
+ "--host=#{HOST}",
63
+ "--enable-static",
64
+ "--disable-shared",
65
+ "CPPFLAGS='-mno-cygwin -Wall'",
66
+ "CFLAGS='-mno-cygwin -O2 -g'",
67
+ "CXXFLAGS='-mno-cygwin -O2 -g'",
68
+ "LDFLAGS=-mno-cygwin"
69
+ ]
70
+
71
+ checkpoint = "#{CROSS_DIR}/#{recipe.name}-#{recipe.version}.installed"
72
+ unless File.exist?(checkpoint)
73
+ recipe.cook
74
+ touch checkpoint
75
+ end
76
+ recipe.activate
77
+ end
78
+
79
+ task :libxml2 => ["cross:zlib", "cross:libiconv"] do
80
+ recipe = $recipes[:libxml2]
81
+ recipe.files = ["ftp://ftp.xmlsoft.org/libxml2/#{recipe.name}-#{recipe.version}.tar.gz"]
82
+ recipe.configure_options = [
83
+ "--host=#{HOST}",
84
+ "--enable-static",
85
+ "--disable-shared",
86
+ "--with-zlib=#{CROSS_DIR}",
87
+ "--with-iconv=#{$recipes[:libiconv].path}",
88
+ "--without-python",
89
+ "--without-readline",
90
+ "CFLAGS='-DIN_LIBXML'"
91
+ ]
92
+ class << recipe
93
+ def download
94
+ Dir.chdir archives_path do
95
+ @files.each do |url|
96
+ sh "wget #{url} || curl -O #{url}"
97
+ end
98
+ end
99
+ end
100
+ end
119
101
 
120
- file 'lib/nokogiri/nokogiri.rb' => 'cross:check' do
121
- File.open("lib/#{HOE.name}/#{HOE.name}.rb", 'wb') do |f|
122
- f.write <<-eoruby
123
- require "#{HOE.name}/\#{RUBY_VERSION.sub(/\\.\\d+$/, '')}/#{HOE.name}"
124
- eoruby
125
- end
126
- end
102
+ checkpoint = "#{CROSS_DIR}/#{recipe.name}-#{recipe.version}.installed"
103
+ unless File.exist?(checkpoint)
104
+ recipe.cook
105
+ touch checkpoint
106
+ end
107
+ recipe.activate
108
+ end
109
+
110
+ task :libxslt => ['cross:libxml2'] do
111
+ recipe = $recipes[:libxslt]
112
+ recipe.files = ["ftp://ftp.xmlsoft.org/libxml2/#{recipe.name}-#{recipe.version}.tar.gz"]
113
+ recipe.configure_options = [
114
+ "--host=#{HOST}",
115
+ "--enable-static",
116
+ "--disable-shared",
117
+ "--with-libxml-prefix=#{$recipes[:libxml2].path}",
118
+ "--without-python",
119
+ "--without-crypto",
120
+ "CFLAGS='-DIN_LIBXML'"
121
+ ]
122
+ class << recipe
123
+ def download
124
+ Dir.chdir archives_path do
125
+ @files.each do |url|
126
+ sh "wget #{url} || curl -O #{url}"
127
+ end
128
+ end
129
+ end
130
+ end
127
131
 
128
- namespace :cross do
129
- task :iconv => 'tmp/cross/bin/iconv.exe'
130
- task :zlib => 'tmp/cross/lib/libz.a'
131
- task :libxml2 => ['cross:zlib', 'cross:iconv', 'tmp/cross/bin/xml2-config']
132
- task :libxslt => ['cross:libxml2', 'tmp/cross/bin/xslt-config']
133
-
134
- task :check => ["cross:libxslt"] do
135
- unless File.directory?(RAKE_COMPILER_PKGCONFIG)
136
- raise RuntimeError.new("looks like rake-compiler changed where pkgconfig info is kept. (#{RAKE_COMPILER_PKGCONFIG})")
132
+ checkpoint = "#{CROSS_DIR}/#{recipe.name}-#{recipe.version}.installed"
133
+ unless File.exist?(checkpoint)
134
+ recipe.cook
135
+ touch checkpoint
137
136
  end
137
+ recipe.activate
138
138
  end
139
139
 
140
140
  task :file_list do
141
- HOE.spec.extensions = []
142
- HOE.spec.files += Dir["lib/#{HOE.name}/#{HOE.name}.rb"]
143
- HOE.spec.files += Dir["lib/#{HOE.name}/1.{8,9}/#{HOE.name}.so"]
141
+ HOE.spec.files += Dir["lib/nokogiri/nokogiri.rb"]
142
+ HOE.spec.files += Dir["lib/nokogiri/1.{8,9}/nokogiri.so"]
144
143
  end
145
144
  end
146
145
 
147
- CLOBBER.include("lib/nokogiri/nokogiri.{so,dylib,rb,bundle}")
148
- CLOBBER.include("lib/nokogiri/1.{8,9}")
149
-
150
- if Rake::Task.task_defined?(:cross)
151
- Rake::Task[:cross].prerequisites << "lib/nokogiri/nokogiri.rb"
152
- Rake::Task[:cross].prerequisites << "cross:file_list"
153
- end
146
+ HOE.clean_globs += [
147
+ "#{CROSS_DIR}/*.installed",
148
+ "#{CROSS_DIR}/#{HOST}",
149
+ "tmp/#{HOST}",
150
+ ]
154
151
 
155
- desc "build a windows gem without all the ceremony."
156
- task "gem:windows" do
157
- rake_compiler_config = YAML.load_file("#{ENV['HOME']}/.rake-compiler/config.yml")
158
-
159
- # check that rake-compiler config contains the right patchlevels of 1.8.6 and 1.9.1. see #279.
160
- ["1.8.6-p383", "1.9.1-p243"].each do |version|
161
- majmin, patchlevel = version.split("-")
162
- rbconfig = "rbconfig-#{majmin}"
163
- unless rake_compiler_config.key?(rbconfig) && rake_compiler_config[rbconfig] =~ /-#{patchlevel}/
164
- raise "rake-compiler '#{rbconfig}' not #{patchlevel}. try running 'env --unset=HOST rake-compiler cross-ruby VERSION=#{version}'"
165
- end
166
- end
167
-
168
- # verify that --export-all is in the 1.9.1 rbconfig. see #279,#374,#375.
169
- rbconfig_191 = rake_compiler_config["rbconfig-1.9.1"]
170
- raise "rbconfig #{rbconfig_191} needs --export-all in its DLDFLAGS value" if File.read(rbconfig_191).grep(/CONFIG\["DLDFLAGS"\].*--export-all/).empty?
171
-
172
- system("env PKG_CONFIG_PATH=#{RAKE_COMPILER_PKGCONFIG} RUBY_CC_VERSION=1.8.6:1.9.1 rake cross native gem") || raise("build failed!")
173
- end
152
+ task :cross => ["cross:libxslt", "lib/nokogiri/nokogiri.rb", "cross:file_list"]
@@ -0,0 +1,18 @@
1
+ namespace :docs do
2
+ desc "generate HTML docs for nokogiri.org"
3
+ task :website do
4
+ title = "#{HOE.name}-#{HOE.version} Documentation"
5
+
6
+ options = []
7
+ options << "--main=#{HOE.readme_file}"
8
+ options << '--format=activerecord'
9
+ options << '--threads=1'
10
+ options << "--title=#{title.inspect}"
11
+
12
+ options += HOE.spec.require_paths
13
+ options += HOE.spec.extra_rdoc_files
14
+ require 'rdoc/rdoc'
15
+ ENV['RAILS_ROOT'] ||= File.expand_path(File.join('..', 'nokogiri_ws'))
16
+ RDoc::RDoc.new.document options
17
+ end
18
+ end
data/tasks/test.rb CHANGED
@@ -64,7 +64,7 @@ namespace :test do
64
64
  end
65
65
 
66
66
  Dir.chdir File.join(MULTI_XML, 'build', filename) do
67
- system "./configure --prefix=#{install_dir}"
67
+ system "./configure --without-http --prefix=#{install_dir}"
68
68
  system "make && make install"
69
69
  end
70
70
  end
@@ -73,7 +73,7 @@ namespace :test do
73
73
  libxslt = Dir[File.join(MULTI_XML, 'install', 'libxslt*')].first
74
74
 
75
75
  directories = ENV['MULTIXML2_DIR'] ? [ENV['MULTIXML2_DIR']] : Dir[File.join(MULTI_XML, 'install', '*')]
76
- directories.sort.reverse.each do |xml2_version|
76
+ directories.sort.reverse_each do |xml2_version|
77
77
  next unless xml2_version =~ /libxml2/
78
78
  extopts = "--with-xml2-include=#{xml2_version}/include/libxml2 --with-xml2-lib=#{xml2_version}/lib --with-xslt-dir=#{libxslt} --with-iconv-dir=/usr"
79
79
  cmd = "#{$0} clean test EXTOPTS='#{extopts}' LD_LIBRARY_PATH='#{xml2_version}/lib'"
@@ -0,0 +1,10 @@
1
+ <!DOCTYPE HTML>
2
+ <html>
3
+ <head>
4
+ <title>$B$?$3>F$-2>LL(B</title>
5
+ <meta charset="iso-2022-jp" />
6
+ </head>
7
+ <body>
8
+ <p>$B0-$$;v$r9=A[Cf!#(B</p>
9
+ </body>
10
+ </html>
@@ -0,0 +1,47 @@
1
+ <!DOCTYPE HTML>
2
+ <html>
3
+ <head>
4
+ <title>I have no encoding declaration.</title>
5
+ </head>
6
+ <body>
7
+ <p>I want one.</p>
8
+ <p>I really want one.</p>
9
+ <p>I really really want one.</p>
10
+ <p>I really really really want one.</p>
11
+ <p>I really really really really want one.</p>
12
+ <p>I really really really really really want one.</p>
13
+ <p>I really really really really really really want one.</p>
14
+ <p>I really really really really really really really want one.</p>
15
+ <p>I really really really really really really really really want one.</p>
16
+ <p>I really really really really really really really really really want one.</p>
17
+ <p>I really really really really really really really really really really want one.</p>
18
+ <p>I really really really really really really really really really really really want one.</p>
19
+ <p>I really really really really really really really really really really really really want one.</p>
20
+ <p>I really really really really really really really really really really really really really want one.</p>
21
+ <p>I really really really really really really really really really really really really really really want one.</p>
22
+ <p>I really really really really really really really really really really really really really really really want one.</p>
23
+ <p>I really really really really really really really really really really really really really really really really want one.</p>
24
+ <p>I really really really really really really really really really really really really really really really really really want one.</p>
25
+ <p>I really really really really really really really really really really really really really really really really really really want one.</p>
26
+ <p>I really really really really really really really really really really really really really really really really really really really want one.</p>
27
+ <p>I really really really really really really really really really really really really really really really really really really really really want one.</p>
28
+ <p>I really really really really really really really really really really really really really really really really really really really really really want one.</p>
29
+ <p>I really really really really really really really really really really really really really really really really really really really really really really want one.</p>
30
+ <p>I really really really really really really really really really really really really really really really really really really really really really really really want one.</p>
31
+ <p>I really really really really really really really really really really really really really really really really really really really really really really really really want one.</p>
32
+ <p>I really really really really really really really really really really really really really really really really really really really really really really really really really want one.</p>
33
+ <p>I really really really really really really really really really really really really really really really really really really really really really really really really really really want one.</p>
34
+ <p>I really really really really really really really really really really really really really really really really really really really really really really really really really really really want one.</p>
35
+ <p>I really really really really really really really really really really really really really really really really really really really really really really really really really really really really want one.</p>
36
+ <p>I really really really really really really really really really really really really really really really really really really really really really really really really really really really really really want one.</p>
37
+ <p>I really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really want one.</p>
38
+ <p>I really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really want one.</p>
39
+ <p>I really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really want one.</p>
40
+ <p>I really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really want one.</p>
41
+ <p>I really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really want one.</p>
42
+ <p>I really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really want one.</p>
43
+ <p>I really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really want one.</p>
44
+ <p>I really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really want one.</p>
45
+ <p>I really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really want one.</p>
46
+ </body>
47
+ </html>