libxml-ruby 1.1.4 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. data/{CHANGES → HISTORY} +35 -0
  2. data/LICENSE +1 -0
  3. data/MANIFEST +165 -0
  4. data/{README → README.rdoc} +2 -2
  5. data/Rakefile +47 -147
  6. data/ext/libxml/libxml.c +17 -1
  7. data/ext/libxml/ruby_libxml.h +9 -1
  8. data/ext/libxml/ruby_xml_attr.c +3 -3
  9. data/ext/libxml/ruby_xml_attr_decl.c +32 -32
  10. data/ext/libxml/ruby_xml_attributes.c +1 -1
  11. data/ext/libxml/ruby_xml_cbg.c +1 -2
  12. data/ext/libxml/ruby_xml_document.c +26 -4
  13. data/ext/libxml/ruby_xml_dtd.c +3 -3
  14. data/ext/libxml/ruby_xml_encoding.c +92 -5
  15. data/ext/libxml/ruby_xml_encoding.h +4 -0
  16. data/ext/libxml/ruby_xml_namespace.c +2 -2
  17. data/ext/libxml/ruby_xml_node.c +14 -14
  18. data/ext/libxml/ruby_xml_parser_context.c +8 -8
  19. data/ext/libxml/ruby_xml_reader.c +98 -43
  20. data/ext/libxml/ruby_xml_sax2_handler.c +13 -1
  21. data/ext/libxml/ruby_xml_sax_parser.c +4 -5
  22. data/ext/libxml/ruby_xml_version.h +5 -5
  23. data/ext/libxml/ruby_xml_xpath_context.c +9 -6
  24. data/ext/libxml/ruby_xml_xpath_object.c +1 -1
  25. data/ext/vc/libxml_ruby.sln +4 -4
  26. data/lib/libxml.rb +29 -29
  27. data/lib/libxml/attr.rb +112 -110
  28. data/lib/libxml/attr_decl.rb +2 -0
  29. data/lib/libxml/attributes.rb +13 -11
  30. data/lib/libxml/document.rb +192 -190
  31. data/lib/libxml/error.rb +89 -87
  32. data/lib/libxml/hpricot.rb +77 -75
  33. data/lib/libxml/html_parser.rb +96 -94
  34. data/lib/libxml/namespace.rb +61 -59
  35. data/lib/libxml/namespaces.rb +37 -35
  36. data/lib/libxml/node.rb +398 -384
  37. data/lib/libxml/ns.rb +21 -19
  38. data/lib/libxml/parser.rb +366 -364
  39. data/lib/libxml/properties.rb +22 -20
  40. data/lib/libxml/reader.rb +2 -0
  41. data/lib/libxml/sax_callbacks.rb +179 -177
  42. data/lib/libxml/sax_parser.rb +57 -55
  43. data/lib/libxml/tree.rb +28 -26
  44. data/lib/libxml/xpath_object.rb +15 -13
  45. data/lib/xml.rb +16 -14
  46. data/lib/xml/libxml.rb +10 -8
  47. data/libxml-ruby.gemspec +50 -0
  48. data/script/benchmark/depixelate +634 -0
  49. data/script/benchmark/hamlet.xml +9055 -0
  50. data/script/benchmark/parsecount +170 -0
  51. data/script/benchmark/sock_entries.xml +507 -0
  52. data/script/benchmark/throughput +41 -0
  53. data/script/test +6 -0
  54. data/test/etc_doc_to_s.rb +21 -19
  55. data/test/ets_doc_file.rb +17 -15
  56. data/test/ets_doc_to_s.rb +23 -21
  57. data/test/ets_gpx.rb +28 -26
  58. data/test/ets_node_gc.rb +23 -21
  59. data/test/ets_tsr.rb +11 -9
  60. data/test/model/bands.iso-8859-1.xml +5 -0
  61. data/test/model/bands.utf-8.xml +5 -0
  62. data/test/rb-magic-comment.rb +33 -0
  63. data/test/tc_attr.rb +181 -170
  64. data/test/tc_attr_decl.rb +3 -1
  65. data/test/tc_attributes.rb +134 -132
  66. data/test/tc_deprecated_require.rb +13 -11
  67. data/test/tc_document.rb +119 -113
  68. data/test/tc_document_write.rb +186 -117
  69. data/test/tc_dtd.rb +125 -123
  70. data/test/tc_error.rb +3 -1
  71. data/test/tc_html_parser.rb +139 -137
  72. data/test/tc_namespace.rb +61 -58
  73. data/test/tc_namespaces.rb +176 -173
  74. data/test/tc_node.rb +257 -180
  75. data/test/tc_node_cdata.rb +51 -49
  76. data/test/tc_node_comment.rb +33 -30
  77. data/test/tc_node_copy.rb +42 -40
  78. data/test/tc_node_edit.rb +159 -157
  79. data/test/tc_node_text.rb +71 -69
  80. data/test/tc_node_write.rb +41 -16
  81. data/test/tc_node_xlink.rb +29 -26
  82. data/test/tc_parser.rb +335 -329
  83. data/test/tc_parser_context.rb +188 -185
  84. data/test/tc_properties.rb +39 -36
  85. data/test/tc_reader.rb +297 -283
  86. data/test/tc_relaxng.rb +54 -51
  87. data/test/tc_sax_parser.rb +275 -273
  88. data/test/tc_schema.rb +53 -51
  89. data/test/tc_traversal.rb +222 -220
  90. data/test/tc_xinclude.rb +21 -19
  91. data/test/tc_xml.rb +3 -1
  92. data/test/tc_xpath.rb +195 -193
  93. data/test/tc_xpath_context.rb +80 -78
  94. data/test/tc_xpath_expression.rb +38 -35
  95. data/test/tc_xpointer.rb +74 -72
  96. data/test/test_helper.rb +14 -0
  97. data/test/test_suite.rb +39 -33
  98. metadata +65 -105
  99. data/doc/css/normal.css +0 -182
  100. data/doc/img/raze-tiny.png +0 -0
  101. data/doc/img/red-cube.jpg +0 -0
  102. data/doc/img/xml-ruby.png +0 -0
  103. data/doc/index.xml +0 -43
  104. data/doc/install.xml +0 -77
  105. data/doc/layout.rhtml +0 -38
  106. data/doc/layout.xsl +0 -67
  107. data/doc/license.xml +0 -32
  108. data/doc/log/changelog.xml +0 -1324
  109. data/doc/log/changelog.xsl +0 -42
  110. data/ext/libxml/Makefile +0 -156
  111. data/ext/libxml/extconf.h +0 -5
  112. data/ext/libxml/libxml-ruby.so.a +0 -0
  113. data/ext/libxml/libxml.o +0 -0
  114. data/ext/libxml/libxml_ruby.so +0 -0
  115. data/ext/libxml/mkmf.log +0 -129
  116. data/ext/libxml/ruby_xml.o +0 -0
  117. data/ext/libxml/ruby_xml_attr.o +0 -0
  118. data/ext/libxml/ruby_xml_attr_decl.o +0 -0
  119. data/ext/libxml/ruby_xml_attributes.o +0 -0
  120. data/ext/libxml/ruby_xml_cbg.o +0 -0
  121. data/ext/libxml/ruby_xml_document.o +0 -0
  122. data/ext/libxml/ruby_xml_dtd.o +0 -0
  123. data/ext/libxml/ruby_xml_encoding.o +0 -0
  124. data/ext/libxml/ruby_xml_error.o +0 -0
  125. data/ext/libxml/ruby_xml_html_parser.o +0 -0
  126. data/ext/libxml/ruby_xml_html_parser_context.o +0 -0
  127. data/ext/libxml/ruby_xml_html_parser_options.o +0 -0
  128. data/ext/libxml/ruby_xml_input_cbg.o +0 -0
  129. data/ext/libxml/ruby_xml_io.o +0 -0
  130. data/ext/libxml/ruby_xml_namespace.o +0 -0
  131. data/ext/libxml/ruby_xml_namespaces.o +0 -0
  132. data/ext/libxml/ruby_xml_node.o +0 -0
  133. data/ext/libxml/ruby_xml_parser.o +0 -0
  134. data/ext/libxml/ruby_xml_parser_context.o +0 -0
  135. data/ext/libxml/ruby_xml_parser_options.o +0 -0
  136. data/ext/libxml/ruby_xml_reader.o +0 -0
  137. data/ext/libxml/ruby_xml_relaxng.o +0 -0
  138. data/ext/libxml/ruby_xml_sax2_handler.o +0 -0
  139. data/ext/libxml/ruby_xml_sax_parser.o +0 -0
  140. data/ext/libxml/ruby_xml_schema.o +0 -0
  141. data/ext/libxml/ruby_xml_xinclude.o +0 -0
  142. data/ext/libxml/ruby_xml_xpath.o +0 -0
  143. data/ext/libxml/ruby_xml_xpath_context.o +0 -0
  144. data/ext/libxml/ruby_xml_xpath_expression.o +0 -0
  145. data/ext/libxml/ruby_xml_xpath_object.o +0 -0
  146. data/ext/libxml/ruby_xml_xpointer.o +0 -0
@@ -1,3 +1,38 @@
1
+ = Release History
2
+
3
+ == 2.0.0 / 2011-04-16 Charlie Savage
4
+
5
+ * Ruby 1.9.2 support. The biggest addition is encoding support.
6
+ Strings returned by the libxml bindings are now set to the encoding
7
+ of the underlying xml document (Charlie Savage).
8
+
9
+ * Rubinius compatability. Removed unnecessary use of RHASH_TBL (Aman Gupta)
10
+
11
+ * Added .gemspec file (Dudley Flanders).
12
+
13
+ * Updated Windows checks to take into account mingw32 (Yaohan Chen).
14
+
15
+ * Fix memory leak in Reader#Expand (Szymon Nowak).
16
+
17
+ * Fix memory leaks in Reader#read_string, Reader#read_inner_xml
18
+ and Reader#read_outer_xml (Sean Geoghegan).
19
+
20
+ * Node#space_preserve= was backwards (Dudley Flanders)
21
+
22
+ * Fixed typo in readme, added rdoc extension (Loren Sands-Ramshaw).
23
+
24
+ * Switched to Rake Compiler (Charlie Savage).
25
+
26
+ * Use xmlMalloc() memory for ctxt->sax structure. Sometimes the ctxt->sax pointer
27
+ may not be zeroed in rxml_sax_parser_parse(), for example when exception is raised
28
+ in one of callbacks. This lets xmlFreeParserCtxt() clean this up (Alexey I. Froloff).
29
+
30
+ * Added a rake task to publish the website to github. Moved the jekyll website to
31
+ web directory (Anurag Priyam).
32
+
33
+ * Modernize project metadata and layout (7rans)
34
+
35
+
1
36
  == 1.1.3 / 2009-03-18 Charlie Savage
2
37
 
3
38
  * Improve performance 10 to 20% by turning on libxml2's dictionary
data/LICENSE CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  Copyright (c) 2008-2009 Charlie Savage and contributors
2
3
  Copyright (c) 2002-2007 Sean Chittenden and contributors
3
4
  Copyright (c) 2001 Wai-Sun "Squidster" Chia
data/MANIFEST ADDED
@@ -0,0 +1,165 @@
1
+ #!mast -x doc/libxml-ruby/rdoc -i .gitignore ext doc lib script test [A-Z]*
2
+ ext/libxml/extconf.rb
3
+ ext/libxml/libxml.c
4
+ ext/libxml/ruby_libxml.h
5
+ ext/libxml/ruby_xml.c
6
+ ext/libxml/ruby_xml.h
7
+ ext/libxml/ruby_xml_attr.c
8
+ ext/libxml/ruby_xml_attr.h
9
+ ext/libxml/ruby_xml_attr_decl.c
10
+ ext/libxml/ruby_xml_attr_decl.h
11
+ ext/libxml/ruby_xml_attributes.c
12
+ ext/libxml/ruby_xml_attributes.h
13
+ ext/libxml/ruby_xml_cbg.c
14
+ ext/libxml/ruby_xml_document.c
15
+ ext/libxml/ruby_xml_document.h
16
+ ext/libxml/ruby_xml_dtd.c
17
+ ext/libxml/ruby_xml_dtd.h
18
+ ext/libxml/ruby_xml_encoding.c
19
+ ext/libxml/ruby_xml_encoding.h
20
+ ext/libxml/ruby_xml_error.c
21
+ ext/libxml/ruby_xml_error.h
22
+ ext/libxml/ruby_xml_html_parser.c
23
+ ext/libxml/ruby_xml_html_parser.h
24
+ ext/libxml/ruby_xml_html_parser_context.c
25
+ ext/libxml/ruby_xml_html_parser_context.h
26
+ ext/libxml/ruby_xml_html_parser_options.c
27
+ ext/libxml/ruby_xml_html_parser_options.h
28
+ ext/libxml/ruby_xml_input_cbg.c
29
+ ext/libxml/ruby_xml_input_cbg.h
30
+ ext/libxml/ruby_xml_io.c
31
+ ext/libxml/ruby_xml_io.h
32
+ ext/libxml/ruby_xml_namespace.c
33
+ ext/libxml/ruby_xml_namespace.h
34
+ ext/libxml/ruby_xml_namespaces.c
35
+ ext/libxml/ruby_xml_namespaces.h
36
+ ext/libxml/ruby_xml_node.c
37
+ ext/libxml/ruby_xml_node.h
38
+ ext/libxml/ruby_xml_parser.c
39
+ ext/libxml/ruby_xml_parser.h
40
+ ext/libxml/ruby_xml_parser_context.c
41
+ ext/libxml/ruby_xml_parser_context.h
42
+ ext/libxml/ruby_xml_parser_options.c
43
+ ext/libxml/ruby_xml_parser_options.h
44
+ ext/libxml/ruby_xml_reader.c
45
+ ext/libxml/ruby_xml_reader.h
46
+ ext/libxml/ruby_xml_relaxng.c
47
+ ext/libxml/ruby_xml_relaxng.h
48
+ ext/libxml/ruby_xml_sax2_handler.c
49
+ ext/libxml/ruby_xml_sax2_handler.h
50
+ ext/libxml/ruby_xml_sax_parser.c
51
+ ext/libxml/ruby_xml_sax_parser.h
52
+ ext/libxml/ruby_xml_schema.c
53
+ ext/libxml/ruby_xml_schema.h
54
+ ext/libxml/ruby_xml_version.h
55
+ ext/libxml/ruby_xml_xinclude.c
56
+ ext/libxml/ruby_xml_xinclude.h
57
+ ext/libxml/ruby_xml_xpath.c
58
+ ext/libxml/ruby_xml_xpath.h
59
+ ext/libxml/ruby_xml_xpath_context.c
60
+ ext/libxml/ruby_xml_xpath_context.h
61
+ ext/libxml/ruby_xml_xpath_expression.c
62
+ ext/libxml/ruby_xml_xpath_expression.h
63
+ ext/libxml/ruby_xml_xpath_object.c
64
+ ext/libxml/ruby_xml_xpath_object.h
65
+ ext/libxml/ruby_xml_xpointer.c
66
+ ext/libxml/ruby_xml_xpointer.h
67
+ ext/mingw/Rakefile
68
+ ext/mingw/build.rake
69
+ ext/mingw/libiconv-2.dll
70
+ ext/mingw/libxml2-2.dll
71
+ ext/mingw/libxml_ruby.dll.a
72
+ ext/mingw/libxml_ruby.so
73
+ ext/vc/libxml_ruby.sln
74
+ ext/vc/libxml_ruby_18/libxml_ruby.vcproj
75
+ ext/vc/libxml_ruby_19/libxml_ruby_19.vcproj
76
+ doc/.htaccess
77
+ doc/.rsync-filter
78
+ lib/libxml/attr.rb
79
+ lib/libxml/attr_decl.rb
80
+ lib/libxml/attributes.rb
81
+ lib/libxml/document.rb
82
+ lib/libxml/error.rb
83
+ lib/libxml/hpricot.rb
84
+ lib/libxml/html_parser.rb
85
+ lib/libxml/namespace.rb
86
+ lib/libxml/namespaces.rb
87
+ lib/libxml/node.rb
88
+ lib/libxml/ns.rb
89
+ lib/libxml/parser.rb
90
+ lib/libxml/properties.rb
91
+ lib/libxml/reader.rb
92
+ lib/libxml/sax_callbacks.rb
93
+ lib/libxml/sax_parser.rb
94
+ lib/libxml/tree.rb
95
+ lib/libxml/xpath_object.rb
96
+ lib/libxml.rb
97
+ lib/xml/libxml.rb
98
+ lib/xml.rb
99
+ script/benchmark/depixelate
100
+ script/benchmark/hamlet.xml
101
+ script/benchmark/parsecount
102
+ script/benchmark/sock_entries.xml
103
+ script/benchmark/throughput
104
+ script/test
105
+ test/etc_doc_to_s.rb
106
+ test/ets_doc_file.rb
107
+ test/ets_doc_to_s.rb
108
+ test/ets_gpx.rb
109
+ test/ets_node_gc.rb
110
+ test/ets_test.xml
111
+ test/ets_tsr.rb
112
+ test/model/atom.xml
113
+ test/model/bands.xml
114
+ test/model/books.xml
115
+ test/model/merge_bug_data.xml
116
+ test/model/ruby-lang.html
117
+ test/model/rubynet.xml
118
+ test/model/rubynet_project
119
+ test/model/shiporder.rnc
120
+ test/model/shiporder.rng
121
+ test/model/shiporder.xml
122
+ test/model/shiporder.xsd
123
+ test/model/soap.xml
124
+ test/model/xinclude.xml
125
+ test/tc_attr.rb
126
+ test/tc_attr_decl.rb
127
+ test/tc_attributes.rb
128
+ test/tc_deprecated_require.rb
129
+ test/tc_document.rb
130
+ test/tc_document_write.rb
131
+ test/tc_dtd.rb
132
+ test/tc_error.rb
133
+ test/tc_html_parser.rb
134
+ test/tc_namespace.rb
135
+ test/tc_namespaces.rb
136
+ test/tc_node.rb
137
+ test/tc_node_cdata.rb
138
+ test/tc_node_comment.rb
139
+ test/tc_node_copy.rb
140
+ test/tc_node_edit.rb
141
+ test/tc_node_text.rb
142
+ test/tc_node_write.rb
143
+ test/tc_node_xlink.rb
144
+ test/tc_parser.rb
145
+ test/tc_parser_context.rb
146
+ test/tc_properties.rb
147
+ test/tc_reader.rb
148
+ test/tc_relaxng.rb
149
+ test/tc_sax_parser.rb
150
+ test/tc_schema.rb
151
+ test/tc_traversal.rb
152
+ test/tc_xinclude.rb
153
+ test/tc_xml.rb
154
+ test/tc_xpath.rb
155
+ test/tc_xpath_context.rb
156
+ test/tc_xpath_expression.rb
157
+ test/tc_xpointer.rb
158
+ test/test_suite.rb
159
+ Rakefile
160
+ HISTORY.rdoc
161
+ PROFILE
162
+ TODO
163
+ LICENSE
164
+ README.rdoc
165
+ VERSION
@@ -50,7 +50,7 @@ Using libxml is easy. First decide what parser you want to use:
50
50
  * To parse HTML files use LibXML::XML::HTMLParser.
51
51
  * If you are masochistic, then use the LibXML::XML::SaxParser, which provides a callback API.
52
52
 
53
- Once you have choosen a parser, choose a datasource. Libxml can parse files, strings, URIs
53
+ Once you have chosen a parser, choose a datasource. Libxml can parse files, strings, URIs
54
54
  and IO streams. For each data source you can specify an LibXML::XML::Encoding, a base uri and
55
55
  various parser options. For more information, refer the LibXML::XML::Parser.document,
56
56
  LibXML::XML::Parser.file, LibXML::XML::Parser.io or LibXML:::XML::Parser.string methods (the
@@ -158,4 +158,4 @@ or have developed new patches, please submit them to Ruby Forge at
158
158
  http://rubyforge.org/tracker/?group_id=494.
159
159
 
160
160
  == License
161
- See LICENSE for license information.
161
+ See LICENSE for license information.
data/Rakefile CHANGED
@@ -1,182 +1,82 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # Be sure to set ENV['RUBYFORGE_USERNAME'] to use publish.
4
-
5
- require 'rubygems'
6
- require 'rake/gempackagetask'
7
- require 'rake/rdoctask'
8
- require 'rake/testtask'
9
- require 'date'
10
-
11
-
12
- # ------- Default Package ----------
13
- FILES = FileList[
14
- 'Rakefile',
15
- 'CHANGES',
16
- 'LICENSE',
17
- 'README',
18
- 'setup.rb',
19
- 'doc/**/*',
20
- 'ext/libxml/*',
21
- 'ext/mingw/Rakefile',
22
- 'ext/mingw/build.rake',
23
- 'ext/vc/*.sln',
24
- 'ext/vc/*.vcproj',
25
- 'lib/**/*',
26
- 'benchmark/**/*',
27
- 'test/**/*'
28
- ]
29
-
30
- # Default GEM Specification
31
- default_spec = Gem::Specification.new do |spec|
32
- spec.name = "libxml-ruby"
33
-
34
- spec.homepage = "http://libxml.rubyforge.org/"
35
- spec.summary = "Ruby libxml bindings"
36
- spec.description = <<-EOF
37
- The Libxml-Ruby project provides Ruby language bindings for the GNOME
38
- Libxml2 XML toolkit. It is free software, released under the MIT License.
39
- Libxml-ruby's primary advantage over REXML is performance - if speed
40
- is your need, these are good libraries to consider, as demonstrated
41
- by the informal benchmark below.
42
- EOF
43
-
44
- # Determine the current version of the software
45
- spec.version =
46
- if File.read('ext/libxml/ruby_xml_version.h') =~ /\s*RUBY_LIBXML_VERSION\s*['"](\d.+)['"]/
47
- CURRENT_VERSION = $1
48
- else
49
- CURRENT_VERSION = "0.0.0"
50
- end
51
-
52
- spec.author = "Charlie Savage"
53
- spec.email = "libxml-devel@rubyforge.org"
54
- spec.platform = Gem::Platform::RUBY
55
- spec.require_paths = ["lib", "ext/libxml"]
56
- spec.bindir = "bin"
57
- spec.extensions = ["ext/libxml/extconf.rb"]
58
- spec.files = FILES.to_a
59
- spec.test_files = Dir.glob("test/tc_*.rb")
60
-
61
- spec.required_ruby_version = '>= 1.8.4'
62
- spec.date = DateTime.now
63
- spec.rubyforge_project = 'libxml'
64
-
65
- spec.has_rdoc = true
3
+ require "rubygems"
4
+ require "rake/extensiontask"
5
+ require "rake/testtask"
6
+ require "rake/rdoctask"
7
+ require "grancher/task"
8
+ require "yaml"
9
+
10
+ GEM_NAME = "libxml-ruby"
11
+ SO_NAME = "libxml_ruby"
12
+
13
+ # Read the spec file
14
+ spec = Gem::Specification.load("#{GEM_NAME}.gemspec")
15
+
16
+ # Setup compile tasks
17
+ Rake::ExtensionTask.new do |ext|
18
+ ext.gem_spec = spec
19
+ ext.name = SO_NAME
20
+ ext.ext_dir = "ext/libxml"
21
+ ext.lib_dir = "lib/#{RUBY_VERSION.sub(/\.\d$/, '')}"
22
+ ext.config_options << "--with-xml2-include=C:/MinGW/local/include/libxml2"
66
23
  end
67
24
 
68
- # Rake task to build the default package
69
- Rake::GemPackageTask.new(default_spec) do |pkg|
70
- pkg.package_dir = 'admin/pkg'
71
- pkg.need_tar = true
25
+ # Setup generic gem
26
+ Rake::GemPackageTask.new(spec) do |pkg|
27
+ pkg.package_dir = 'pkg'
28
+ pkg.need_tar = false
72
29
  end
73
30
 
74
-
75
- # ------- Windows GEM ----------
76
- if RUBY_PLATFORM.match(/win32/)
77
- binaries = (FileList['ext/mingw/*.so',
78
- 'ext/mingw/*.dll*'])
31
+ # Setup Windows Gem
32
+ if RUBY_PLATFORM.match(/win32|mingw32/)
33
+ binaries = (FileList['lib/**/*.so'])
79
34
 
80
35
  # Windows specification
81
- win_spec = default_spec.clone
82
- win_spec.extensions = ['ext/mingw/Rakefile']
36
+ win_spec = spec.clone
83
37
  win_spec.platform = Gem::Platform::CURRENT
84
38
  win_spec.files += binaries.to_a
85
39
 
86
40
  # Rake task to build the windows package
87
41
  Rake::GemPackageTask.new(win_spec) do |pkg|
88
- pkg.package_dir = 'admin/pkg'
42
+ pkg.package_dir = 'pkg'
89
43
  pkg.need_tar = false
90
44
  end
91
45
  end
92
46
 
93
- # --------- RDoc Documentation ---------
47
+ # RDoc Task
94
48
  desc "Generate rdoc documentation"
95
49
  Rake::RDocTask.new("rdoc") do |rdoc|
96
- rdoc.rdoc_dir = 'doc/rdoc'
50
+ rdoc.rdoc_dir = 'doc/libxml-ruby/rdoc'
97
51
  rdoc.title = "LibXML"
98
52
  # Show source inline with line numbers
99
53
  rdoc.options << "--line-numbers"
100
54
  # Make the readme file the start page for the generated html
101
- rdoc.options << '--main' << 'README'
55
+ rdoc.main = 'README.rdoc'
102
56
  rdoc.rdoc_files.include('doc/*.rdoc',
103
57
  'ext/**/libxml.c',
104
58
  'ext/**/ruby_xml.c',
105
59
  'ext/**/*.c',
106
60
  'lib/**/*.rb',
107
- 'CHANGES',
108
- 'README',
61
+ 'README.rdoc',
62
+ 'HISTORY',
109
63
  'LICENSE')
110
64
  end
111
65
 
66
+ # Test Task
112
67
  Rake::TestTask.new do |t|
113
68
  t.libs << "test"
114
- t.libs << "lib"
115
- t.libs << "ext/libxml"
116
- end
117
-
118
- if not RUBY_PLATFORM.match(/mswin32/i)
119
- Rake::Task[:test].prerequisites << :extensions
69
+ t.verbose = true
120
70
  end
121
71
 
122
- task :default => :package
123
- task :build => :extensions
124
- task :extension => :build
125
-
126
- ext = Config::CONFIG["DLEXT"]
127
- task :extensions => ["ext/libxml/libxml_ruby.#{ext}"]
128
-
129
- namespace :extensions do
130
- task :clean do
131
- Dir.chdir("ext/libxml") do
132
- sh "rm -f Makefile"
133
- sh "rm -f *.{o,so,bundle,log}"
134
- end
135
- end
136
- end
137
-
138
- # --------- Publish Website to Rubyforge ---------
139
- desc "publish website (uses rsync)"
140
- task :publish => [:publish_website, :publish_rdoc]
141
-
142
- task :publish_website do
143
- unixname = 'libxml'
144
- username = ENV['RUBYFORGE_USERNAME']
145
-
146
- dir = 'admin/web'
147
- url = "#{username}@rubyforge.org:/var/www/gforge-projects/#{unixname}"
148
-
149
- dir = dir.chomp('/') + '/'
150
-
151
- # Using commandline filter options didn't seem to work, so
152
- # I opted for creating an .rsync_filter file for all cases.
153
-
154
- protect = %w{usage statcvs statsvn robot.txt wiki}
155
- exclude = %w{.svn}
156
-
157
- rsync_file = File.join(dir,'.rsync-filter')
158
- unless File.file?(rsync_file)
159
- File.open(rsync_file, 'w') do |f|
160
- exclude.each{|e| f << "- #{e}\n"}
161
- protect.each{|e| f << "P #{e}\n"}
162
- end
163
- end
164
-
165
- # maybe -p ?
166
- cmd = "rsync -rLvz --delete-after --filter='dir-merge #{rsync_file}' #{dir} #{url}"
167
- sh cmd
168
- end
169
-
170
- task :publish_rdoc do
171
- unixname = 'libxml'
172
- username = ENV['RUBYFORGE_USERNAME']
173
-
174
- dir = 'doc/rdoc'
175
- url = "#{username}@rubyforge.org:/var/www/gforge-projects/#{unixname}/rdoc"
176
-
177
- dir = dir.chomp('/') + '/'
178
-
179
- # maybe -p ?
180
- cmd = "rsync -rLvz --delete-after #{dir} #{url}"
181
- sh cmd
182
- end
72
+ # Publish Website to Github
73
+ Grancher::Task.new do |g|
74
+ # push gh-pages
75
+ g.branch = 'gh-pages'
76
+ # to origin
77
+ g.push_to = 'origin'
78
+ # copy the website directory
79
+ g.directory 'web'
80
+ # and the rdoc directory
81
+ g.directory 'doc/libxml-ruby/rdoc' 'rdoc'
82
+ end