libxml-ruby 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +49 -0
- data/LICENSE +22 -0
- data/README +129 -0
- data/Rakefile +197 -0
- data/TODO +84 -0
- data/ext/xml/cbg.c +76 -0
- data/ext/xml/extconf.rb +95 -0
- data/ext/xml/libxml.c +86 -0
- data/ext/xml/libxml.h +79 -0
- data/ext/xml/ruby_xml_attr.c +372 -0
- data/ext/xml/ruby_xml_attr.h +21 -0
- data/ext/xml/ruby_xml_attribute.c +224 -0
- data/ext/xml/ruby_xml_attribute.h +21 -0
- data/ext/xml/ruby_xml_document.c +1159 -0
- data/ext/xml/ruby_xml_document.h +27 -0
- data/ext/xml/ruby_xml_dtd.c +168 -0
- data/ext/xml/ruby_xml_dtd.h +17 -0
- data/ext/xml/ruby_xml_input_cbg.c +167 -0
- data/ext/xml/ruby_xml_input_cbg.h +21 -0
- data/ext/xml/ruby_xml_node.c +2052 -0
- data/ext/xml/ruby_xml_node.h +28 -0
- data/ext/xml/ruby_xml_node_set.c +197 -0
- data/ext/xml/ruby_xml_node_set.h +26 -0
- data/ext/xml/ruby_xml_ns.c +153 -0
- data/ext/xml/ruby_xml_ns.h +21 -0
- data/ext/xml/ruby_xml_parser.c +1363 -0
- data/ext/xml/ruby_xml_parser.h +31 -0
- data/ext/xml/ruby_xml_parser_context.c +715 -0
- data/ext/xml/ruby_xml_parser_context.h +22 -0
- data/ext/xml/ruby_xml_sax_parser.c +181 -0
- data/ext/xml/ruby_xml_sax_parser.h +21 -0
- data/ext/xml/ruby_xml_schema.c +142 -0
- data/ext/xml/ruby_xml_schema.h +16 -0
- data/ext/xml/ruby_xml_tree.c +43 -0
- data/ext/xml/ruby_xml_tree.h +12 -0
- data/ext/xml/ruby_xml_xinclude.c +20 -0
- data/ext/xml/ruby_xml_xinclude.h +13 -0
- data/ext/xml/ruby_xml_xpath.c +357 -0
- data/ext/xml/ruby_xml_xpath.h +24 -0
- data/ext/xml/ruby_xml_xpath_context.c +124 -0
- data/ext/xml/ruby_xml_xpath_context.h +24 -0
- data/ext/xml/ruby_xml_xpointer.c +100 -0
- data/ext/xml/ruby_xml_xpointer.h +27 -0
- data/ext/xml/ruby_xml_xpointer_context.c +22 -0
- data/ext/xml/ruby_xml_xpointer_context.h +18 -0
- data/tests/copy_bug.rb +21 -0
- data/tests/dtd-test.rb +24 -0
- data/tests/model/default_validation_bug.rb +0 -0
- data/tests/model/rubynet.xml +78 -0
- data/tests/model/rubynet_project +13 -0
- data/tests/model/xinclude.xml +5 -0
- data/tests/runner.rb +13 -0
- data/tests/schema-test.rb +74 -0
- data/tests/tc_default_validation.rb +0 -0
- data/tests/tc_xml_document.rb +51 -0
- data/tests/tc_xml_document_write.rb +25 -0
- data/tests/tc_xml_document_write2.rb +55 -0
- data/tests/tc_xml_document_write3.rb +97 -0
- data/tests/tc_xml_node.rb +59 -0
- data/tests/tc_xml_node2.rb +26 -0
- data/tests/tc_xml_node_set.rb +25 -0
- data/tests/tc_xml_node_xlink.rb +28 -0
- data/tests/tc_xml_parser.rb +175 -0
- data/tests/tc_xml_parser2.rb +17 -0
- data/tests/tc_xml_parser3.rb +23 -0
- data/tests/tc_xml_parser4.rb +33 -0
- data/tests/tc_xml_parser5.rb +27 -0
- data/tests/tc_xml_parser6.rb +23 -0
- data/tests/tc_xml_parser7.rb +28 -0
- data/tests/tc_xml_parser_context.rb +89 -0
- data/tests/tc_xml_xinclude.rb +30 -0
- data/tests/tc_xml_xpath.rb +23 -0
- data/tests/tc_xml_xpointer.rb +78 -0
- metadata +144 -0
data/CHANGELOG
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
===== 21.2.2006 Ross Bamford <rosco@roscopeco.co.uk>
|
2
|
+
* Patched extconf.rb with OSX -fno-common workaround
|
3
|
+
* Added gem and packaging support to Rakefile
|
4
|
+
* Moved version update to Rakefile
|
5
|
+
* Removed legacy project utility scripts
|
6
|
+
|
7
|
+
===== 19.2.2006 Ross Bamford <rosco@roscopeco.co.uk>
|
8
|
+
* Fixed doublefree bug in ruby_xml_attr.
|
9
|
+
* Fixed small leak in parser
|
10
|
+
|
11
|
+
===== 18.12.2005 Ross Bamford <rosco@roscopeco.co.uk>
|
12
|
+
* Updated for GCC 4.0 (community patches)
|
13
|
+
* Fixed default validation bug
|
14
|
+
* Refactored project, removed outdated files, cleaned up tests.
|
15
|
+
* Added RDoc documentation across .c files.
|
16
|
+
* Fixed up a few strings.
|
17
|
+
|
18
|
+
===== 14.4.2004 Mangler Jurgen <et@wkv.at>
|
19
|
+
* ruby_xml_node.cz: fixed ruby_xml_node_property_set. The ill-behaviour
|
20
|
+
was, that there was added a second attribute of the same
|
21
|
+
name, when you were setting the value of an already existing
|
22
|
+
attribute.
|
23
|
+
|
24
|
+
===== 17.3.2004 Lukas Svoboda <luks@fi.muni.cz>
|
25
|
+
* ruby_xml_node.c: ruby_xml_node_to_s now returns XML subtree dump.
|
26
|
+
|
27
|
+
===== 27.2.2004 Martin Povolny <martin@solnet.cz>
|
28
|
+
* ruby_xml_node.c: added XML::Node.copy, this makes possible building
|
29
|
+
of xml documents from nodes taken from other xml documents
|
30
|
+
without making ruby SIGSEGV (see tests/copy_bug.rb).
|
31
|
+
|
32
|
+
===== 26.2.2004 Martin Povolny <martin@solnet.cz>
|
33
|
+
* ruby_xml_dtd.c, ruby_xml_dtd.h, ruby_xml_schema.c, ruby_xml_schema.h:
|
34
|
+
more work on validation, now you can actually validate
|
35
|
+
document using dtd or xml schema, also solved warning and
|
36
|
+
error propagation (see tests/{dtd|schema}-test.rb).
|
37
|
+
|
38
|
+
===== 30.12.2003 Martin Povolny <martin@solnet.cz>
|
39
|
+
* ruby_xml_dtd.c, ruby_xml_dtd.h, ruby_xml_schema.c, ruby_xml_schema.h:
|
40
|
+
prelimitary support for dtd and schema validation
|
41
|
+
|
42
|
+
===== 15.9.2003 Martin Povolny <martin@solnet.cz>
|
43
|
+
* ruby_xml_input_cbg.c, libxml.c: added class InputCallbacks to make
|
44
|
+
possible registering custom input callbacks
|
45
|
+
handlers (xmlRegisterInputCallbacks) written in ruby
|
46
|
+
|
47
|
+
===== 1.8.2003 Martin Povolny <martin@solnet.cz>
|
48
|
+
* ruby_xml_document.c: corrected argument handling in ruby_xml_document_find
|
49
|
+
* ruby_xml_node.c: corrected argument handling in ruby_xml_node_find
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# $Id: LICENSE,v 1.2 2005/12/29 19:00:01 bshow Exp $
|
2
|
+
|
3
|
+
Copyright (c) 2002-2005 Sean Chittenden <sean@chittenden.org> and contributors
|
4
|
+
Copyright (c) 2001 Wai-Sun "Squidster" Chia <waisun.chia@compaq.com>
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
7
|
+
this software and associated documentation files (the "Software"), to deal in
|
8
|
+
the Software without restriction, including without limitation the rights to
|
9
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
10
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
11
|
+
so, subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
14
|
+
copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
SOFTWARE.
|
data/README
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
== INSTALLATION
|
2
|
+
|
3
|
+
Installation is simple. Follow the following steps:
|
4
|
+
|
5
|
+
$ ruby extconf.rb
|
6
|
+
$ make
|
7
|
+
# make install
|
8
|
+
|
9
|
+
If extconf yacks up an error, follow the instructions it provides.
|
10
|
+
Once installed, look at the test scripts (*.rb, not extconf.rb) and
|
11
|
+
make sure you run document_self.rb to see what's available.
|
12
|
+
|
13
|
+
== DEPENDENCIES
|
14
|
+
|
15
|
+
libxml requires a few other libraries to be installed inorder to
|
16
|
+
function properly.
|
17
|
+
|
18
|
+
* libm (math routines: very standard)
|
19
|
+
* libz (zlib)
|
20
|
+
* libiconv
|
21
|
+
* libxml2
|
22
|
+
|
23
|
+
== USAGE
|
24
|
+
|
25
|
+
Basic usage for reading and writing documents.
|
26
|
+
|
27
|
+
=== WRITING
|
28
|
+
|
29
|
+
Writing a simple document:
|
30
|
+
|
31
|
+
require 'xml/libxml'
|
32
|
+
doc = XML::Document.new()
|
33
|
+
doc.root = XML::Node.new('root_node')
|
34
|
+
root = doc.root
|
35
|
+
|
36
|
+
root << elem1 = XML::Node.new('elem1')
|
37
|
+
elem1['attr1'] = 'val1'
|
38
|
+
elem1['attr2'] = 'val2'
|
39
|
+
|
40
|
+
root << elem2 = XML::Node.new('elem2')
|
41
|
+
elem2['attr1'] = 'val1'
|
42
|
+
elem2['attr2'] = 'val2'
|
43
|
+
|
44
|
+
root << elem3 = XML::Node.new('elem3')
|
45
|
+
elem3 << elem4 = XML::Node.new('elem4')
|
46
|
+
elem3 << elem5 = XML::Node.new('elem5')
|
47
|
+
|
48
|
+
elem5 << elem6 = XML::Node.new('elem6')
|
49
|
+
elem6 << 'Content for element 6'
|
50
|
+
|
51
|
+
elem3['attr'] = 'baz'
|
52
|
+
|
53
|
+
# Namespace hack to reduce the numer of times XML:: is typed
|
54
|
+
include XML
|
55
|
+
root << elem7 = Node.new('foo')
|
56
|
+
1.upto(10) do |i|
|
57
|
+
elem7 << n = Node.new('bar')
|
58
|
+
n << i
|
59
|
+
end
|
60
|
+
|
61
|
+
format = true
|
62
|
+
doc.save('output.xml', format)
|
63
|
+
|
64
|
+
The file output.xml contains:
|
65
|
+
|
66
|
+
<?xml version="1.0"?>
|
67
|
+
<root_node>
|
68
|
+
<elem1 attr1="val1" attr2="val2"/>
|
69
|
+
<elem2 attr1="val1" attr2="val2"/>
|
70
|
+
<elem3 attr="baz">
|
71
|
+
<elem4/>
|
72
|
+
<elem5>
|
73
|
+
<elem6>Content for element 6</elem6>
|
74
|
+
</elem5>
|
75
|
+
</elem3>
|
76
|
+
<foo>
|
77
|
+
<bar>1</bar>
|
78
|
+
<bar>2</bar>
|
79
|
+
<bar>3</bar>
|
80
|
+
<bar>4</bar>
|
81
|
+
<bar>5</bar>
|
82
|
+
<bar>6</bar>
|
83
|
+
<bar>7</bar>
|
84
|
+
<bar>8</bar>
|
85
|
+
<bar>9</bar>
|
86
|
+
<bar>10</bar>
|
87
|
+
</foo>
|
88
|
+
</root_node>
|
89
|
+
|
90
|
+
=== READING
|
91
|
+
|
92
|
+
Reading XML is slightly more complex and there are many more ways to
|
93
|
+
perform this operation. This reads in and processes the above
|
94
|
+
generated XML document, output.xml. This script assumes that the
|
95
|
+
structure of the document is already known.
|
96
|
+
|
97
|
+
require 'xml/libxml'
|
98
|
+
doc = XML::Document.file('output.xml')
|
99
|
+
root = doc.root
|
100
|
+
|
101
|
+
puts "Root element name: #{root.name}"
|
102
|
+
|
103
|
+
elem3 = root.find('elem3').to_a.first
|
104
|
+
puts "Elem3: #{elem3['attr']}"
|
105
|
+
|
106
|
+
doc.find('//root_node/foo/bar').each do |node|
|
107
|
+
puts "Node path: #{node.path} \t Contents: #{node}"
|
108
|
+
end
|
109
|
+
|
110
|
+
And your terminal should look like:
|
111
|
+
|
112
|
+
Root element name: root_node
|
113
|
+
Elem3: baz
|
114
|
+
Node path: /root_node/foo/bar[1] Contents: 1
|
115
|
+
Node path: /root_node/foo/bar[2] Contents: 2
|
116
|
+
Node path: /root_node/foo/bar[3] Contents: 3
|
117
|
+
Node path: /root_node/foo/bar[4] Contents: 4
|
118
|
+
Node path: /root_node/foo/bar[5] Contents: 5
|
119
|
+
Node path: /root_node/foo/bar[6] Contents: 6
|
120
|
+
Node path: /root_node/foo/bar[7] Contents: 7
|
121
|
+
Node path: /root_node/foo/bar[8] Contents: 8
|
122
|
+
Node path: /root_node/foo/bar[9] Contents: 9
|
123
|
+
Node path: /root_node/foo/bar[10] Contents: 10
|
124
|
+
|
125
|
+
== MORE INFORMATION
|
126
|
+
|
127
|
+
If you have any questions, please send email to libxml-devel@rubyforge.org.
|
128
|
+
|
129
|
+
# $Id: README,v 1.2 2005/12/19 20:51:39 roscopeco Exp $
|
data/Rakefile
ADDED
@@ -0,0 +1,197 @@
|
|
1
|
+
require 'net/ftp'
|
2
|
+
require 'rake/clean'
|
3
|
+
require 'rake/testtask'
|
4
|
+
require 'rake/rdoctask'
|
5
|
+
require 'rake/gempackagetask'
|
6
|
+
|
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'
|
13
|
+
|
14
|
+
desc "Default Task (Build release)"
|
15
|
+
task :default => :release
|
16
|
+
|
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
|
33
|
+
|
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'
|
41
|
+
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
|
+
|
72
|
+
Rake::TestTask.new(:alltests) do |t|
|
73
|
+
t.test_files = FileList[
|
74
|
+
'tests/tc_*.rb',
|
75
|
+
'tests/contrib/*.rb',
|
76
|
+
]
|
77
|
+
t.verbose = true
|
78
|
+
end
|
79
|
+
|
80
|
+
Rake::TestTask.new(:unittests) do |t|
|
81
|
+
t.test_files = FileList['tests/tc_*.rb']
|
82
|
+
t.verbose = false
|
83
|
+
end
|
84
|
+
|
85
|
+
#Rake::TestTask.new(:funtests) do |t|
|
86
|
+
# t.test_files = FileList['test/fun*.rb']
|
87
|
+
#t.warning = true
|
88
|
+
#t.warning = true
|
89
|
+
#end
|
90
|
+
|
91
|
+
task :unittests => :compile
|
92
|
+
task :alltests => :compile
|
93
|
+
|
94
|
+
# RDoc Tasks ---------------------------------------------------------
|
95
|
+
desc "Create the RDOC documentation tree"
|
96
|
+
rd = Rake::RDocTask.new(:doc) do |rdoc|
|
97
|
+
rdoc.rdoc_dir = 'html'
|
98
|
+
rdoc.title = "Libxml-Ruby API"
|
99
|
+
rdoc.options << '--main' << 'README'
|
100
|
+
rdoc.rdoc_files.include('README', 'LICENSE', 'TODO')
|
101
|
+
rdoc.rdoc_files.include('ext/xml/ruby_xml*.c', '*.rdoc')
|
102
|
+
end
|
103
|
+
|
104
|
+
desc "Publish the RDoc documentation to project web site"
|
105
|
+
task :pubdoc => [ :doc ] do
|
106
|
+
unless ENV['RUBYFORGE_ACCT']
|
107
|
+
raise "Need to set RUBYFORGE_ACCT to your rubyforge.org user name (e.g. 'fred')"
|
108
|
+
end
|
109
|
+
require 'rake/contrib/sshpublisher'
|
110
|
+
Rake::SshDirPublisher.new(
|
111
|
+
"#{ENV['RUBYFORGE_ACCT']}@rubyforge.org",
|
112
|
+
"/var/www/gforge-projects/libxml/doc",
|
113
|
+
"html"
|
114
|
+
).upload
|
115
|
+
end
|
116
|
+
|
117
|
+
# Packaging / Version number tasks -----------------------------------
|
118
|
+
# Used during release packaging if a REL is supplied
|
119
|
+
task :update_version do
|
120
|
+
unless PKG_VERSION == CURRENT_VERSION
|
121
|
+
File.open('ext/xml/libxml.h.new','w+') do |f|
|
122
|
+
f << File.read('ext/xml/libxml.h').
|
123
|
+
gsub(/RUBY_LIBXML_VERSION\s+"(\d.+)"/) { "RUBY_LIBXML_VERSION \"#{PKG_VERSION}\"" }.
|
124
|
+
gsub(/RUBY_LIBXML_VERNUM\s+\d+/) { "RUBY_LIBXML_VERNUM #{PKG_VERSION.tr('.','')}" }
|
125
|
+
end
|
126
|
+
mv('ext/xml/libxml.h.new', 'ext/xml/libxml.h')
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
PKG_FILES = FileList[
|
131
|
+
'ext/xml/extconf.rb',
|
132
|
+
'[A-Z]*',
|
133
|
+
'ext/xml/*.c',
|
134
|
+
'ext/xml/ruby_xml*.h',
|
135
|
+
'ext/xml/libxml.h',
|
136
|
+
'tests/**/*',
|
137
|
+
]
|
138
|
+
|
139
|
+
if ! defined?(Gem)
|
140
|
+
warn "Package Target requires RubyGEMs"
|
141
|
+
else
|
142
|
+
spec = Gem::Specification.new do |s|
|
143
|
+
|
144
|
+
#### Basic information.
|
145
|
+
|
146
|
+
s.name = 'libxml-ruby'
|
147
|
+
s.version = PKG_VERSION
|
148
|
+
s.summary = "LibXML2 bindings for Ruby"
|
149
|
+
s.description = <<-EOF
|
150
|
+
C-language bindings for Gnome LibXML2 and Ruby. Supports
|
151
|
+
high-speed, feature rich XML processing in Ruby apps.
|
152
|
+
EOF
|
153
|
+
s.extensions = 'ext/xml/extconf.rb'
|
154
|
+
|
155
|
+
#### Which files are to be included in this gem?
|
156
|
+
|
157
|
+
s.files = PKG_FILES.to_a
|
158
|
+
|
159
|
+
#### Load-time details
|
160
|
+
s.require_path = 'ext'
|
161
|
+
|
162
|
+
#### Documentation and testing.
|
163
|
+
s.has_rdoc = true
|
164
|
+
s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
|
165
|
+
s.rdoc_options <<
|
166
|
+
'--title' << 'Libxml-Ruby API' <<
|
167
|
+
'--main' << 'README' <<
|
168
|
+
'-o' << 'rdoc'
|
169
|
+
|
170
|
+
s.test_files = Dir.glob('tests/*runner.rb')
|
171
|
+
|
172
|
+
#### Author and project details.
|
173
|
+
|
174
|
+
s.author = "Sean Chittenden"
|
175
|
+
s.email = "libxml-devel@rubyforge.org"
|
176
|
+
s.homepage = "http://libxml.rubyforge.org"
|
177
|
+
s.rubyforge_project = "libxml"
|
178
|
+
end
|
179
|
+
|
180
|
+
# Quick fix for Ruby 1.8.3 / YAML bug
|
181
|
+
if (RUBY_VERSION == '1.8.3')
|
182
|
+
def spec.to_yaml
|
183
|
+
out = super
|
184
|
+
out = '--- ' + out unless out =~ /^---/
|
185
|
+
out
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
package_task = Rake::GemPackageTask.new(spec) do |pkg|
|
190
|
+
pkg.need_zip = true
|
191
|
+
pkg.need_tar_gz = true
|
192
|
+
pkg.package_dir = 'pkg'
|
193
|
+
end
|
194
|
+
|
195
|
+
desc "Build a full release"
|
196
|
+
task :release => [:clobber, :update_version, :compile, :test, :package]
|
197
|
+
end
|
data/TODO
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
$Id: TODO,v 1.1 2005/12/19 19:53:07 roscopeco Exp $
|
2
|
+
|
3
|
+
==== BUGS
|
4
|
+
|
5
|
+
* Hunt down a 4-8KB/s leak while running rubytest -i0 -F on the library.
|
6
|
+
|
7
|
+
* Also some other C-side problems:
|
8
|
+
* doublefree at Ruby exit when copying nodes between documents,
|
9
|
+
and using node sets, sample trace in node_set_bug.txt
|
10
|
+
* XML::Attr.name gives [BUG] segfault line.
|
11
|
+
|
12
|
+
* Some C funcs need more NULL checking, they're throwing wierd
|
13
|
+
ArgumentErrors into RubyLand. See TODOs in source.
|
14
|
+
|
15
|
+
* Get libxml to compile and build with OS-X.
|
16
|
+
|
17
|
+
==== ENHANCEMENTS
|
18
|
+
|
19
|
+
* Add warnings to each of the xpath functions if xpath isn't compiled
|
20
|
+
in.
|
21
|
+
|
22
|
+
* Flush out XML::XPath::Context to more closely mirror the
|
23
|
+
_xmlXPathContext(libxml/xpath.h) structure.
|
24
|
+
|
25
|
+
* Add XML::Node#sibling= to add siblings to an XML document
|
26
|
+
|
27
|
+
* Cleanup the variable naming schemes and standardize on one. Ideas:
|
28
|
+
|
29
|
+
* All VALUE encapsulated objects are prefixed with the character
|
30
|
+
'r'. rnode, rdoc, rctxt, rxpath, rxnset, rxns.
|
31
|
+
|
32
|
+
* Their unwrapped C equiv drops the 'r'. Since operating with
|
33
|
+
libxml isn't context less, this should help catch the cases
|
34
|
+
where having routines that are libxml derived (ex: xmlNodePtr)
|
35
|
+
and ruby-libxml derived (ex: ruby_xml_node) should collide in
|
36
|
+
the same name space convention. This will act as a reminder
|
37
|
+
and deterrant against haphazardly returning and using libxml
|
38
|
+
objects when they should be passed in. ruby-libxml is a set
|
39
|
+
of tools, not and end result. Put the power and options in
|
40
|
+
the hands of the user and don't confine or constrain anything
|
41
|
+
within reason. Just because someone can't think of a use for
|
42
|
+
it doesn't mean it's not possible or useful to someone. It's
|
43
|
+
the weird shit that makes a library powerful.
|
44
|
+
|
45
|
+
rnode -> node
|
46
|
+
rdoc -> doc
|
47
|
+
rctxt -> ctxt
|
48
|
+
rxpath -> xpath
|
49
|
+
|
50
|
+
* Should sweep through the code and remove all instances of
|
51
|
+
'return(Qnil)' with exceptions if 'return(Qnil)' is being used for
|
52
|
+
signaling an error or inability to process the document.
|
53
|
+
|
54
|
+
* Pointer target signedness warnings (GCC 4.0)
|
55
|
+
|
56
|
+
* Need to add the ability to create namespace objects and modify them
|
57
|
+
accordingly.
|
58
|
+
|
59
|
+
* Need to figure out how to easily apply a namespace object to either a
|
60
|
+
document or a node.
|
61
|
+
|
62
|
+
* Add an XML::DTD class.
|
63
|
+
|
64
|
+
* Add ability to dynamically create DTD's.
|
65
|
+
|
66
|
+
* Add ability to set auto-parse on XML::Parser classes.
|
67
|
+
|
68
|
+
* Add ability to set auto-set on XML::XPath classes.
|
69
|
+
|
70
|
+
* What's the counter part to XML::Node#sibling= ? XML::Node#next ??
|
71
|
+
There's a certain degree of othogonality that I'm missing in the API
|
72
|
+
at the moment and it's picking away at my brain like a bad Dan Quale
|
73
|
+
quote.
|
74
|
+
|
75
|
+
* Add a way of inspecting an XML::Node so that it can be serialized.
|
76
|
+
|
77
|
+
* Have XML::Node#child= accept ChildNodeLists.
|
78
|
+
|
79
|
+
* Add ability to append hashes and arrays via the XML::Node#<< method.
|
80
|
+
|
81
|
+
==== Data Serialization
|
82
|
+
|
83
|
+
* Need to define DTD for basic ruby types that have been XML serialized
|
84
|
+
and deserialized.
|