libxslt-ruby-r19mingw1 0.9.7

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.
data/CHANGES ADDED
@@ -0,0 +1,81 @@
1
+ == 0.9.1 / 2008-11-24 Charlie Savage
2
+
3
+ * Support libxml-ruby bindings 0.9.3 and above which has a changed
4
+ external api.
5
+
6
+ * Remove unused xslt transform wrapper class.
7
+
8
+ == 0.9.0 / 2008-11-18 Charlie Savage
9
+
10
+ * Add back in support for exslt.
11
+
12
+ * Support libxml-ruby bindings 0.9.0.
13
+
14
+ == 0.8.2 / 2008-07-21 Charlie Savage
15
+
16
+ * To use LibXSLT you can either require 'xslt' or require 'libxslt'.
17
+ The differences is that require 'xslt' mixes the LibXML and
18
+ LIBXSLT modules into the global namespace, thereby allowing
19
+ you to write code such as:
20
+ stylesheet = XSLT::Stylesheet.new(XML::Document.new). Note that
21
+ this is different from 0.8.0 release and may require updating your code.
22
+
23
+ * Support for libxml-ruby 0.8.2
24
+
25
+ * Improved Windows support - libxslt-ruby should now work out of the box.
26
+
27
+ == 0.8.0 / 2008-07-10 Charlie Savage
28
+
29
+ * Fix memory errors when reusing a stylehseet
30
+
31
+ * Added support for setting xsl::param values
32
+
33
+ * Updated RDocs.
34
+
35
+ * Moved to LibXSLT namespace
36
+
37
+
38
+ == 0.7.0 / 2008-07-10 Charlie Savage
39
+
40
+ * Ability to reuse the same stylesheet multiple times
41
+
42
+ * Simpler api
43
+
44
+ * Compatibility layer for pre-0.7.0 versions
45
+
46
+ * Major rewrite, resulting in significantly less code
47
+
48
+ * Updated RDocs.
49
+
50
+
51
+ == 0.6.0 / 2008-07-01 Charlie Savage
52
+
53
+ * Now packaged as a separate gem
54
+
55
+ * Windows support (both lots of memory fixes and binaries)
56
+
57
+ * New libxslt.rb ruby wrapper, so programs can simply say require 'xslt'
58
+
59
+
60
+ == 0.5.0 / 2006-02-27 Ross Bamford <rosco at roscopeco.co.uk>
61
+
62
+ * Source layout for Rubygem release
63
+
64
+ * Fixed unit tests (set_up to setup, directory handling)
65
+
66
+ * Updated extconf to remove shell-script dependency
67
+
68
+ * Fixed multiple symbol declarations for -fno-common
69
+
70
+
71
+ == 0.4.0 / 2003-12-15 Martin Povolny <martin@solnet.cz>
72
+
73
+ * libxslt.c: added call to exsltRegisterAll to enable exslt extensions
74
+
75
+ * extconf.rb: added -lexslt
76
+
77
+ == 0.3.0 / 2004-02-01 Martin Povolny <martin@solnet.cz>
78
+
79
+ * libxslt.c: added call to ruby_init_xslt_transform_context() to make it
80
+ work on ruby1.8
81
+
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ # $Id$
2
+
3
+ Copyright (c) 2002-2006 Sean Chittenden <sean@chittenden.org> and contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
+ of the Software, and to permit persons to whom the Software is furnished to do
10
+ so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README ADDED
@@ -0,0 +1,174 @@
1
+ = libxslt-ruby
2
+
3
+ == FORKED VERSION
4
+
5
+ This version has been forked to provide xslt output methods that serialize the result of a xslt transformation according to the settings choosen in the stylesheet.
6
+
7
+ See http://rubyforge.org/tracker/index.php?func=detail&aid=23352&group_id=495&atid=1969
8
+
9
+ I renamed the gem to avoid confusion into libxslt-ruby-mw while the library name remains the same. One should not install libxslt-ruby and libxslt-ruby-mw gems at the same time.
10
+
11
+ The version has also been updated to gem version 0.9.7 by hand.
12
+
13
+ == Overview
14
+
15
+ The libxslt gem provides Ruby language bindings for GNOME's Libxslt
16
+ toolkit. It is free software, released under the MIT License.
17
+
18
+
19
+ == Requirements
20
+
21
+ libxslt-ruby requires Ruby 1.8.4 or higher. It is dependent on
22
+ the following libraries to function properly:
23
+
24
+ * libm (math routines: very standard)
25
+ * libz (zlib)
26
+ * libiconv
27
+ * libxml2
28
+ * libxslt
29
+ * libxml-ruby bindings
30
+
31
+ If you are running Linux or Unix you'll need a C compiler so the extension
32
+ can be compiled when it is installed. If you are running Windows, then install the Windows specific RubyGem which
33
+ includes an already built extension.
34
+
35
+ !!!NOTE!!! The libxml-ruby and libxslt-ruby bindings must absolutely, positively,
36
+ without a doubt share the same libxml2 library. This is because libxslt modifies
37
+ XML documents created by libxml2. If there are two copies of libxml2 on your
38
+ system, then when XML documents allocated in copy #1 are manipulated by copy #2,
39
+ a segmentation fault will occur. So make sure that your system has only one copy of libxml2
40
+ installed.
41
+
42
+
43
+ == INSTALLATION
44
+
45
+ The easiest way to install libxslt-ruby is via Ruby Gems. To install:
46
+
47
+ <tt>gem install libxslt-ruby</tt>
48
+
49
+ If you are running Windows, make sure to install the Win32 RubyGem which
50
+ includes an already built binary file. The binary is built against
51
+ libxml2 version 2.6.32, iconv version 1.11 and libxslt version 1.1.24.
52
+ Binaries for libxml2 and iconv are provided in the libxml-ruby bindings,
53
+ while a binary for libxslt is provided in the libxslt-ruby bindings.
54
+
55
+ The Windows binaries are biult with MingW. The gem also includes
56
+ a Microsoft VC++ 2005 solution. If you wish to run a debug version
57
+ of libxml-ruby on Windows, then it is highly recommended
58
+ you use VC++.
59
+
60
+
61
+ == USAGE
62
+
63
+ For in-depth information about using libxslt-ruby please refer
64
+ to its online Rdoc documentation.
65
+
66
+ All libxslt classes are in the LibXSLT::XSLT module. The simplest
67
+ way to use libxslt is to require 'xslt'. This will mixin the
68
+ LibXML and LibXSLT modules into the global namespace, allowing you to
69
+ write code like this:
70
+
71
+ require 'xslt'
72
+ document = XML::Document.new
73
+ stylesheett = XSLT::Stylesheet.new(document)
74
+
75
+ If you prefer not to add the LibXSLT module to the global namepace, then
76
+ write your code like this:
77
+
78
+ require 'libxslt'
79
+
80
+ class MyClass
81
+ def some_method
82
+ document = LibXML::XML::Document.new
83
+ stylesheett = LibXSLT::XSLT::Stylesheet.new(document)
84
+ end
85
+ end
86
+
87
+ Given an XML file like:
88
+
89
+ <?xml version="1.0" encoding="UTF-8"?>
90
+ <?xml-stylesheet href="fuzface.xsl" type="text/xsl"?>
91
+
92
+ <commentary>
93
+ <meta>
94
+ <author>
95
+ <first_name>Sean</first_name>
96
+ <last_name>Chittenden</last_name>
97
+ <email>sean@chittenden.org</email>
98
+ </author>
99
+ <version>$Version$</version>
100
+ <date>$Date$</date>
101
+ <id>$Id$</id> <title>Fuzface...</title>
102
+ <subtitle>The Internet's a big place and here's some proof...</subtitle>
103
+ </meta>
104
+
105
+ <body>
106
+ <para>
107
+ I think it's a tragedy that I'm going to start off my new
108
+ commentary by talking about facial hair and the Internet.
109
+ Something about that just screams pathetic, but whatever: it's
110
+ humor and that's life.
111
+ </para>
112
+ </body>
113
+ </commentary>
114
+
115
+ And an XSLT file like this:
116
+
117
+ <?xml version="1.0" ?>
118
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
119
+ <xsl:template match="/">
120
+ <xsl:element name="html">
121
+ <xsl:element name="head">
122
+ <xsl:element name="title">Ramblings - <xsl:value-of select="commentary/meta/title" /> - <xsl:value-of select="commentary/meta/subtitle" /></xsl:element>
123
+ </xsl:element>
124
+
125
+ <xsl:element name="body">
126
+ <xsl:element name="h1"><xsl:value-of select="commentary/meta/title" /></xsl:element>
127
+ <xsl:element name="h3"><xsl:value-of select="commentary/meta/subtitle" /></xsl:element>
128
+ By: <xsl:value-of select="commentary/meta/author/first_name" /> <xsl:value-of select="commentary/meta/author/last_name" /><xsl:element name="br" />
129
+ Date: <xsl:value-of select="commentary/meta/date" /><xsl:element name="br" />
130
+
131
+ <xsl:for-each select="./commentary/body">
132
+ <xsl:apply-templates />
133
+ </xsl:for-each>
134
+
135
+ </xsl:element>
136
+ </xsl:element>
137
+ </xsl:template>
138
+
139
+ <xsl:template match="para">
140
+ <xsl:element name="p">
141
+ <xsl:value-of select="." />
142
+ </xsl:element>
143
+ </xsl:template>
144
+ </xsl:stylesheet>
145
+
146
+ We can easily transform the XML with the following ruby code:
147
+
148
+ require 'xslt'
149
+
150
+ # Create a new XSL Transform
151
+ stylesheet_doc = XML::Document.file('files/fuzface.xsl')
152
+ stylesheet = LibXSLT::Stylesheet.new(stylesheet_doc)
153
+
154
+ # Transform a xml document
155
+ xml_doc = XML::Document.file('files/fuzface.xml')
156
+ result = stylesheet.apply(xml_doc)
157
+
158
+ You can then print, save or manipulate the returned document.
159
+
160
+ == License
161
+
162
+ See LICENSE for license information.
163
+
164
+ == DOCUMENTATION
165
+
166
+ RDoc comments are included - run 'rake doc' to generate documentation.
167
+ You can find the latest documentation at:
168
+
169
+ * http://libxsl.rubyforge.org/
170
+
171
+ == MORE INFORMATION
172
+
173
+ For more information please refer to the documentation. If you have any
174
+ questions, please send email to libxml-devel@rubyforge.org.
data/Rakefile ADDED
@@ -0,0 +1,55 @@
1
+ require 'rubygems'
2
+ require 'rake/gempackagetask'
3
+ require 'rake/rdoctask'
4
+ require 'rake/testtask'
5
+
6
+ load './libxslt-ruby.gemspec'
7
+
8
+ # Rake task to build the default package
9
+ Rake::GemPackageTask.new(DEFAULT_SPEC) do |pkg|
10
+ pkg.package_dir = 'admin/pkg'
11
+ pkg.need_tar = true
12
+ end
13
+
14
+ # ------- Windows GEM ----------
15
+ if RUBY_PLATFORM.match(/win32|mingw32/)
16
+ binaries = (FileList['ext/mingw/*.so',
17
+ 'ext/mingw/*.dll*'])
18
+
19
+ # Windows specification
20
+ win_spec = DEFAULT_SPEC.clone
21
+ win_spec.extensions = ['ext/mingw/Rakefile']
22
+ win_spec.platform = Gem::Platform::CURRENT
23
+ win_spec.files += binaries.to_a
24
+
25
+ # Rake task to build the windows package
26
+ Rake::GemPackageTask.new(win_spec) do |pkg|
27
+ pkg.package_dir = 'admin/pkg'
28
+ end
29
+ end
30
+
31
+ # --------- RDoc Documentation ------
32
+ desc "Generate rdoc documentation"
33
+ Rake::RDocTask.new("rdoc") do |rdoc|
34
+ rdoc.rdoc_dir = 'doc'
35
+ rdoc.title = "libxml-xslt"
36
+ # Show source inline with line numbers
37
+ rdoc.options << "--inline-source" << "--line-numbers"
38
+ # Make the readme file the start page for the generated html
39
+ rdoc.options << '--main' << 'README'
40
+ rdoc.rdoc_files.include('doc/*.rdoc',
41
+ 'ext/**/*.c',
42
+ 'lib/**/*.rb',
43
+ 'CHANGES',
44
+ 'README',
45
+ 'LICENSE')
46
+ end
47
+
48
+
49
+ Rake::TestTask.new do |t|
50
+ t.libs << "test"
51
+ t.libs << "ext"
52
+ end
53
+
54
+ task :package => :rdoc
55
+ task :default => :package
@@ -0,0 +1,137 @@
1
+ #!/usr/local/bin/ruby -w
2
+
3
+ # $Id: extconf.rb 43 2007-12-07 12:38:59Z transami $
4
+ #
5
+ # See the LICENSE file for copyright and distribution information
6
+
7
+ require 'mkmf'
8
+
9
+ $preload = nil
10
+ $LIBPATH.push(Config::CONFIG['libdir'])
11
+
12
+ def crash(str)
13
+ print(" extconf failure: %s\n", str)
14
+ exit 1
15
+ end
16
+
17
+ require 'rubygems'
18
+ gem_specs = Gem::SourceIndex.from_installed_gems.search('libxml-ruby')
19
+ if gem_specs.empty?
20
+ crash(<<EOL)
21
+ libxml-ruby bindings must be installed
22
+ EOL
23
+ end
24
+
25
+ # Sort by version, newest first
26
+ gem_specs = gem_specs.sort_by {|spec| spec.version}.reverse
27
+
28
+ libxml_ruby_path = gem_specs.first.full_gem_path
29
+
30
+ $INCFLAGS += " -I#{libxml_ruby_path}/ext"
31
+ $LIBPATH.push("#{libxml_ruby_path}/lib")
32
+
33
+ # Directories
34
+ dir_config('xml2')
35
+ dir_config('xslt')
36
+ dir_config('exslt')
37
+ dir_config('libxml-ruby')
38
+
39
+ unless have_library('m', 'atan')
40
+ # try again for gcc 4.0
41
+ saveflags = $CFLAGS
42
+ $CFLAGS += ' -fno-builtin'
43
+ unless have_library('m', 'atan')
44
+ crash('need libm')
45
+ end
46
+ $CFLAGS = saveflags
47
+ end
48
+
49
+ unless have_library("z", "inflate") or
50
+ have_library("zlib", "inflate") or
51
+ have_library("zlib1", "inflate")
52
+ crash("need zlib")
53
+ else
54
+ $defs.push('-DHAVE_ZLIB_H')
55
+ end
56
+
57
+ unless (have_library('xml2', 'xmlXPtrNewRange') or
58
+ find_library('xml2', 'xmlXPtrNewRange', '/opt/lib', '/usr/local/lib', '/usr/lib')) and
59
+ (have_header('libxml/xmlversion.h') or
60
+ find_header('libxml/xmlversion.h',
61
+ '/opt/include/libxml2',
62
+ '/usr/local/include/libxml2',
63
+ '/usr/include/libxml2'))
64
+ crash(<<EOL)
65
+ need libxml2.
66
+
67
+ Install the library or try one of the following options to extconf.rb:
68
+
69
+ --with-xml2-dir=/path/to/libxml2
70
+ --with-xml2-lib=/path/to/libxml2/lib
71
+ --with-xml2-include=/path/to/libxml2/include
72
+ EOL
73
+ end
74
+
75
+ unless (have_library('xslt','xsltApplyStylesheet') or
76
+ find_library('xslt', 'xsltApplyStylesheet', '/opt/lib', '/usr/local/lib', '/usr/lib')) and
77
+ (have_header('xslt.h') or
78
+ have_header('libxslt/xslt.h') or
79
+ find_header('xslt.h',
80
+ '/opt/include/libxslt',
81
+ '/usr/local/include/libxslt',
82
+ '/usr/include/libxslt'))
83
+ crash(<<EOL)
84
+ need libxslt.
85
+
86
+ Install the library or try one of the following options to extconf.rb:
87
+
88
+ --with-xslt-dir=/path/to/libxslt
89
+ --with-xslt-lib=/path/to/libxslt/lib
90
+ --with-xslt-include=/path/to/libxslt/include
91
+ EOL
92
+ end
93
+
94
+ unless (have_library('exslt','exsltLibexsltVersion') or
95
+ find_library('exslt', 'exsltLibexsltVersion', '/opt/lib', '/usr/local/lib', '/usr/lib')) and
96
+ (have_header('exslt.h') or
97
+ have_header('libexslt/exslt.h') or
98
+ find_header('exslt.h',
99
+ '/opt/include/libexslt',
100
+ '/usr/local/include/libexslt',
101
+ '/usr/include/libexslt'))
102
+ crash(<<EOL)
103
+ need libexslt.
104
+
105
+ Install the library or try one of the following options to extconf.rb:
106
+
107
+ --with-exslt-dir=/path/to/libexslt
108
+ --with-exslt-lib=/path/to/libexslt/lib
109
+ --with-exslt-include=/path/to/libexslt/include
110
+ EOL
111
+ end
112
+
113
+ unless have_header('libxml/ruby_libxml.h') and
114
+ have_header('libxml/ruby_xml_document.h')
115
+ crash(<<EOL)
116
+ need headers for libxml-ruby.
117
+
118
+ If you downloaded a release, this is a bug - please inform
119
+ libxml-devel@rubyforge.org including the release version and
120
+ download URL you obtained it from.
121
+
122
+ If you checked libxslt-ruby out from CVS, you will need to
123
+ obtain the headers from CVS (using the same version tag if
124
+ applicable) and place them in directory 'ext/xml/libxml-ruby'.
125
+ EOL
126
+ end
127
+
128
+ unless (have_library('xml_ruby', 'rxml_document_wrap') or
129
+ have_library(':libxml_ruby.so', 'rxml_document_wrap'))
130
+ crash(<<EOL)
131
+ need libxml-ruby
132
+ Install libxml-ruby first.
133
+ EOL
134
+ end
135
+
136
+ create_header()
137
+ create_makefile("libxslt_ruby")