nokogiri 1.8.5 → 1.9.1

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 (147) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -1
  3. data/ext/nokogiri/extconf.rb +10 -6
  4. data/ext/nokogiri/xml_attr.c +26 -21
  5. data/ext/nokogiri/xml_document.c +4 -1
  6. data/ext/nokogiri/xml_namespace.c +3 -3
  7. data/ext/nokogiri/xml_namespace.h +1 -2
  8. data/ext/nokogiri/xml_node.c +55 -15
  9. data/lib/nokogiri/css/parser.rb +61 -61
  10. data/lib/nokogiri/version.rb +1 -1
  11. data/lib/nokogiri/xml/document_fragment.rb +11 -0
  12. data/lib/nokogiri/xml/node.rb +12 -0
  13. data/lib/nokogiri/xml/node_set.rb +4 -8
  14. metadata +17 -153
  15. data/.autotest +0 -22
  16. data/.cross_rubies +0 -8
  17. data/.editorconfig +0 -17
  18. data/.gemtest +0 -0
  19. data/.travis.yml +0 -63
  20. data/CHANGELOG.md +0 -1368
  21. data/CONTRIBUTING.md +0 -42
  22. data/C_CODING_STYLE.rdoc +0 -33
  23. data/Gemfile +0 -23
  24. data/Gemfile-libxml-ruby +0 -3
  25. data/Manifest.txt +0 -370
  26. data/ROADMAP.md +0 -111
  27. data/Rakefile +0 -348
  28. data/SECURITY.md +0 -19
  29. data/STANDARD_RESPONSES.md +0 -47
  30. data/Y_U_NO_GEMSPEC.md +0 -155
  31. data/appveyor.yml +0 -29
  32. data/build_all +0 -44
  33. data/patches/sort-patches-by-date +0 -25
  34. data/suppressions/README.txt +0 -1
  35. data/suppressions/nokogiri_ruby-2.supp +0 -10
  36. data/tasks/test.rb +0 -100
  37. data/test/css/test_nthiness.rb +0 -226
  38. data/test/css/test_parser.rb +0 -386
  39. data/test/css/test_tokenizer.rb +0 -215
  40. data/test/css/test_xpath_visitor.rb +0 -96
  41. data/test/decorators/test_slop.rb +0 -23
  42. data/test/files/2ch.html +0 -108
  43. data/test/files/GH_1042.html +0 -18
  44. data/test/files/address_book.rlx +0 -12
  45. data/test/files/address_book.xml +0 -10
  46. data/test/files/atom.xml +0 -344
  47. data/test/files/bar/bar.xsd +0 -4
  48. data/test/files/bogus.xml +0 -0
  49. data/test/files/dont_hurt_em_why.xml +0 -422
  50. data/test/files/encoding.html +0 -82
  51. data/test/files/encoding.xhtml +0 -84
  52. data/test/files/exslt.xml +0 -8
  53. data/test/files/exslt.xslt +0 -35
  54. data/test/files/foo/foo.xsd +0 -4
  55. data/test/files/metacharset.html +0 -10
  56. data/test/files/namespace_pressure_test.xml +0 -1684
  57. data/test/files/noencoding.html +0 -47
  58. data/test/files/po.xml +0 -32
  59. data/test/files/po.xsd +0 -66
  60. data/test/files/saml/saml20assertion_schema.xsd +0 -283
  61. data/test/files/saml/saml20protocol_schema.xsd +0 -302
  62. data/test/files/saml/xenc_schema.xsd +0 -146
  63. data/test/files/saml/xmldsig_schema.xsd +0 -318
  64. data/test/files/shift_jis.html +0 -10
  65. data/test/files/shift_jis.xml +0 -5
  66. data/test/files/shift_jis_no_charset.html +0 -9
  67. data/test/files/slow-xpath.xml +0 -25509
  68. data/test/files/snuggles.xml +0 -3
  69. data/test/files/staff.dtd +0 -10
  70. data/test/files/staff.xml +0 -59
  71. data/test/files/staff.xslt +0 -32
  72. data/test/files/test_document_url/bar.xml +0 -2
  73. data/test/files/test_document_url/document.dtd +0 -4
  74. data/test/files/test_document_url/document.xml +0 -6
  75. data/test/files/tlm.html +0 -851
  76. data/test/files/to_be_xincluded.xml +0 -2
  77. data/test/files/valid_bar.xml +0 -2
  78. data/test/files/xinclude.xml +0 -4
  79. data/test/helper.rb +0 -271
  80. data/test/html/sax/test_parser.rb +0 -168
  81. data/test/html/sax/test_parser_context.rb +0 -46
  82. data/test/html/sax/test_parser_text.rb +0 -163
  83. data/test/html/sax/test_push_parser.rb +0 -87
  84. data/test/html/test_attributes.rb +0 -85
  85. data/test/html/test_builder.rb +0 -164
  86. data/test/html/test_document.rb +0 -712
  87. data/test/html/test_document_encoding.rb +0 -143
  88. data/test/html/test_document_fragment.rb +0 -310
  89. data/test/html/test_element_description.rb +0 -105
  90. data/test/html/test_named_characters.rb +0 -14
  91. data/test/html/test_node.rb +0 -212
  92. data/test/html/test_node_encoding.rb +0 -91
  93. data/test/namespaces/test_additional_namespaces_in_builder_doc.rb +0 -14
  94. data/test/namespaces/test_namespaces_aliased_default.rb +0 -24
  95. data/test/namespaces/test_namespaces_in_builder_doc.rb +0 -75
  96. data/test/namespaces/test_namespaces_in_cloned_doc.rb +0 -31
  97. data/test/namespaces/test_namespaces_in_created_doc.rb +0 -75
  98. data/test/namespaces/test_namespaces_in_parsed_doc.rb +0 -80
  99. data/test/namespaces/test_namespaces_preservation.rb +0 -31
  100. data/test/test_convert_xpath.rb +0 -135
  101. data/test/test_css_cache.rb +0 -47
  102. data/test/test_encoding_handler.rb +0 -48
  103. data/test/test_memory_leak.rb +0 -156
  104. data/test/test_nokogiri.rb +0 -138
  105. data/test/test_soap4r_sax.rb +0 -52
  106. data/test/test_xslt_transforms.rb +0 -314
  107. data/test/xml/node/test_save_options.rb +0 -28
  108. data/test/xml/node/test_subclass.rb +0 -44
  109. data/test/xml/sax/test_parser.rb +0 -402
  110. data/test/xml/sax/test_parser_context.rb +0 -115
  111. data/test/xml/sax/test_parser_text.rb +0 -202
  112. data/test/xml/sax/test_push_parser.rb +0 -265
  113. data/test/xml/test_attr.rb +0 -74
  114. data/test/xml/test_attribute_decl.rb +0 -86
  115. data/test/xml/test_builder.rb +0 -341
  116. data/test/xml/test_c14n.rb +0 -180
  117. data/test/xml/test_cdata.rb +0 -54
  118. data/test/xml/test_comment.rb +0 -40
  119. data/test/xml/test_document.rb +0 -982
  120. data/test/xml/test_document_encoding.rb +0 -31
  121. data/test/xml/test_document_fragment.rb +0 -298
  122. data/test/xml/test_dtd.rb +0 -187
  123. data/test/xml/test_dtd_encoding.rb +0 -31
  124. data/test/xml/test_element_content.rb +0 -56
  125. data/test/xml/test_element_decl.rb +0 -73
  126. data/test/xml/test_entity_decl.rb +0 -122
  127. data/test/xml/test_entity_reference.rb +0 -262
  128. data/test/xml/test_namespace.rb +0 -96
  129. data/test/xml/test_node.rb +0 -1325
  130. data/test/xml/test_node_attributes.rb +0 -115
  131. data/test/xml/test_node_encoding.rb +0 -75
  132. data/test/xml/test_node_inheritance.rb +0 -32
  133. data/test/xml/test_node_reparenting.rb +0 -592
  134. data/test/xml/test_node_set.rb +0 -809
  135. data/test/xml/test_parse_options.rb +0 -64
  136. data/test/xml/test_processing_instruction.rb +0 -30
  137. data/test/xml/test_reader.rb +0 -620
  138. data/test/xml/test_reader_encoding.rb +0 -134
  139. data/test/xml/test_relax_ng.rb +0 -60
  140. data/test/xml/test_schema.rb +0 -142
  141. data/test/xml/test_syntax_error.rb +0 -36
  142. data/test/xml/test_text.rb +0 -60
  143. data/test/xml/test_unparented_node.rb +0 -483
  144. data/test/xml/test_xinclude.rb +0 -83
  145. data/test/xml/test_xpath.rb +0 -470
  146. data/test/xslt/test_custom_functions.rb +0 -133
  147. data/test/xslt/test_exception_handling.rb +0 -37
data/Rakefile DELETED
@@ -1,348 +0,0 @@
1
- # -*- ruby -*-
2
- require 'rubygems'
3
- require 'shellwords'
4
-
5
- gem 'hoe'
6
- require 'hoe'
7
- Hoe.plugin :debugging
8
- Hoe.plugin :git
9
- Hoe.plugin :gemspec
10
- Hoe.plugin :bundler
11
-
12
- GENERATED_PARSER = "lib/nokogiri/css/parser.rb"
13
- GENERATED_TOKENIZER = "lib/nokogiri/css/tokenizer.rb"
14
-
15
- def java?
16
- /java/ === RUBY_PLATFORM
17
- end
18
-
19
- ENV['LANG'] = "en_US.UTF-8" # UBUNTU 10.04, Y U NO DEFAULT TO UTF-8?
20
-
21
- CrossRuby = Struct.new(:version, :host) {
22
- def ver
23
- @ver ||= version[/\A[^-]+/]
24
- end
25
-
26
- def minor_ver
27
- @minor_ver ||= ver[/\A\d\.\d(?=\.)/]
28
- end
29
-
30
- def api_ver_suffix
31
- case minor_ver
32
- when nil
33
- raise "unsupported version: #{ver}"
34
- else
35
- minor_ver.delete('.') << '0'
36
- end
37
- end
38
-
39
- def platform
40
- @platform ||=
41
- case host
42
- when /\Ax86_64-/
43
- 'x64-mingw32'
44
- when /\Ai[3-6]86-/
45
- 'x86-mingw32'
46
- else
47
- raise "unsupported host: #{host}"
48
- end
49
- end
50
-
51
- def tool(name)
52
- (@binutils_prefix ||=
53
- case platform
54
- when 'x64-mingw32'
55
- 'x86_64-w64-mingw32-'
56
- when 'x86-mingw32'
57
- 'i686-w64-mingw32-'
58
- end) + name
59
- end
60
-
61
- def target
62
- case platform
63
- when 'x64-mingw32'
64
- 'pei-x86-64'
65
- when 'x86-mingw32'
66
- 'pei-i386'
67
- end
68
- end
69
-
70
- def libruby_dll
71
- case platform
72
- when 'x64-mingw32'
73
- "x64-msvcrt-ruby#{api_ver_suffix}.dll"
74
- when 'x86-mingw32'
75
- "msvcrt-ruby#{api_ver_suffix}.dll"
76
- end
77
- end
78
-
79
- def dlls
80
- [
81
- 'kernel32.dll',
82
- 'msvcrt.dll',
83
- 'ws2_32.dll',
84
- *(case
85
- when ver >= '2.0.0'
86
- 'user32.dll'
87
- end),
88
- libruby_dll
89
- ]
90
- end
91
- }
92
-
93
- CROSS_RUBIES = File.read('.cross_rubies').lines.flat_map { |line|
94
- case line
95
- when /\A([^#]+):([^#]+)/
96
- CrossRuby.new($1, $2)
97
- else
98
- []
99
- end
100
- }
101
-
102
- ENV['RUBY_CC_VERSION'] ||= CROSS_RUBIES.map(&:ver).uniq.join(":")
103
-
104
- HOE = Hoe.spec 'nokogiri' do
105
- developer 'Aaron Patterson', 'aaronp@rubyforge.org'
106
- developer 'Mike Dalessio', 'mike.dalessio@gmail.com'
107
- developer 'Yoko Harada', 'yokolet@gmail.com'
108
- developer 'Tim Elliott', 'tle@holymonkey.com'
109
- developer 'Akinori MUSHA', 'knu@idaemons.org'
110
- developer 'John Shahid', 'jvshahid@gmail.com'
111
- developer 'Lars Kanis', 'lars@greiz-reinsdorf.de'
112
-
113
- license "MIT"
114
-
115
- self.readme_file = "README.md"
116
- self.history_file = "CHANGELOG.md"
117
-
118
- self.extra_rdoc_files = FileList['*.rdoc','ext/nokogiri/*.c']
119
-
120
-
121
- self.clean_globs += [
122
- 'nokogiri.gemspec',
123
- 'lib/nokogiri/nokogiri.{bundle,jar,rb,so}',
124
- 'lib/nokogiri/[0-9].[0-9]'
125
- ]
126
- self.clean_globs += Dir.glob("ports/*").reject { |d| d =~ %r{/archives$} }
127
-
128
- unless java?
129
- self.extra_deps += [
130
- ["mini_portile2", "~> 2.3.0"], # keep version in sync with extconf.rb
131
- ]
132
- end
133
-
134
- self.extra_dev_deps += [
135
- ["hoe-bundler", "~> 1.2"],
136
- ["hoe-debugging", "~> 1.4"],
137
- ["hoe-gemspec", "~> 1.0"],
138
- ["hoe-git", "~> 1.6"],
139
- ["minitest", "~> 5.8.4"],
140
- ["rake", "~> 12.0"],
141
- ["rake-compiler", "~> 1.0.3"],
142
- ["rake-compiler-dock", "~> 0.6.2"],
143
- ["racc", "~> 1.4.14"],
144
- ["rexical", "~> 1.0.5"],
145
- ["concourse", "~> 0.15"],
146
- ]
147
-
148
- if java?
149
- self.spec_extras = {
150
- :platform => 'java',
151
- :required_ruby_version => '>= 1.9.3' # JRuby >= 1.7
152
- }
153
- else
154
- self.spec_extras = {
155
- :extensions => ["ext/nokogiri/extconf.rb"],
156
- :required_ruby_version => '>= 2.1.0'
157
- }
158
- end
159
-
160
- self.testlib = :minitest
161
- end
162
-
163
- # ----------------------------------------
164
-
165
- def add_file_to_gem relative_path
166
- target_path = File.join gem_build_path, relative_path
167
- target_dir = File.dirname(target_path)
168
- mkdir_p target_dir unless File.directory?(target_dir)
169
- rm_f target_path
170
- safe_ln relative_path, target_path
171
- HOE.spec.files += [relative_path]
172
- end
173
-
174
- def gem_build_path
175
- File.join 'pkg', HOE.spec.full_name
176
- end
177
-
178
- if java?
179
- # TODO: clean this section up.
180
- require "rake/javaextensiontask"
181
- Rake::JavaExtensionTask.new("nokogiri", HOE.spec) do |ext|
182
- jruby_home = RbConfig::CONFIG['prefix']
183
- ext.ext_dir = 'ext/java'
184
- ext.lib_dir = 'lib/nokogiri'
185
- ext.source_version = '1.6'
186
- ext.target_version = '1.6'
187
- jars = ["#{jruby_home}/lib/jruby.jar"] + FileList['lib/*.jar']
188
- ext.classpath = jars.map { |x| File.expand_path x }.join ':'
189
- ext.debug = true if ENV['JAVA_DEBUG']
190
- end
191
-
192
- task gem_build_path => [:compile] do
193
- add_file_to_gem 'lib/nokogiri/nokogiri.jar'
194
- end
195
- else
196
- begin
197
- require 'rake/extensioncompiler'
198
- # Ensure mingw compiler is installed
199
- Rake::ExtensionCompiler.mingw_host
200
- mingw_available = true
201
- rescue
202
- mingw_available = false
203
- end
204
- require "rake/extensiontask"
205
-
206
- HOE.spec.files.reject! { |f| f =~ %r{\.(java|jar)$} }
207
-
208
- dependencies = YAML.load_file("dependencies.yml")
209
-
210
- task gem_build_path do
211
- %w[libxml2 libxslt].each do |lib|
212
- version = dependencies[lib]["version"]
213
- archive = File.join("ports", "archives", "#{lib}-#{version}.tar.gz")
214
- add_file_to_gem archive
215
- patchesdir = File.join("patches", lib)
216
- patches = `#{['git', 'ls-files', patchesdir].shelljoin}`.split("\n").grep(/\.patch\z/)
217
- patches.each { |patch|
218
- add_file_to_gem patch
219
- }
220
- (untracked = Dir[File.join(patchesdir, '*.patch')] - patches).empty? or
221
- at_exit {
222
- untracked.each { |patch|
223
- puts "** WARNING: untracked patch file not added to gem: #{patch}"
224
- }
225
- }
226
- end
227
- end
228
-
229
- Rake::ExtensionTask.new("nokogiri", HOE.spec) do |ext|
230
- ext.lib_dir = File.join(*['lib', 'nokogiri', ENV['FAT_DIR']].compact)
231
- ext.config_options << ENV['EXTOPTS']
232
- if mingw_available
233
- ext.cross_compile = true
234
- ext.cross_platform = CROSS_RUBIES.map(&:platform).uniq
235
- ext.cross_config_options << "--enable-cross-build"
236
- ext.cross_compiling do |spec|
237
- libs = dependencies.map { |name, dep| "#{name}-#{dep["version"]}" }.join(', ')
238
-
239
- spec.post_install_message = <<-EOS
240
- Nokogiri is built with the packaged libraries: #{libs}.
241
- EOS
242
- spec.files.reject! { |path| File.fnmatch?('ports/*', path) }
243
- end
244
- end
245
- end
246
- end
247
-
248
- # ----------------------------------------
249
-
250
- desc "Generate css/parser.rb and css/tokenizer.rex"
251
- task 'generate' => [GENERATED_PARSER, GENERATED_TOKENIZER]
252
- task 'gem:spec' => 'generate' if Rake::Task.task_defined?("gem:spec")
253
-
254
- # This is a big hack to make sure that the racc and rexical
255
- # dependencies in the Gemfile are constrainted to ruby platforms
256
- # (i.e. MRI and Rubinius). There's no way to do that through hoe,
257
- # and any solution will require changing hoe and hoe-bundler.
258
- old_gemfile_task = Rake::Task['bundler:gemfile'] rescue nil
259
- task 'bundler:gemfile' do
260
- old_gemfile_task.invoke if old_gemfile_task
261
-
262
- lines = File.open('Gemfile', 'r') { |f| f.readlines }.map do |line|
263
- line =~ /racc|rexical/ ? "#{line.strip}, :platform => [:ruby, :mingw, :x64_mingw]" : line
264
- end
265
- File.open('Gemfile', 'w') { |f| lines.each { |line| f.puts line } }
266
- end
267
-
268
- file GENERATED_PARSER => "lib/nokogiri/css/parser.y" do |t|
269
- sh "racc -l -o #{t.name} #{t.prerequisites.first}"
270
- end
271
-
272
- file GENERATED_TOKENIZER => "lib/nokogiri/css/tokenizer.rex" do |t|
273
- sh "rex --independent -o #{t.name} #{t.prerequisites.first}"
274
- end
275
-
276
- [:compile, :check_manifest].each do |task_name|
277
- Rake::Task[task_name].prerequisites << GENERATED_PARSER
278
- Rake::Task[task_name].prerequisites << GENERATED_TOKENIZER
279
- end
280
-
281
- # ----------------------------------------
282
-
283
- desc "set environment variables to build and/or test with debug options"
284
- task :debug do
285
- ENV['NOKOGIRI_DEBUG'] = "true"
286
- ENV['CFLAGS'] ||= ""
287
- ENV['CFLAGS'] += " -DDEBUG"
288
- end
289
-
290
- require File.join File.dirname(__FILE__), 'tasks/test'
291
-
292
- task :java_debug do
293
- ENV['JRUBY_OPTS'] = "#{ENV['JRUBY_OPTS']} --debug --dev"
294
- ENV['JAVA_OPTS'] = '-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y' if ENV['JAVA_DEBUG']
295
- end
296
-
297
- Rake::Task[:test].prerequisites << :compile
298
- Rake::Task[:test].prerequisites << :java_debug
299
- Rake::Task[:test].prerequisites << :check_extra_deps unless java?
300
-
301
- if Hoe.plugins.include?(:debugging)
302
- ['valgrind', 'valgrind:mem', 'valgrind:mem0'].each do |task_name|
303
- Rake::Task["test:#{task_name}"].prerequisites << :compile
304
- end
305
- end
306
-
307
- require 'concourse'
308
- Concourse.new("nokogiri").create_tasks!
309
-
310
- # ----------------------------------------
311
-
312
- def verify_dll(dll, cross_ruby)
313
- dll_imports = cross_ruby.dlls
314
- dump = `#{['env', 'LANG=C', cross_ruby.tool('objdump'), '-p', dll].shelljoin}`
315
- raise "unexpected file format for generated dll #{dll}" unless /file format #{Regexp.quote(cross_ruby.target)}\s/ === dump
316
- raise "export function Init_nokogiri not in dll #{dll}" unless /Table.*\sInit_nokogiri\s/mi === dump
317
-
318
- # Verify that the expected DLL dependencies match the actual dependencies
319
- # and that no further dependencies exist.
320
- dll_imports_is = dump.scan(/DLL Name: (.*)$/).map(&:first).map(&:downcase).uniq
321
- if dll_imports_is.sort != dll_imports.sort
322
- raise "unexpected dll imports #{dll_imports_is.inspect} in #{dll}"
323
- end
324
- puts "#{dll}: Looks good!"
325
- end
326
-
327
- task :cross do
328
- rake_compiler_config_path = File.expand_path("~/.rake-compiler/config.yml")
329
- unless File.exists? rake_compiler_config_path
330
- raise "rake-compiler has not installed any cross rubies. Use rake-compiler-dock or 'rake gem:windows' for building binary windows gems."
331
- end
332
-
333
- CROSS_RUBIES.each do |cross_ruby|
334
- task "tmp/#{cross_ruby.platform}/nokogiri/#{cross_ruby.ver}/nokogiri.so" do |t|
335
- # To reduce the gem file size strip mingw32 dlls before packaging
336
- sh [cross_ruby.tool('strip'), '-S', t.name].shelljoin
337
- verify_dll t.name, cross_ruby
338
- end
339
- end
340
- end
341
-
342
- desc "build a windows gem without all the ceremony."
343
- task "gem:windows" do
344
- require "rake_compiler_dock"
345
- RakeCompilerDock.sh "bundle && rake cross native gem MAKE='nice make -j`nproc`' RUBY_CC_VERSION=#{ENV['RUBY_CC_VERSION']}"
346
- end
347
-
348
- # vim: syntax=Ruby
data/SECURITY.md DELETED
@@ -1,19 +0,0 @@
1
- # Security and Vulnerability Reporting
2
-
3
- The Nokogiri Core Contributors take security very seriously and investigate all reported vulnerabilities.
4
-
5
- If you would like to report a vulnerablity or have a security concern regarding Nokogiri or how Nokogiri is using any of its underlying platform-specific libraries (such as libxml2 or xerces), please [report it via HackerOne](https://hackerone.com/nokogiri/reports/new).
6
-
7
- Your report will be acknowledged within 24 hours, and you'll receive a more detailed response within 72 hours indicating next steps in handling your report.
8
-
9
- If you have not received a reply to your submission within 48 hours, there are a few steps you can take:
10
-
11
- * Contact the current security coordinator (Mike Dalessio <mike.dalessio@gmail.com>)
12
- * Contact the core contributor mailing list (nokogiri-core@googlegroups.com)
13
- * Join the [nokogiri-talk group](https://groups.google.com/d/forum/nokogiri-talk)
14
-
15
- Please note, the nokogiri-talk list is a public area. When escalating in that venue, please do not discuss your issue. Simply say that you're trying to get a hold of someone from the core team.
16
-
17
- The information you share with the Nokogiri Core Contributors as part of this process will be kept confidential within the team, unless or until we need to share information upstream with our dependent libraries' core teams, at which point we will notify you.
18
-
19
- If a vulnerability is first reported by you, we will credit you with the discovery in the public disclosure.
@@ -1,47 +0,0 @@
1
- # Standard Responses to Requests
2
-
3
- These responses are needed often enough that I figured, let's just
4
- check them in for future reference and use.
5
-
6
-
7
- # Not enough information to help
8
-
9
- Hello!
10
-
11
- Thanks for asking this question! However, without more information,
12
- Team Nokogiri cannot reproduce your issue, and so we cannot offer much
13
- help.
14
-
15
- Please provide us with:
16
-
17
- * A self-contained script (one that we can run without modification,
18
- and preferably without making external network connections).
19
-
20
- * Please note that you need to include the XML/HTML that you are
21
- operating on.
22
-
23
- * The output of `nokogiri -v`, which will provide details about your
24
- platform and versions of ruby, libxml2 and nokogiri.
25
-
26
- For more information about requesting help or reporting bugs, please
27
- take a look at http://bit.ly/nokohelp
28
-
29
- Thank you so much!
30
-
31
-
32
- # Not a bug
33
-
34
- Hello!
35
-
36
- Thanks for asking this question! Your request for assistance using
37
- Nokogiri will not go unanswered!
38
-
39
- However, Nokogiri's Github Issues is reserved for reporting bugs or
40
- submitting patches. If you ask your question on the mailing list, Team
41
- Nokogiri promises someone will provide you with an answer in a timely
42
- manner.
43
-
44
- If you'd like to read up on Team Nokogiri's rationale for this policy,
45
- please go to http://bit.ly/nokohelp.
46
-
47
- Thank you so much for understanding! And thank you for using Nokogiri.
data/Y_U_NO_GEMSPEC.md DELETED
@@ -1,155 +0,0 @@
1
- (note: this was originally a blog post published at http://blog.flavorjon.es/2012/03/y-u-no-gemspec.html)
2
-
3
- ## tl;dr
4
-
5
- 1. Team Nokogiri are not 10-foot-tall code-crunching robots, so `master` is usually unstable.
6
- 2. Unstable code can corrupt your data and crash your application, which would make everybody look bad.
7
- 3. Therefore, the _risk_ associated with using unstable code is severe; for you _and_ for Team Nokogiri.
8
- 4. The absence of a gemspec is a risk mitigation tactic.
9
- 5. You can always ask for an RC release.
10
-
11
-
12
- ## Why Isn't There a Gemspec!?
13
-
14
- OHAI! Thank you for asking this question!
15
-
16
- Team Nokogiri gets asked this pretty frequently. Just a sample from
17
- the historical record:
18
-
19
- * [Issue #274](https://github.com/sparklemotion/nokogiri/issues/274)
20
- * [Issue #371](https://github.com/sparklemotion/nokogiri/issues/371)
21
- * [A commit removing nokogiri.gemspec](https://github.com/sparklemotion/nokogiri/commit/7f17a643a05ca381d65131515b54d4a3a61ca2e1#commitcomment-667477)
22
- * [A nokogiri-talk thread](http://groups.google.com/group/nokogiri-talk/browse_thread/thread/4706b002e492d23f)
23
- * [Another nokogiri-talk thread](http://groups.google.com/group/nokogiri-talk/browse_thread/thread/0b201bb80ea3eea0)
24
-
25
- Sometimes people imply that we've forgotten, or that we don't know how to
26
- properly manage our codebase. Those people are super fun to respond
27
- to!
28
-
29
- We've gone back and forth a couple of times over the past few years,
30
- but the current policy of Team Nokogiri is to **not** provide a
31
- gemspec in the Github repo. This is a conscious choice, not an
32
- oversight.
33
-
34
-
35
- ## But You Didn't Answer the Question!
36
-
37
- Ah, I was hoping you wouldn't notice. Well, OK, let's do this, if
38
- you're serious about it.
39
-
40
- I'd like to start by talking about _risk_. Specifically, the risk
41
- associated with using a known-unstable version of Nokogiri.
42
-
43
-
44
- ### Risk
45
-
46
- One common way to evaluate the _risk_ of an incident is:
47
-
48
- risk = probability x impact
49
-
50
- You can read more about this on [the internets](http://en.wikipedia.org/wiki/Risk_Matrix).
51
-
52
- The _risk_ associated with a Nokogiri bug could be loosely defined by
53
- answering the questions:
54
-
55
- * "How likely is it that a bug exists?" (probability)
56
- * "How severe will the consequences of a bug be?" (impact)
57
-
58
-
59
- ### Probability
60
-
61
- The `master` branch should be considered unstable. Team Nokogiri are
62
- not 10-foot-tall code-crunching robots; we are humans. We make
63
- mistakes, and as a result, any arbitrary commit on `master` is likely
64
- to contain bugs.
65
-
66
- Just as an example, Nokogiri `master` was unstable for about five
67
- months between November 2011 and March 2012. It was unstable not
68
- because we were sloppy, or didn't care, but because the fixes were
69
- hard and unobvious.
70
-
71
- When we release Nokogiri, we test for memory leaks and invalid memory
72
- access on all kinds of platforms with many flavors of Ruby and lots of
73
- versions of libxml2. Because these tests are time-consuming, we don't
74
- run them on every commit. We run them often when preparing a release.
75
-
76
- If we're releasing Nokogiri, it means we think it's rock solid.
77
-
78
- And if we're not releasing it, it means there are probably bugs.
79
-
80
-
81
- ### Impact
82
-
83
- Nokogiri is a gem with native extensions. This means it's not pure
84
- Ruby -- there's C or Java code being compiled and run, which means
85
- that there's always a chance that the gem will crash your application,
86
- or worse. Possible outcomes include:
87
-
88
- * leaking memory
89
- * corrupting data
90
- * making benign code crash (due to memory corruption)
91
-
92
- So, then, a bug in a native extension can have much worse downside
93
- than you might think. It's not just going to do something unexpected;
94
- it's possibly going to do terrible, awful things to your application
95
- and data.
96
-
97
- **Nobody** wants that to happen. Especially Team Nokogiri.
98
-
99
-
100
- ### Risk, Redux
101
-
102
- So, if you accept the equation
103
-
104
- risk = probability x impact
105
-
106
- and you believe me when I say that:
107
-
108
- * the probablility of a bug in unreleased code is high, and
109
- * the impact of a bug is likely to be severe,
110
-
111
- then you should easily see that the _risk_ associated with a bug in
112
- Nokogiri is quite high.
113
-
114
- Part of Team Nokogiri's job is to try to mitigate this risk. We have a
115
- number of tactics that we use to accomplish this:
116
-
117
- * we respond quickly to bug reports, particularly when they are possible memory issues
118
- * we review each others' commits
119
- * we have a thorough test suite, and we test-drive new features
120
- * we discuss code design and issues on a core developer mailing list
121
- * we use valgrind to test for memory issues (leaks and invalid
122
- access) on multiple combinations of OS, libxml2 and Ruby
123
- * we package release candidates, and encourage devs to use them
124
- * **we do NOT commit a gemspec in our git repository**
125
-
126
- Yes, that's right, the absence of a gemspec is a risk mitigation
127
- tactic. Not only does Team Nokogiri not want to imply support for
128
- `master`, we want to **actively discourage** people from using
129
- it. Because it's not stable.
130
-
131
-
132
- ## But I Want to Do It Anyway
133
-
134
- Another option, is to email the [nokogiri-talk
135
- list](http://groups.google.com/group/nokogiri-talk) and ask for a
136
- release candidate to be built. We're pretty accommodating if there's a
137
- bugfix that's a blocker for you. And if we can't release an RC, we'll
138
- tell you why.
139
-
140
- And in the end, nothing is stopping you from cloning the repo and
141
- generating a private gemspec. This is an extra step or two, but it has
142
- the benefit of making sure developers have thought through the costs
143
- and risks involved; and it tends to select for developers who know
144
- what they're doing.
145
-
146
-
147
- ## In Conclusion
148
-
149
- Team Nokogiri takes stability very seriously. We want everybody who
150
- uses Nokogiri to have a pleasant experience. And so we want to make
151
- sure that you're using the best software we can make.
152
-
153
- Please keep in mind that we're trying very hard to do the right thing
154
- for all Nokogiri users out there in Rubyland. Nokogiri loves you very
155
- much, and we hope you love it back.
data/appveyor.yml DELETED
@@ -1,29 +0,0 @@
1
- install:
2
- - SET PATH=C:\ruby%ruby_version%\bin;%PATH%
3
- - ps: |
4
- if ($env:ruby_version -like "*head*") {
5
- $(new-object net.webclient).DownloadFile("https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-$env:ruby_version.exe", "$pwd/ruby-setup.exe")
6
- cmd /c ruby-setup.exe /verysilent /dir=C:/Ruby$env:ruby_version
7
- }
8
- - ruby --version
9
- - gem --version
10
- - gem install bundler --conservative
11
- - bundle install
12
-
13
- build: off
14
-
15
- test_script:
16
- - bundle exec rake -rdevkit
17
-
18
- environment:
19
- matrix:
20
- - ruby_version: head-x64
21
- - ruby_version: 24
22
- - ruby_version: 23-x64
23
- - ruby_version: 22
24
- - ruby_version: 21-x64
25
- - ruby_version: 200
26
-
27
- matrix:
28
- allow_failures:
29
- - ruby_version: head
data/build_all DELETED
@@ -1,44 +0,0 @@
1
- #! /usr/bin/env bash
2
- #
3
- # script to build gems for all relevant platforms:
4
- # - MRI et al (standard gem)
5
- # - windows (x86-mingw32 and x64-mingw32)
6
- # - jruby
7
- #
8
-
9
- # Load RVM into a shell session *as a function*
10
- if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
11
- source "$HOME/.rvm/scripts/rvm"
12
- elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
13
- source "/usr/local/rvm/scripts/rvm"
14
- else
15
- echo "ERROR: An RVM installation was not found.\n"
16
- fi
17
-
18
- set -o errexit
19
-
20
- rm -rf tmp pkg
21
- bundle exec rake clean clobber
22
-
23
- # holding pen
24
- rm -rf gems
25
- mkdir -p gems
26
-
27
- # windows
28
- bundle exec rake gem:windows
29
- cp -v pkg/nokogiri*{x86,x64}-mingw32*.gem gems
30
-
31
- # MRI
32
- bundle exec rake clean
33
- bundle exec rake gem
34
- cp -v pkg/nokogiri*.gem gems
35
-
36
- # jruby
37
- bundle exec rake clean clobber
38
- bundle exec rake generate
39
-
40
- rvm jruby
41
- gem install bundler --conservative
42
- bundle install --quiet --local || bundle install
43
- bundle exec ruby -S rake gem
44
- cp -v pkg/nokogiri*java.gem gems
@@ -1,25 +0,0 @@
1
- #! /usr/bin/env ruby
2
-
3
- require "date"
4
-
5
- dir = ARGV[0] || raise("ERROR: arg1 must be dir")
6
-
7
- Dir.chdir dir
8
-
9
- files_and_times = {}
10
- Dir["*.patch"].sort.each do |filename|
11
- dateline = `cat #{filename} | grep "Date:"`
12
- datestr = dateline.split("Date:").last.strip
13
- time = DateTime.parse datestr
14
- files_and_times[filename] = time
15
- end
16
-
17
- count = 0
18
- files_and_times.sort_by {|k,v| v}.each do |filename, time|
19
- count += 1
20
- _, patch_name = filename.split("-", 2)
21
- new_filename = sprintf("%4.4d-%s", count, patch_name)
22
- printf "mv -f %s %s # %s\n", filename, new_filename, time
23
- end
24
-
25
- STDERR.print "\n**\n** REMEMBER TO UPDATE THE Manifest.txt FILE\n**\n"
@@ -1 +0,0 @@
1
- This directory contains valgrind suppression files generated by the hoe-debugging gem.
@@ -1,10 +0,0 @@
1
- {
2
- <insert_a_suppression_name_here>
3
- Memcheck:Free
4
- fun:free
5
- fun:__libc_freeres
6
- fun:_vgnU_freeres
7
- fun:__run_exit_handlers
8
- fun:exit
9
- fun:(below main)
10
- }