libxml-ruby 0.5.2.0 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. data/CHANGES +122 -0
  2. data/LICENSE +2 -1
  3. data/MANIFEST +138 -0
  4. data/NOTES +9 -0
  5. data/README +1 -1
  6. data/Rakefile +27 -205
  7. data/TODO +0 -2
  8. data/VERSION +1 -0
  9. data/ext/{xml → libxml}/cbg.c +0 -0
  10. data/ext/libxml/extconf.rb +309 -0
  11. data/ext/{xml → libxml}/libxml.c +1 -1
  12. data/ext/{xml → libxml}/libxml.h +7 -4
  13. data/ext/{xml → libxml}/ruby_xml_attr.c +1 -1
  14. data/ext/{xml → libxml}/ruby_xml_attr.h +1 -1
  15. data/ext/{xml → libxml}/ruby_xml_document.c +16 -8
  16. data/ext/{xml → libxml}/ruby_xml_document.h +1 -1
  17. data/ext/{xml → libxml}/ruby_xml_dtd.c +0 -0
  18. data/ext/{xml → libxml}/ruby_xml_dtd.h +0 -0
  19. data/ext/{xml → libxml}/ruby_xml_html_parser.c +1 -1
  20. data/ext/{xml → libxml}/ruby_xml_html_parser.h +1 -1
  21. data/ext/{xml → libxml}/ruby_xml_input_cbg.c +0 -0
  22. data/ext/{xml → libxml}/ruby_xml_input_cbg.h +0 -0
  23. data/ext/{xml → libxml}/ruby_xml_node.c +47 -6
  24. data/ext/{xml → libxml}/ruby_xml_node.h +1 -1
  25. data/ext/{xml → libxml}/ruby_xml_node_set.c +1 -1
  26. data/ext/{xml → libxml}/ruby_xml_node_set.h +1 -1
  27. data/ext/{xml → libxml}/ruby_xml_ns.c +1 -1
  28. data/ext/{xml → libxml}/ruby_xml_ns.h +1 -1
  29. data/ext/{xml → libxml}/ruby_xml_parser.c +6 -4
  30. data/ext/{xml → libxml}/ruby_xml_parser.h +1 -1
  31. data/ext/{xml → libxml}/ruby_xml_parser_context.c +1 -1
  32. data/ext/{xml → libxml}/ruby_xml_parser_context.h +1 -1
  33. data/ext/{xml → libxml}/ruby_xml_reader.c +3 -0
  34. data/ext/{xml → libxml}/ruby_xml_reader.h +0 -0
  35. data/ext/{xml → libxml}/ruby_xml_sax_parser.c +1 -1
  36. data/ext/{xml → libxml}/ruby_xml_sax_parser.h +1 -1
  37. data/ext/{xml → libxml}/ruby_xml_schema.c +0 -0
  38. data/ext/{xml → libxml}/ruby_xml_schema.h +0 -0
  39. data/ext/{xml → libxml}/ruby_xml_state.c +0 -0
  40. data/ext/{xml → libxml}/ruby_xml_state.h +0 -0
  41. data/ext/{xml → libxml}/ruby_xml_tree.c +1 -1
  42. data/ext/{xml → libxml}/ruby_xml_tree.h +1 -1
  43. data/ext/{xml → libxml}/ruby_xml_xinclude.c +1 -1
  44. data/ext/{xml → libxml}/ruby_xml_xinclude.h +1 -1
  45. data/ext/{xml → libxml}/ruby_xml_xpath.c +7 -4
  46. data/ext/{xml → libxml}/ruby_xml_xpath.h +1 -1
  47. data/ext/{xml → libxml}/ruby_xml_xpath_context.c +1 -1
  48. data/ext/{xml → libxml}/ruby_xml_xpath_context.h +1 -1
  49. data/ext/{xml → libxml}/ruby_xml_xpath_object.c +65 -32
  50. data/ext/{xml → libxml}/ruby_xml_xpath_object.h +0 -0
  51. data/ext/{xml → libxml}/ruby_xml_xpointer.c +1 -1
  52. data/ext/{xml → libxml}/ruby_xml_xpointer.h +1 -1
  53. data/ext/{xml → libxml}/ruby_xml_xpointer_context.c +1 -1
  54. data/ext/{xml → libxml}/ruby_xml_xpointer_context.h +1 -1
  55. data/ext/{xml → libxml}/sax_parser_callbacks.inc +1 -1
  56. data/ext/libxml/version.h +9 -0
  57. data/{ext/xml → lib}/libxml.rb +7 -2
  58. data/lib/xml/libxml.rb +5 -0
  59. data/{ChangeLog → log/Changelog-0.txt} +0 -0
  60. data/log/Changelog.txt +435 -0
  61. data/meta/project.yaml +27 -0
  62. data/meta/unixname +1 -0
  63. data/setup.rb +1469 -0
  64. data/site/css/normal.css +182 -0
  65. data/site/img/raze-tiny.png +0 -0
  66. data/site/img/red-cube.jpg +0 -0
  67. data/site/img/xml-ruby.png +0 -0
  68. data/site/index.xml +43 -0
  69. data/site/install.xml +77 -0
  70. data/site/layout.rhtml +38 -0
  71. data/site/layout.xsl +67 -0
  72. data/site/license.xml +32 -0
  73. data/site/log/changelog.xml +1324 -0
  74. data/site/log/changelog.xsl +42 -0
  75. data/{tests → test}/dtd-test.rb +2 -2
  76. data/test/etc_doc_to_s.rb +21 -0
  77. data/test/ets_copy_bug.rb +21 -0
  78. data/test/ets_copy_bug2.rb +32 -0
  79. data/test/ets_doc_file.rb +14 -0
  80. data/test/ets_doc_to_s.rb +21 -0
  81. data/test/ets_gpx.rb +26 -0
  82. data/test/ets_node_gc.rb +21 -0
  83. data/test/ets_test.xml +2 -0
  84. data/test/ets_tsr.rb +9 -0
  85. data/{tests → test}/merge_bug.rb +4 -5
  86. data/{tests → test}/model/default_validation_bug.rb +0 -0
  87. data/{tests → test}/model/merge_bug_data.xml +0 -0
  88. data/{tests → test}/model/rubynet.xml +0 -0
  89. data/{tests → test}/model/rubynet_project +1 -1
  90. data/{tests → test}/model/saxtest.xml +0 -0
  91. data/{tests → test}/model/simple.xml +0 -0
  92. data/{tests → test}/model/xinclude.xml +0 -0
  93. data/{tests → test}/schema-test.rb +2 -2
  94. data/{tests → test}/tc_xml_document.rb +2 -2
  95. data/{tests → test}/tc_xml_document_write.rb +1 -2
  96. data/{tests → test}/tc_xml_document_write2.rb +1 -2
  97. data/{tests → test}/tc_xml_document_write3.rb +1 -2
  98. data/{tests → test}/tc_xml_html_parser.rb +7 -8
  99. data/{tests → test}/tc_xml_node.rb +1 -2
  100. data/{tests → test}/tc_xml_node2.rb +1 -2
  101. data/{tests → test}/tc_xml_node3.rb +2 -3
  102. data/{tests → test}/tc_xml_node4.rb +19 -20
  103. data/{tests → test}/tc_xml_node5.rb +8 -9
  104. data/{tests → test}/tc_xml_node6.rb +1 -2
  105. data/{tests → test}/tc_xml_node7.rb +5 -6
  106. data/{tests → test}/tc_xml_node8.rb +5 -5
  107. data/{tests → test}/tc_xml_node9.rb +5 -5
  108. data/test/tc_xml_node_copy.rb +40 -0
  109. data/{tests → test}/tc_xml_node_set.rb +2 -3
  110. data/{tests → test}/tc_xml_node_set2.rb +4 -5
  111. data/test/tc_xml_node_text.rb +17 -0
  112. data/{tests → test}/tc_xml_node_xlink.rb +2 -2
  113. data/{tests → test}/tc_xml_parser.rb +5 -6
  114. data/{tests → test}/tc_xml_parser2.rb +2 -2
  115. data/{tests → test}/tc_xml_parser3.rb +2 -2
  116. data/{tests → test}/tc_xml_parser4.rb +2 -2
  117. data/{tests → test}/tc_xml_parser5.rb +2 -2
  118. data/{tests → test}/tc_xml_parser6.rb +3 -3
  119. data/{tests → test}/tc_xml_parser7.rb +3 -3
  120. data/{tests → test}/tc_xml_parser8.rb +13 -13
  121. data/{tests → test}/tc_xml_parser_context.rb +1 -2
  122. data/{tests → test}/tc_xml_reader.rb +22 -14
  123. data/{tests → test}/tc_xml_sax_parser.rb +21 -22
  124. data/{tests → test}/tc_xml_xinclude.rb +4 -4
  125. data/{tests → test}/tc_xml_xpath.rb +17 -3
  126. data/{tests → test}/tc_xml_xpointer.rb +4 -5
  127. metadata +231 -158
  128. data/CHANGELOG_to200701 +0 -82
  129. data/ext/xml/extconf.rb +0 -98
  130. data/tests/libxml_test.rb +0 -3
  131. data/tests/runner.rb +0 -11
data/CHANGES ADDED
@@ -0,0 +1,122 @@
1
+ (See log/ChangeLog for more detailed changes derived directly from source control.)
2
+
3
+ == 0.5.3 /
4
+
5
+ === 2007-11-16 "Dan Janowski" <danj at 3skel.com>
6
+
7
+ * Merged Dan's MEM2 branch to trunk.
8
+
9
+
10
+ == 0.5.2 / 2007-10-10
11
+
12
+ === 2007-10-10 "Dan Janowski" <danj at 3skel.com>
13
+
14
+ * (Dan, fill in the major points of the changes you made up to here -thanks)
15
+
16
+ === 2007-01-14 "Laurent Sansonetti" <lrz at chopine.be>
17
+
18
+ * Added some preliminary RDoc comments for XML::Reader.
19
+
20
+ === 2006-12-05 "Laurent Sansonetti" <lrz at chopine.be>
21
+
22
+ * Added XML::Reader, a set of bindings to the xmlTextReader API.
23
+
24
+
25
+ == 0.3.8.4 / 2006-12-02
26
+
27
+ === 2006-04-15 "Ross Bamform" <rosco at roscopeco.co.uk>
28
+
29
+ * Implemented SAX parser callback handling.
30
+
31
+ === 2006-04-12 "Ross Bamford" <rosco at roscopeco.co.uk>
32
+
33
+ * Integrated and tested community patches.
34
+ * Defined XML::Node (hash) equality in terms of XML representation.
35
+
36
+ === 2006-04-12 "Tim Yamin" <plasmaroo at gentoo.org>
37
+
38
+ * Fixed XML::Node#content inoperable bug (plasmaroo) [patch]
39
+ * Fixed memory leak in same
40
+
41
+ === 2006-04-12 "Mark Van Holstyn" <mvette13 at gmail.com>
42
+
43
+ * Added XML::Node::Set#first (mvette13) [patch]
44
+ * Added XML::Node::Set#empty?
45
+ * Fixed XML::Node::Set#to_a
46
+ * Added XML::Node#find_first
47
+ * Added XML::Node#remove!
48
+
49
+ === 2006-03-27 "Ross Bamford" <rosco at roscopeco.co.uk>
50
+
51
+ * Integrated contributed XML::Parser.register_error_handler patch (rosco)
52
+
53
+ === 2006-02-27 "Ross Bamford" <rosco at roscopeco.co.uk>
54
+
55
+ * Fixed all multiple symbol definitions for -fno-common.
56
+ * Removed OSX -fno-common workaround.
57
+
58
+
59
+ == 0.3.6 / 2006-02-23
60
+
61
+ === 2006-02-21 "Ross Bamford" <rosco at roscopeco.co.uk>
62
+
63
+ * Patched extconf.rb with OSX -fno-common workaround
64
+ * Added gem and packaging support to Rakefile
65
+ * Moved version update to Rakefile
66
+ * Removed legacy project utility scripts
67
+
68
+ === 2005-02-19 "Ross Bamford" <rosco at roscopeco.co.uk>
69
+
70
+ * Fixed doublefree bug in ruby_xml_attr.
71
+ * Fixed small leak in parser
72
+
73
+ === 2005-12-18 "Ross Bamford" <rosco at roscopeco.co.uk>
74
+
75
+ * Updated for GCC 4.0 (community patches)
76
+ * Fixed default validation bug
77
+ * Refactored project, removed outdated files, cleaned up tests.
78
+ * Added RDoc documentation across .c files.
79
+ * Fixed up a few strings.
80
+
81
+ === 2004-04-04 "Mangler Jurgen" <et@wkv.at>
82
+
83
+ * ruby_xml_node.cz: fixed ruby_xml_node_property_set. The ill-behaviour
84
+ was, that there was added a second attribute of the same
85
+ name, when you were setting the value of an already existing
86
+ attribute.
87
+
88
+ === 2004-03-17 "Lukas Svoboda" <luks@fi.muni.cz>
89
+
90
+ * ruby_xml_node.c: ruby_xml_node_to_s now returns XML subtree dump.
91
+
92
+ === 2004-02-27 "Martin Povolny" <martin@solnet.cz>
93
+
94
+ * ruby_xml_node.c: added XML::Node.copy, this makes possible building
95
+ of xml documents from nodes taken from other xml documents
96
+ without making ruby SIGSEGV (see tests/copy_bug.rb).
97
+
98
+ === 2004-02-26 "Martin Povolny" <martin@solnet.cz>
99
+
100
+ * ruby_xml_dtd.c, ruby_xml_dtd.h, ruby_xml_schema.c, ruby_xml_schema.h:
101
+ more work on validation, now you can actually validate
102
+ document using dtd or xml schema, also solved warning and
103
+ error propagation (see tests/{dtd|schema}-test.rb).
104
+
105
+ === 2003-12-30 "Martin Povolny" <martin@solnet.cz>
106
+
107
+ * ruby_xml_dtd.c, ruby_xml_dtd.h, ruby_xml_schema.c, ruby_xml_schema.h:
108
+ prelimitary support for dtd and schema validation
109
+
110
+ === 2003-09-15 "Martin Povolny" <martin@solnet.cz>
111
+
112
+ * ruby_xml_input_cbg.c, libxml.c: added class InputCallbacks to make
113
+ possible registering custom input callbacks
114
+ handlers (xmlRegisterInputCallbacks) written in ruby
115
+
116
+ === 2003-08-01 "Martin Povolny" <martin@solnet.cz>
117
+
118
+ * ruby_xml_document.c: corrected argument handling in ruby_xml_document_find
119
+ * ruby_xml_node.c: corrected argument handling in ruby_xml_node_find
120
+
121
+
122
+
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- # $Id: LICENSE 42 2006-02-28 09:57:52Z roscopeco $
1
+ LibXML-Ruby
2
2
 
3
3
  Copyright (c) 2002-2006 Sean Chittenden <sean@chittenden.org> and contributors
4
4
  Copyright (c) 2001 Wai-Sun "Squidster" Chia <waisun.chia@compaq.com>
@@ -20,3 +20,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
20
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
21
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  SOFTWARE.
23
+
data/MANIFEST ADDED
@@ -0,0 +1,138 @@
1
+ Rakefile
2
+ MANIFEST
3
+ test
4
+ test/tc_xml_parser.rb
5
+ test/tc_xml_html_parser.rb
6
+ test/ets_doc_to_s.rb
7
+ test/tc_xml_document_write3.rb
8
+ test/model
9
+ test/model/merge_bug_data.xml
10
+ test/model/xinclude.xml
11
+ test/model/saxtest.xml
12
+ test/model/rubynet.xml
13
+ test/model/simple.xml
14
+ test/model/default_validation_bug.rb
15
+ test/model/rubynet_project
16
+ test/tc_xml_xpath.rb
17
+ test/tc_xml_document_write2.rb
18
+ test/tc_xml_parser_context.rb
19
+ test/ets_test.xml
20
+ test/tc_xml_document.rb
21
+ test/tc_xml_node_text.rb
22
+ test/ets_copy_bug.rb
23
+ test/tc_xml_node.rb
24
+ test/ets_gpx.rb
25
+ test/merge_bug.rb
26
+ test/ets_doc_file.rb
27
+ test/etc_doc_to_s.rb
28
+ test/tc_xml_sax_parser.rb
29
+ test/tc_xml_parser3.rb
30
+ test/dtd-test.rb
31
+ test/tc_xml_parser2.rb
32
+ test/tc_xml_node7.rb
33
+ test/ets_node_gc.rb
34
+ test/tc_xml_node4.rb
35
+ test/tc_xml_xinclude.rb
36
+ test/tc_xml_parser8.rb
37
+ test/tc_xml_document_write.rb
38
+ test/tc_xml_node2.rb
39
+ test/tc_xml_node_xlink.rb
40
+ test/tc_xml_node3.rb
41
+ test/tc_xml_reader.rb
42
+ test/tc_xml_xpointer.rb
43
+ test/tc_xml_node8.rb
44
+ test/schema-test.rb
45
+ test/tc_xml_node9.rb
46
+ test/ets_copy_bug2.rb
47
+ test/tc_xml_parser7.rb
48
+ test/tc_xml_node_set.rb
49
+ test/tc_xml_parser4.rb
50
+ test/tc_xml_parser6.rb
51
+ test/tc_xml_node5.rb
52
+ test/tc_xml_node_copy.rb
53
+ test/ets_tsr.rb
54
+ test/tc_xml_parser5.rb
55
+ test/tc_xml_node6.rb
56
+ test/tc_xml_node_set2.rb
57
+ NOTES
58
+ CHANGES
59
+ TODO
60
+ LICENSE
61
+ README
62
+ ext
63
+ ext/libxml
64
+ ext/libxml/ruby_xml_xpointer_context.c
65
+ ext/libxml/ruby_xml_reader.h
66
+ ext/libxml/ruby_xml_dtd.h
67
+ ext/libxml/ruby_xml_xpointer.h
68
+ ext/libxml/ruby_xml_tree.h
69
+ ext/libxml/ruby_xml_xpath_context.c
70
+ ext/libxml/ruby_xml_schema.c
71
+ ext/libxml/ruby_xml_parser.c
72
+ ext/libxml/ruby_xml_parser.h
73
+ ext/libxml/ruby_xml_html_parser.c
74
+ ext/libxml/ruby_xml_node_set.c
75
+ ext/libxml/ruby_xml_xpath_object.h
76
+ ext/libxml/ruby_xml_tree.c
77
+ ext/libxml/libxml.h
78
+ ext/libxml/ruby_xml_attr.h
79
+ ext/libxml/libxml.c
80
+ ext/libxml/ruby_xml_attr.c
81
+ ext/libxml/ruby_xml_input_cbg.h
82
+ ext/libxml/ruby_xml_schema.h
83
+ ext/libxml/cbg.c
84
+ ext/libxml/ruby_xml_xpath.h
85
+ ext/libxml/ruby_xml_ns.c
86
+ ext/libxml/ruby_xml_document.c
87
+ ext/libxml/ruby_xml_xpath_context.h
88
+ ext/libxml/ruby_xml_reader.c
89
+ ext/libxml/ruby_xml_xpointer_context.h
90
+ ext/libxml/ruby_xml_node.c
91
+ ext/libxml/ruby_xml_ns.h
92
+ ext/libxml/version.h
93
+ ext/libxml/sax_parser_callbacks.inc
94
+ ext/libxml/ruby_xml_parser_context.c
95
+ ext/libxml/ruby_xml_parser_context.h
96
+ ext/libxml/ruby_xml_sax_parser.h
97
+ ext/libxml/ruby_xml_sax_parser.c
98
+ ext/libxml/ruby_xml_xpointer.c
99
+ ext/libxml/ruby_xml_xpath_object.c
100
+ ext/libxml/ruby_xml_state.c
101
+ ext/libxml/ruby_xml_xpath.c
102
+ ext/libxml/extconf.rb
103
+ ext/libxml/ruby_xml_input_cbg.c
104
+ ext/libxml/ruby_xml_xinclude.h
105
+ ext/libxml/ruby_xml_xinclude.c
106
+ ext/libxml/ruby_xml_state.h
107
+ ext/libxml/ruby_xml_document.h
108
+ ext/libxml/ruby_xml_dtd.c
109
+ ext/libxml/ruby_xml_node_set.h
110
+ ext/libxml/ruby_xml_node.h
111
+ ext/libxml/ruby_xml_html_parser.h
112
+ setup.rb
113
+ meta
114
+ meta/project.yaml
115
+ meta/unixname
116
+ site
117
+ site/img
118
+ site/img/xml-ruby.png
119
+ site/img/red-cube.jpg
120
+ site/img/raze-tiny.png
121
+ site/layout.rhtml
122
+ site/license.xml
123
+ site/layout.xsl
124
+ site/index.xml
125
+ site/install.xml
126
+ site/css
127
+ site/css/normal.css
128
+ site/log
129
+ site/log/changelog.xml
130
+ site/log/changelog.xsl
131
+ lib
132
+ lib/libxml.rb
133
+ lib/xml
134
+ lib/xml/libxml.rb
135
+ VERSION
136
+ log
137
+ log/Changelog.txt
138
+ log/Changelog-0.txt
data/NOTES ADDED
@@ -0,0 +1,9 @@
1
+
2
+ [Put Current Release Notes here]
3
+
4
+ ==== BUGS
5
+
6
+ * Some C funcs need more NULL checking, they're throwing wierd
7
+ ArgumentErrors into RubyLand. See TODOs in source.
8
+
9
+
data/README CHANGED
@@ -141,4 +141,4 @@ And your terminal should look like:
141
141
 
142
142
  If you have any questions, please send email to libxml-devel@rubyforge.org.
143
143
 
144
- # $Id: README 83 2006-08-15 13:49:53Z roscopeco $
144
+ # $Id: README 143 2007-08-29 21:45:48Z transami $
data/Rakefile CHANGED
@@ -1,216 +1,38 @@
1
- require 'net/ftp'
2
- require 'rake/clean'
3
- require 'rake/testtask'
4
- require 'rake/rdoctask'
5
- require 'rake/gempackagetask'
1
+ require File.join(File.dirname(__FILE__), "setup.rb")
6
2
 
7
- CLEAN.include '**/*.o'
8
- CLEAN.include '**/*.so'
9
- CLEAN.include 'html'
10
- CLOBBER.include '**/*.log'
11
- CLOBBER.include '**/Makefile'
12
- CLOBBER.include '**/extconf.h'
3
+ # Run memory tests
4
+ # TODO: Ensure compile first (but only if needed) with make?
13
5
 
14
- desc "Default Task (Build release)"
15
- task :default => :release
6
+ desc "Run memory leak test."
7
+ task :memtest do
16
8
 
17
- # Determine the current version of the software
18
- if File.read('ext/xml/libxml.h') =~ /\s*RUBY_LIBXML_VERSION\s*['"](\d.+)['"]/
19
- CURRENT_VERSION = $1
20
- else
21
- CURRENT_VERSION = "0.0.0"
22
- end
23
-
24
- if ENV['REL']
25
- PKG_VERSION = ENV['REL']
26
- else
27
- PKG_VERSION = CURRENT_VERSION
28
- end
29
-
30
- task :test_ver do
31
- puts PKG_VERSION
32
- end
9
+ live = ENV['live']
33
10
 
34
- # Make tasks -----------------------------------------------------
35
- MAKECMD = ENV['MAKE_CMD'] || 'make'
36
- MAKEOPTS = ENV['MAKE_OPTS'] || ''
37
-
38
- file 'ext/xml/Makefile' => 'ext/xml/extconf.rb' do
39
- Dir.chdir('ext/xml') do
40
- ruby 'extconf.rb'
11
+ unless live
12
+ $LOAD_PATH.unshift(File.expand_path('ext/libxml'))
13
+ $LOAD_PATH.unshift(File.expand_path('lib'))
41
14
  end
42
- end
43
-
44
- def make(target = '')
45
- Dir.chdir('ext/xml') do
46
- pid = fork { exec "#{MAKECMD} #{MAKEOPTS} #{target}" }
47
- Process.waitpid pid
48
- end
49
- $?.exitstatus
50
- end
51
-
52
- # Let make handle dependencies between c/o/so - we'll just run it.
53
- file 'ext/xml/libxml.so' => 'ext/xml/Makefile' do
54
- m = make
55
- fail "Make failed (status #{m})" unless m == 0
56
- end
57
-
58
- desc "Compile the shared object"
59
- task :compile => 'ext/xml/libxml.so'
60
-
61
- desc "Install to your site_ruby directory"
62
- task :install => :compile do
63
- m = make 'install'
64
- fail "Make install failed (status #{m})" unless m == 0
65
- end
66
-
67
- # Test Tasks ---------------------------------------------------------
68
- task :ta => :alltests
69
- task :tu => :unittests
70
- task :test => :unittests
71
- task :tm => :memtests
72
-
73
- Rake::TestTask.new(:alltests) do |t|
74
- t.test_files = FileList[
75
- 'tests/runner.rb',
76
- 'tests/contrib/*.rb',
77
- ]
78
- t.verbose = true
79
- end
80
-
81
- Rake::TestTask.new(:unittests) do |t|
82
- t.test_files = FileList['tests/runner.rb']
83
- t.verbose = false
84
- end
85
-
86
- Rake::TestTask.new(:memtests) do |t|
87
- t.test_files = FileList[
88
- 'rwtest/runner.rb'
89
- ]
90
- t.verbose = true
91
- end
92
-
93
- #Rake::TestTask.new(:funtests) do |t|
94
- # t.test_files = FileList['test/fun*.rb']
95
- #t.warning = true
96
- #t.warning = true
97
- #end
98
-
99
- task :unittests => :compile
100
- task :alltests => :compile
101
- task :memtests => :compile
15
+ $LOAD_PATH.unshift('test') # NEEDED?
102
16
 
103
- # RDoc Tasks ---------------------------------------------------------
104
- desc "Create the RDOC documentation tree"
105
- rd = Rake::RDocTask.new(:doc) do |rdoc|
106
- rdoc.rdoc_dir = 'html'
107
- rdoc.title = "Libxml-Ruby API"
108
- rdoc.options << '--main' << 'README'
109
- rdoc.rdoc_files.include('README', 'LICENSE', 'TODO')
110
- rdoc.rdoc_files.include('ext/xml/ruby_xml*.c', 'ext/xml/libxml.rb')
111
- rdoc.rdoc_files.include('*.rdoc')
112
- end
113
-
114
- desc "Publish the RDoc documentation to project web site"
115
- task :pubdoc => [ :doc ] do
116
- unless ENV['RUBYFORGE_ACCT']
117
- raise "Need to set RUBYFORGE_ACCT to your rubyforge.org user name (e.g. 'fred')"
118
- end
119
- require 'rake/contrib/sshpublisher'
120
- Rake::SshDirPublisher.new(
121
- "#{ENV['RUBYFORGE_ACCT']}@rubyforge.org",
122
- "/var/www/gforge-projects/libxml/doc",
123
- "html"
124
- ).upload
125
- end
17
+ glob = 'test/ets_*.rb'
126
18
 
127
- # Packaging / Version number tasks -----------------------------------
128
- # Used during release packaging if a REL is supplied
129
- task :update_version do
130
- unless PKG_VERSION == CURRENT_VERSION
131
- pkg_vernum = PKG_VERSION.tr('.','').sub(/^0*/,'')
132
- pkg_vernum << '0' until pkg_vernum.length > 2
133
-
134
- File.open('ext/xml/libxml.h.new','w+') do |f|
135
- maj, min, mic, patch = /(\d+)\.(\d+)(?:\.(\d+))?(?:\.(\d+))?/.match(PKG_VERSION).captures
136
- f << File.read('ext/xml/libxml.h').
137
- gsub(/RUBY_LIBXML_VERSION\s+"(\d.+)"/) { "RUBY_LIBXML_VERSION \"#{PKG_VERSION}\"" }.
138
- gsub(/RUBY_LIBXML_VERNUM\s+\d+/) { "RUBY_LIBXML_VERNUM #{pkg_vernum}" }.
139
- gsub(/RUBY_LIBXML_VER_MAJ\s+\d+/) { "RUBY_LIBXML_VER_MAJ #{maj}" }.
140
- gsub(/RUBY_LIBXML_VER_MIN\s+\d+/) { "RUBY_LIBXML_VER_MIN #{min}" }.
141
- gsub(/RUBY_LIBXML_VER_MIC\s+\d+/) { "RUBY_LIBXML_VER_MIC #{mic || 0}" }.
142
- gsub(/RUBY_LIBXML_VER_PATCH\s+\d+/) { "RUBY_LIBXML_VER_PATCH #{patch || 0}" }
19
+ Dir[glob].each do |fn|
20
+ next if File.directory?(fn)
21
+ puts "test #{fn}"
22
+ f=Process.fork
23
+ if f.nil?
24
+ require fn
25
+ exit
143
26
  end
144
- mv('ext/xml/libxml.h.new', 'ext/xml/libxml.h')
145
- end
146
- end
147
-
148
- PKG_FILES = FileList[
149
- 'ext/xml/*.rb',
150
- 'ext/xml/extconf.rb',
151
- '[A-Z]*',
152
- 'ext/xml/*.c',
153
- 'ext/xml/*.inc',
154
- 'ext/xml/ruby_xml*.h',
155
- 'ext/xml/libxml.h',
156
- 'tests/**/*',
157
- ]
158
-
159
- if ! defined?(Gem)
160
- warn "Package Target requires RubyGEMs"
161
- else
162
- spec = Gem::Specification.new do |s|
163
-
164
- #### Basic information.
165
-
166
- s.name = 'libxml-ruby'
167
- s.version = PKG_VERSION
168
- s.summary = "LibXML2 bindings for Ruby"
169
- s.description = <<-EOF
170
- C-language bindings for Gnome LibXML2 and Ruby. Supports
171
- high-speed, feature rich XML processing in Ruby apps.
172
- EOF
173
- s.extensions = 'ext/xml/extconf.rb'
174
-
175
- #### Which files are to be included in this gem?
176
-
177
- s.files = PKG_FILES.to_a
178
-
179
- #### Load-time details
180
- s.require_path = 'lib'
181
-
182
- #### Documentation and testing.
183
- s.has_rdoc = true
184
- s.extra_rdoc_files = rd.rdoc_files.to_a
185
- s.rdoc_options <<
186
- '--title' << 'Libxml-Ruby API' <<
187
- '--main' << 'README'
188
-
189
- s.test_files = Dir.glob('tests/*runner.rb')
190
-
191
- #### Author and project details.
192
-
193
- s.author = "Sean Chittenden"
194
- s.email = "libxml-devel@rubyforge.org"
195
- s.homepage = "http://libxml.rubyforge.org"
196
- s.rubyforge_project = "libxml"
197
- end
198
-
199
- # Quick fix for Ruby 1.8.3 / YAML bug
200
- if (RUBY_VERSION == '1.8.3')
201
- def spec.to_yaml
202
- out = super
203
- out = '--- ' + out unless out =~ /^---/
204
- out
205
- end
27
+ rss_k=0
28
+ while (px=Process.wait2(f,Process::WNOHANG)).nil?
29
+ sleep 2
30
+ rss_k2=`ps -o rss= -p #{f}`.to_i
31
+ rss_k=(rss_k2>rss_k) ? rss_k2 : rss_k
32
+ end
33
+ pid,status=px
34
+ puts "\nProcess #{pid} exited status #{status.exitstatus}, max rss(k) #{rss_k}"
206
35
  end
207
36
 
208
- package_task = Rake::GemPackageTask.new(spec) do |pkg|
209
- pkg.need_zip = true
210
- pkg.need_tar_gz = true
211
- pkg.package_dir = 'pkg'
212
- end
213
-
214
- desc "Build a full release"
215
- task :release => [:clobber, :update_version, :compile, :test, :package]
216
37
  end
38
+