nokogiri 1.5.1.rc1 → 1.5.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.

@@ -4,27 +4,44 @@
4
4
 
5
5
  * XML::Builder#comment はコメントノードを作れるようになった.
6
6
  * CSS searches now support namespaced attributes. #593
7
+ * Java integration 機能が追加された. このバージョンから,
8
+ XML::Document.wrap と XML::Document#to_java メソッドが利用可能。
9
+ * RelaxNG validator support in the `nokogiri` cli utility. #591 (thanks, Dan Radez!)
7
10
 
8
11
  * バグの修正
9
12
 
10
13
  * エンコーディング自動認識において発生しうるメモリリークを修正.
11
- @ender672に感謝!
12
-
14
+ Tim Elliottに感謝!
13
15
  * homebrew はインストールしたら、extconf は homebrew のパスを読む。
14
-
16
+ * Inconsistent behavior of Nokogiri 1.5.0 Java #620
17
+ * Inheriting from Nokogiri::XML::Node on JRuby (1.6.4/5) fails #560
15
18
  * XML::Attr nodes are not allowed to be added as node children, so an
16
19
  exception is raised. #558
17
-
18
20
  * No longer defensively "pickle" adjacent text nodes on
19
21
  Node#add_next_sibling and Node#add_previous_sibling calls. #595.
20
-
22
+ * Java version inconsistency: it returns nil for empty attributes #589
23
+ * to_xhtml incorrectly generates <p /></p> when tag is empty #557
21
24
  * Document#add_child now accepts a Node, NodeSet, DocumentFragment,
22
25
  or String. #546.
23
-
24
26
  * Document#create_element now recognizes namespaces containing
25
27
  non-word characters (like "SOAP-ENV"). This is mostly relevant to
26
28
  users of Builder, which calls Document#create_element for nearly
27
29
  everything. #531.
30
+ * File encoding broken in 1.5.0 / jruby / windows #529
31
+ * Java version does not return namespace defs as attrs for ::HTML #542
32
+ * Bad file descriptor with Nokogiri 1.5.0 #495
33
+ * remove_namespace! doesn't work in pure java version #492
34
+ * The Nokogiri Java native build throws a null pointer exception when
35
+ ActiveSupport's .blank? method is called directly on a parsed object.
36
+ #489
37
+ * 1.5.0 Not using correct character encoding #488
38
+ * Raw XML string in XML Builder broken on JRuby #486
39
+ * Nokogiri 1.5.0 XML generation broken on JRuby #484
40
+ * Do not allow multiple root nodes. #550
41
+ * Fixes for custom XPath functions. #605, #606 (thanks, Juan Wajnerman!)
42
+ * Node#to_xml does not override :save_with if it is provided. #505
43
+ * Node#set is a private method [JRuby]. #564 (thanks, Nick Sieger!)
44
+ * C14n cleanup and Node#canonicalize (thanks, Ivan Pirlik!) #563
28
45
 
29
46
  == 1.5.0 / 2011年7月1日
30
47
 
@@ -4,27 +4,44 @@
4
4
 
5
5
  * XML::Builder#comment allows creation of comment nodes.
6
6
  * CSS searches now support namespaced attributes. #593
7
+ * Java integration feature is added. Now, XML::Document.wrap
8
+ and XML::Document#to_java methods are available.
9
+ * RelaxNG validator support in the `nokogiri` cli utility. #591 (thanks, Dan Radez!)
7
10
 
8
11
  * Bugfixes
9
12
 
10
- * Fix a memory leak in encoding detection. Thanks for pointing this
11
- out, @ender672!
12
-
13
+ * Fix many memory leaks and segfault opportunities. Thanks, Tim Elliott!
13
14
  * extconf searches homebrew paths if homebrew is installed.
14
-
15
+ * Inconsistent behavior of Nokogiri 1.5.0 Java #620
16
+ * Inheriting from Nokogiri::XML::Node on JRuby (1.6.4/5) fails #560
15
17
  * XML::Attr nodes are not allowed to be added as node children, so an
16
18
  exception is raised. #558
17
-
18
19
  * No longer defensively "pickle" adjacent text nodes on
19
20
  Node#add_next_sibling and Node#add_previous_sibling calls. #595.
20
-
21
+ * Java version inconsistency: it returns nil for empty attributes #589
22
+ * to_xhtml incorrectly generates <p /></p> when tag is empty #557
21
23
  * Document#add_child now accepts a Node, NodeSet, DocumentFragment,
22
24
  or String. #546.
23
-
24
25
  * Document#create_element now recognizes namespaces containing
25
26
  non-word characters (like "SOAP-ENV"). This is mostly relevant to
26
27
  users of Builder, which calls Document#create_element for nearly
27
28
  everything. #531.
29
+ * File encoding broken in 1.5.0 / jruby / windows #529
30
+ * Java version does not return namespace defs as attrs for ::HTML #542
31
+ * Bad file descriptor with Nokogiri 1.5.0 #495
32
+ * remove_namespace! doesn't work in pure java version #492
33
+ * The Nokogiri Java native build throws a null pointer exception
34
+ when ActiveSupport's .blank? method is called directly on a parsed
35
+ object. #489
36
+ * 1.5.0 Not using correct character encoding #488
37
+ * Raw XML string in XML Builder broken on JRuby #486
38
+ * Nokogiri 1.5.0 XML generation broken on JRuby #484
39
+ * Do not allow multiple root nodes. #550
40
+ * Fixes for custom XPath functions. #605, #606 (thanks, Juan Wajnerman!)
41
+ * Node#to_xml does not override :save_with if it is provided. #505
42
+ * Node#set is a private method [JRuby]. #564 (thanks, Nick Sieger!)
43
+ * C14n cleanup and Node#canonicalize (thanks, Ivan Pirlik!) #563
44
+
28
45
 
29
46
  == 1.5.0 / 2011-07-01
30
47
 
@@ -17,7 +17,7 @@ end
17
17
  $CFLAGS << " #{ENV["CFLAGS"]}"
18
18
  $LIBS << " #{ENV["LIBS"]}"
19
19
 
20
- if RbConfig::CONFIG['target_os'] == 'mingw32' || RbConfig::CONFIG['target_os'] =~ /mswin32/
20
+ if RbConfig::CONFIG['target_os'] == 'mingw32' || RbConfig::CONFIG['target_os'] =~ /mswin/
21
21
  $CFLAGS << " -DXP_WIN -DXP_WIN32 -DUSE_INCLUDED_VASPRINTF"
22
22
  elsif RbConfig::CONFIG['target_os'] =~ /solaris/
23
23
  $CFLAGS << " -DUSE_INCLUDED_VASPRINTF"
@@ -34,7 +34,7 @@ if RbConfig::MAKEFILE_CONFIG['CC'] =~ /gcc/
34
34
  $CFLAGS << " -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline"
35
35
  end
36
36
 
37
- if RbConfig::CONFIG['target_os'] =~ /mswin32/
37
+ if RbConfig::CONFIG['target_os'] =~ /mswin/
38
38
  lib_prefix = 'lib'
39
39
 
40
40
  # There's no default include/lib dir on Windows. Let's just add the Ruby ones
@@ -468,8 +468,6 @@ static VALUE canonicalize(int argc, VALUE* argv, VALUE self)
468
468
  xmlChar **ns;
469
469
  long ns_len, i;
470
470
 
471
- rb_scan_args(argc, argv, "03", &mode, &incl_ns, &with_comments);
472
-
473
471
  xmlDocPtr doc;
474
472
  xmlOutputBufferPtr buf;
475
473
  xmlC14NIsVisibleCallback cb = NULL;
@@ -478,6 +476,8 @@ static VALUE canonicalize(int argc, VALUE* argv, VALUE self)
478
476
  VALUE rb_cStringIO;
479
477
  VALUE io;
480
478
 
479
+ rb_scan_args(argc, argv, "03", &mode, &incl_ns, &with_comments);
480
+
481
481
  Data_Get_Struct(self, xmlDoc, doc);
482
482
 
483
483
  rb_cStringIO = rb_const_get_at(rb_cObject, rb_intern("StringIO"));
@@ -1,6 +1,6 @@
1
1
  module Nokogiri
2
2
  # The version of Nokogiri you are using
3
- VERSION = '1.5.1.rc1'
3
+ VERSION = '1.5.1'
4
4
 
5
5
  class VersionInfo # :nodoc:
6
6
  def jruby?
@@ -297,7 +297,7 @@ module Nokogiri
297
297
  #
298
298
  # Also see related method +before+.
299
299
  def add_previous_sibling node_or_tags
300
- raise ArgumentError.new("A document may not have multiple root nodes.") if parent.is_a?(XML::Document)
300
+ raise ArgumentError.new("A document may not have multiple root nodes.") if parent.is_a?(XML::Document) && !node_or_tags.is_a?(XML::ProcessingInstruction)
301
301
 
302
302
  node_or_tags = coerce(node_or_tags)
303
303
  if node_or_tags.is_a?(XML::NodeSet)
@@ -248,6 +248,14 @@ module Nokogiri
248
248
  end
249
249
  end
250
250
 
251
+ def test_add_pi_as_previous_sibling_to_root_is_ok
252
+ doc = Nokogiri::XML "<root>foo</root>"
253
+ pi = Nokogiri::XML::ProcessingInstruction.new(doc, "xml-stylesheet", %q{type="text/xsl" href="foo.xsl"})
254
+ doc.root.add_previous_sibling pi
255
+ expected_doc = %Q{<?xml version="1.0"?>\n<?xml-stylesheet type="text/xsl" href="foo.xsl"?>\n<root>foo</root>\n}
256
+ assert_equal expected_doc, doc.to_xml
257
+ end
258
+
251
259
  def test_find_by_css_with_tilde_eql
252
260
  xml = Nokogiri::XML.parse(<<-eoxml)
253
261
  <root>
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokogiri
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1.rc1
5
- prerelease: 6
4
+ version: 1.5.1
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Aaron Patterson
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-02-28 00:00:00.000000000 Z
14
+ date: 2012-03-09 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: hoe-bundler
18
- requirement: &8843680 !ruby/object:Gem::Requirement
18
+ requirement: &10773880 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: '1.1'
24
24
  type: :development
25
25
  prerelease: false
26
- version_requirements: *8843680
26
+ version_requirements: *10773880
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: hoe-debugging
29
- requirement: &8843000 !ruby/object:Gem::Requirement
29
+ requirement: &10773260 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: 1.0.3
35
35
  type: :development
36
36
  prerelease: false
37
- version_requirements: *8843000
37
+ version_requirements: *10773260
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: hoe-gemspec
40
- requirement: &8841700 !ruby/object:Gem::Requirement
40
+ requirement: &10771880 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: '1.0'
46
46
  type: :development
47
47
  prerelease: false
48
- version_requirements: *8841700
48
+ version_requirements: *10771880
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: hoe-git
51
- requirement: &8840860 !ruby/object:Gem::Requirement
51
+ requirement: &10771040 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ! '>='
@@ -56,10 +56,10 @@ dependencies:
56
56
  version: '1.4'
57
57
  type: :development
58
58
  prerelease: false
59
- version_requirements: *8840860
59
+ version_requirements: *10771040
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: mini_portile
62
- requirement: &8839900 !ruby/object:Gem::Requirement
62
+ requirement: &10770080 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - ! '>='
@@ -67,10 +67,10 @@ dependencies:
67
67
  version: 0.2.2
68
68
  type: :development
69
69
  prerelease: false
70
- version_requirements: *8839900
70
+ version_requirements: *10770080
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: minitest
73
- requirement: &8839380 !ruby/object:Gem::Requirement
73
+ requirement: &10769560 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - ~>
@@ -78,10 +78,10 @@ dependencies:
78
78
  version: 2.2.2
79
79
  type: :development
80
80
  prerelease: false
81
- version_requirements: *8839380
81
+ version_requirements: *10769560
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: racc
84
- requirement: &8838560 !ruby/object:Gem::Requirement
84
+ requirement: &10768740 !ruby/object:Gem::Requirement
85
85
  none: false
86
86
  requirements:
87
87
  - - ! '>='
@@ -89,10 +89,10 @@ dependencies:
89
89
  version: 1.4.6
90
90
  type: :development
91
91
  prerelease: false
92
- version_requirements: *8838560
92
+ version_requirements: *10768740
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: rake-compiler
95
- requirement: &8837820 !ruby/object:Gem::Requirement
95
+ requirement: &10768000 !ruby/object:Gem::Requirement
96
96
  none: false
97
97
  requirements:
98
98
  - - =
@@ -100,10 +100,10 @@ dependencies:
100
100
  version: 0.8.0
101
101
  type: :development
102
102
  prerelease: false
103
- version_requirements: *8837820
103
+ version_requirements: *10768000
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: rexical
106
- requirement: &8837300 !ruby/object:Gem::Requirement
106
+ requirement: &10767480 !ruby/object:Gem::Requirement
107
107
  none: false
108
108
  requirements:
109
109
  - - ! '>='
@@ -111,10 +111,10 @@ dependencies:
111
111
  version: 1.0.5
112
112
  type: :development
113
113
  prerelease: false
114
- version_requirements: *8837300
114
+ version_requirements: *10767480
115
115
  - !ruby/object:Gem::Dependency
116
116
  name: rdoc
117
- requirement: &8836700 !ruby/object:Gem::Requirement
117
+ requirement: &10766860 !ruby/object:Gem::Requirement
118
118
  none: false
119
119
  requirements:
120
120
  - - ~>
@@ -122,10 +122,10 @@ dependencies:
122
122
  version: '3.10'
123
123
  type: :development
124
124
  prerelease: false
125
- version_requirements: *8836700
125
+ version_requirements: *10766860
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: hoe
128
- requirement: &8866580 !ruby/object:Gem::Requirement
128
+ requirement: &10795240 !ruby/object:Gem::Requirement
129
129
  none: false
130
130
  requirements:
131
131
  - - ~>
@@ -133,7 +133,7 @@ dependencies:
133
133
  version: '2.13'
134
134
  type: :development
135
135
  prerelease: false
136
- version_requirements: *8866580
136
+ version_requirements: *10795240
137
137
  description: ! 'Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser. Among Nokogiri''s
138
138
 
139
139
  many features is the ability to search documents via XPath or CSS3 selectors.
@@ -439,9 +439,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
439
439
  required_rubygems_version: !ruby/object:Gem::Requirement
440
440
  none: false
441
441
  requirements:
442
- - - ! '>'
442
+ - - ! '>='
443
443
  - !ruby/object:Gem::Version
444
- version: 1.3.1
444
+ version: '0'
445
445
  requirements: []
446
446
  rubyforge_project: nokogiri
447
447
  rubygems_version: 1.8.10