libxslt-ruby19 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.project +12 -0
- data/CHANGES +81 -0
- data/Gemfile +13 -0
- data/LICENSE +21 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +164 -0
- data/Rakefile +163 -0
- data/Rakefile-jewel +0 -0
- data/VERSION +1 -0
- data/ext/libxslt/Makefile +187 -0
- data/ext/libxslt/extconf.h +6 -0
- data/ext/libxslt/extconf.rb +134 -0
- data/ext/libxslt/gem_make.out +36 -0
- data/ext/libxslt/libxslt.c +66 -0
- data/ext/libxslt/libxslt.h +31 -0
- data/ext/libxslt/libxslt.o +0 -0
- data/ext/libxslt/mkmf.log +371 -0
- data/ext/libxslt/ruby_xslt_stylesheet.c +277 -0
- data/ext/libxslt/ruby_xslt_stylesheet.h +16 -0
- data/ext/libxslt/version.h +5 -0
- data/ext/mingw/Rakefile +28 -0
- data/ext/vc/libxslt_ruby.sln +26 -0
- data/ext/vc/libxslt_ruby.vcproj +224 -0
- data/lib/libxslt/deprecated.rb +67 -0
- data/lib/libxslt-ruby19.rb +0 -0
- data/lib/libxslt.rb +13 -0
- data/lib/xslt.rb +15 -0
- data/setup.rb +1585 -0
- data/test/files/commentary.dtd +34 -0
- data/test/files/fuzface.xml +154 -0
- data/test/files/fuzface.xsl +4 -0
- data/test/files/params.xml +2 -0
- data/test/files/params.xsl +11 -0
- data/test/files/ramblings.xsl +46 -0
- data/test/helper.rb +18 -0
- data/test/test_deprecated.rb +97 -0
- data/test/test_libxslt-ruby19.rb +7 -0
- data/test/test_libxslt.rb +21 -0
- data/test/test_stylesheet.rb +108 -0
- data/test/test_suite.rb +3 -0
- metadata +167 -0
data/.document
ADDED
data/.project
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<projectDescription>
|
3
|
+
<name>libxslt-ruby19</name>
|
4
|
+
<comment></comment>
|
5
|
+
<projects>
|
6
|
+
</projects>
|
7
|
+
<buildSpec>
|
8
|
+
</buildSpec>
|
9
|
+
<natures>
|
10
|
+
<nature>com.aptana.ruby.core.rubynature</nature>
|
11
|
+
</natures>
|
12
|
+
</projectDescription>
|
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/Gemfile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
|
6
|
+
# Add dependencies to develop your gem here.
|
7
|
+
# Include everything needed to run rake, tests, features, etc.
|
8
|
+
group :development do
|
9
|
+
gem "shoulda", ">= 0"
|
10
|
+
gem "bundler", "~> 1.0.0"
|
11
|
+
gem "jeweler", "~> 1.5.2"
|
12
|
+
gem "rcov", ">= 0"
|
13
|
+
end
|
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/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Maxime Picaud
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,164 @@
|
|
1
|
+
= libxslt-ruby
|
2
|
+
|
3
|
+
== Overview
|
4
|
+
|
5
|
+
The libxslt gem provides Ruby language bindings for GNOME's Libxslt
|
6
|
+
toolkit. It is free software, released under the MIT License.
|
7
|
+
|
8
|
+
|
9
|
+
== Requirements
|
10
|
+
|
11
|
+
libxslt-ruby requires Ruby 1.8.4 or higher. It is dependent on
|
12
|
+
the following libraries to function properly:
|
13
|
+
|
14
|
+
* libm (math routines: very standard)
|
15
|
+
* libz (zlib)
|
16
|
+
* libiconv
|
17
|
+
* libxml2
|
18
|
+
* libxslt
|
19
|
+
* libxml-ruby bindings
|
20
|
+
|
21
|
+
If you are running Linux or Unix you'll need a C compiler so the extension
|
22
|
+
can be compiled when it is installed. If you are running Windows, then install the Windows specific RubyGem which
|
23
|
+
includes an already built extension.
|
24
|
+
|
25
|
+
!!!NOTE!!! The libxml-ruby and libxslt-ruby bindings must absolutely, positively,
|
26
|
+
without a doubt share the same libxml2 library. This is because libxslt modifies
|
27
|
+
XML documents created by libxml2. If there are two copies of libxml2 on your
|
28
|
+
system, then when XML documents allocated in copy #1 are manipulated by copy #2,
|
29
|
+
a segmentation fault will occur. So make sure that your system has only one copy of libxml2
|
30
|
+
installed.
|
31
|
+
|
32
|
+
|
33
|
+
== INSTALLATION
|
34
|
+
|
35
|
+
The easiest way to install libxslt-ruby is via Ruby Gems. To install:
|
36
|
+
|
37
|
+
<tt>gem install libxslt-ruby</tt>
|
38
|
+
|
39
|
+
If you are running Windows, make sure to install the Win32 RubyGem which
|
40
|
+
includes an already built binary file. The binary is built against
|
41
|
+
libxml2 version 2.6.32, iconv version 1.11 and libxslt version 1.1.24.
|
42
|
+
Binaries for libxml2 and iconv are provided in the libxml-ruby bindings,
|
43
|
+
while a binary for libxslt is provided in the libxslt-ruby bindings.
|
44
|
+
|
45
|
+
The Windows binaries are biult with MingW. The gem also includes
|
46
|
+
a Microsoft VC++ 2005 solution. If you wish to run a debug version
|
47
|
+
of libxml-ruby on Windows, then it is highly recommended
|
48
|
+
you use VC++.
|
49
|
+
|
50
|
+
|
51
|
+
== USAGE
|
52
|
+
|
53
|
+
For in-depth information about using libxslt-ruby please refer
|
54
|
+
to its online Rdoc documentation.
|
55
|
+
|
56
|
+
All libxslt classes are in the LibXSLT::XSLT module. The simplest
|
57
|
+
way to use libxslt is to require 'xslt'. This will mixin the
|
58
|
+
LibXML and LibXSLT modules into the global namespace, allowing you to
|
59
|
+
write code like this:
|
60
|
+
|
61
|
+
require 'xslt'
|
62
|
+
document = XML::Document.new
|
63
|
+
stylesheett = XSLT::Stylesheet.new(document)
|
64
|
+
|
65
|
+
If you prefer not to add the LibXSLT module to the global namepace, then
|
66
|
+
write your code like this:
|
67
|
+
|
68
|
+
require 'libxslt'
|
69
|
+
|
70
|
+
class MyClass
|
71
|
+
def some_method
|
72
|
+
document = LibXML::XML::Document.new
|
73
|
+
stylesheett = LibXSLT::XSLT::Stylesheet.new(document)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
Given an XML file like:
|
78
|
+
|
79
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
80
|
+
<?xml-stylesheet href="fuzface.xsl" type="text/xsl"?>
|
81
|
+
|
82
|
+
<commentary>
|
83
|
+
<meta>
|
84
|
+
<author>
|
85
|
+
<first_name>Sean</first_name>
|
86
|
+
<last_name>Chittenden</last_name>
|
87
|
+
<email>sean@chittenden.org</email>
|
88
|
+
</author>
|
89
|
+
<version>$Version$</version>
|
90
|
+
<date>$Date$</date>
|
91
|
+
<id>$Id$</id> <title>Fuzface...</title>
|
92
|
+
<subtitle>The Internet's a big place and here's some proof...</subtitle>
|
93
|
+
</meta>
|
94
|
+
|
95
|
+
<body>
|
96
|
+
<para>
|
97
|
+
I think it's a tragedy that I'm going to start off my new
|
98
|
+
commentary by talking about facial hair and the Internet.
|
99
|
+
Something about that just screams pathetic, but whatever: it's
|
100
|
+
humor and that's life.
|
101
|
+
</para>
|
102
|
+
</body>
|
103
|
+
</commentary>
|
104
|
+
|
105
|
+
And an XSLT file like this:
|
106
|
+
|
107
|
+
<?xml version="1.0" ?>
|
108
|
+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
109
|
+
<xsl:template match="/">
|
110
|
+
<xsl:element name="html">
|
111
|
+
<xsl:element name="head">
|
112
|
+
<xsl:element name="title">Ramblings - <xsl:value-of select="commentary/meta/title" /> - <xsl:value-of select="commentary/meta/subtitle" /></xsl:element>
|
113
|
+
</xsl:element>
|
114
|
+
|
115
|
+
<xsl:element name="body">
|
116
|
+
<xsl:element name="h1"><xsl:value-of select="commentary/meta/title" /></xsl:element>
|
117
|
+
<xsl:element name="h3"><xsl:value-of select="commentary/meta/subtitle" /></xsl:element>
|
118
|
+
By: <xsl:value-of select="commentary/meta/author/first_name" /> <xsl:value-of select="commentary/meta/author/last_name" /><xsl:element name="br" />
|
119
|
+
Date: <xsl:value-of select="commentary/meta/date" /><xsl:element name="br" />
|
120
|
+
|
121
|
+
<xsl:for-each select="./commentary/body">
|
122
|
+
<xsl:apply-templates />
|
123
|
+
</xsl:for-each>
|
124
|
+
|
125
|
+
</xsl:element>
|
126
|
+
</xsl:element>
|
127
|
+
</xsl:template>
|
128
|
+
|
129
|
+
<xsl:template match="para">
|
130
|
+
<xsl:element name="p">
|
131
|
+
<xsl:value-of select="." />
|
132
|
+
</xsl:element>
|
133
|
+
</xsl:template>
|
134
|
+
</xsl:stylesheet>
|
135
|
+
|
136
|
+
We can easily transform the XML with the following ruby code:
|
137
|
+
|
138
|
+
require 'xslt'
|
139
|
+
|
140
|
+
# Create a new XSL Transform
|
141
|
+
stylesheet_doc = XML::Document.file('files/fuzface.xsl')
|
142
|
+
stylesheet = LibXSLT::Stylesheet.new(stylesheet_doc)
|
143
|
+
|
144
|
+
# Transform a xml document
|
145
|
+
xml_doc = XML::Document.file('files/fuzface.xml')
|
146
|
+
result = stylesheet.apply(xml_doc)
|
147
|
+
|
148
|
+
You can then print, save or manipulate the returned document.
|
149
|
+
|
150
|
+
== License
|
151
|
+
|
152
|
+
See LICENSE for license information.
|
153
|
+
|
154
|
+
== DOCUMENTATION
|
155
|
+
|
156
|
+
RDoc comments are included - run 'rake doc' to generate documentation.
|
157
|
+
You can find the latest documentation at:
|
158
|
+
|
159
|
+
* http://libxsl.rubyforge.org/
|
160
|
+
|
161
|
+
== MORE INFORMATION
|
162
|
+
|
163
|
+
For more information please refer to the documentation. If you have any
|
164
|
+
questions, please send email to libxml-devel@rubyforge.org.
|
data/Rakefile
ADDED
@@ -0,0 +1,163 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'date'
|
3
|
+
require 'rake/gempackagetask'
|
4
|
+
require 'rake/rdoctask'
|
5
|
+
require 'rake/testtask'
|
6
|
+
require 'date'
|
7
|
+
require 'bundler'
|
8
|
+
|
9
|
+
# ------- Default Package ----------
|
10
|
+
FILES = FileList[
|
11
|
+
'Rakefile',
|
12
|
+
'CHANGES',
|
13
|
+
'README',
|
14
|
+
'LICENSE',
|
15
|
+
'setup.rb',
|
16
|
+
'doc/**/*',
|
17
|
+
'lib/**/*',
|
18
|
+
'ext/libxslt/*.h',
|
19
|
+
'ext/libxslt/*.c',
|
20
|
+
'ext/mingw/Rakefile',
|
21
|
+
'ext/vc/*.sln',
|
22
|
+
'ext/vc/*.vcproj',
|
23
|
+
'test/**/*'
|
24
|
+
]
|
25
|
+
|
26
|
+
# Default GEM Specification
|
27
|
+
default_spec = Gem::Specification.new do |spec|
|
28
|
+
spec.name = "libxslt-ruby"
|
29
|
+
|
30
|
+
spec.homepage = "http://libxslt.rubyforge.org/"
|
31
|
+
spec.summary = "Ruby libxslt bindings"
|
32
|
+
spec.description = <<-EOF
|
33
|
+
The Libxslt-Ruby project provides Ruby language bindings for the GNOME
|
34
|
+
XSLT C library. It is free software, released under the MIT License.
|
35
|
+
EOF
|
36
|
+
|
37
|
+
# Determine the current version of the software
|
38
|
+
spec.version =
|
39
|
+
if File.read('ext/libxslt/version.h') =~ /\s*RUBY_LIBXSLT_VERSION\s*['"](\d.+)['"]/
|
40
|
+
CURRENT_VERSION = $1
|
41
|
+
else
|
42
|
+
CURRENT_VERSION = "0.0.0"
|
43
|
+
end
|
44
|
+
|
45
|
+
spec.author = "Charlie Savage"
|
46
|
+
spec.email = "libxml-devel@rubyforge.org"
|
47
|
+
spec.add_dependency('libxml-ruby','>=0.9.4')
|
48
|
+
spec.platform = Gem::Platform::RUBY
|
49
|
+
spec.require_paths = ["lib", "ext/libxslt"]
|
50
|
+
|
51
|
+
spec.bindir = "bin"
|
52
|
+
spec.extensions = ["ext/libxslt/extconf.rb"]
|
53
|
+
spec.files = FILES.to_a
|
54
|
+
spec.test_files = Dir.glob("test/tc_*.rb")
|
55
|
+
|
56
|
+
spec.required_ruby_version = '>= 1.8.4'
|
57
|
+
spec.date = DateTime.now
|
58
|
+
spec.rubyforge_project = 'libxslt-ruby'
|
59
|
+
|
60
|
+
spec.has_rdoc = true
|
61
|
+
end
|
62
|
+
|
63
|
+
# Rake task to build the default package
|
64
|
+
Rake::GemPackageTask.new(default_spec) do |pkg|
|
65
|
+
pkg.package_dir = 'admin/pkg'
|
66
|
+
pkg.need_tar = true
|
67
|
+
end
|
68
|
+
|
69
|
+
# ------- Windows GEM ----------
|
70
|
+
if RUBY_PLATFORM.match(/win32/)
|
71
|
+
binaries = (FileList['ext/mingw/*.so',
|
72
|
+
'ext/mingw/*.dll*'])
|
73
|
+
|
74
|
+
# Windows specification
|
75
|
+
win_spec = default_spec.clone
|
76
|
+
win_spec.extensions = ['ext/mingw/Rakefile']
|
77
|
+
win_spec.platform = Gem::Platform::CURRENT
|
78
|
+
win_spec.files += binaries.to_a
|
79
|
+
|
80
|
+
# Rake task to build the windows package
|
81
|
+
Rake::GemPackageTask.new(win_spec) do |pkg|
|
82
|
+
pkg.package_dir = 'admin/pkg'
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# --------- RDoc Documentation ------
|
87
|
+
desc "Generate rdoc documentation"
|
88
|
+
Rake::RDocTask.new("rdoc") do |rdoc|
|
89
|
+
rdoc.rdoc_dir = 'doc'
|
90
|
+
rdoc.title = "libxml-xslt"
|
91
|
+
# Show source inline with line numbers
|
92
|
+
rdoc.options << "--inline-source" << "--line-numbers"
|
93
|
+
# Make the readme file the start page for the generated html
|
94
|
+
rdoc.options << '--main' << 'README'
|
95
|
+
rdoc.rdoc_files.include('doc/*.rdoc',
|
96
|
+
'ext/**/*.c',
|
97
|
+
'lib/**/*.rb',
|
98
|
+
'CHANGES',
|
99
|
+
'README',
|
100
|
+
'LICENSE')
|
101
|
+
end
|
102
|
+
|
103
|
+
|
104
|
+
Rake::TestTask.new do |t|
|
105
|
+
t.libs << "test"
|
106
|
+
t.libs << "ext"
|
107
|
+
end
|
108
|
+
|
109
|
+
begin
|
110
|
+
Bundler.setup(:default, :development)
|
111
|
+
rescue Bundler::BundlerError => e
|
112
|
+
$stderr.puts e.message
|
113
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
114
|
+
exit e.status_code
|
115
|
+
end
|
116
|
+
require 'rake'
|
117
|
+
|
118
|
+
require 'jeweler'
|
119
|
+
Jeweler::Tasks.new do |gem|
|
120
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
121
|
+
gem.name = "libxslt-ruby19"
|
122
|
+
gem.homepage = "http://github.com/chok/libxslt-ruby19"
|
123
|
+
gem.license = "MIT"
|
124
|
+
gem.summary = %Q{libxslt-ruby for ruby 1.9}
|
125
|
+
gem.description = %Q{libxslt-ruby for ruby 1.9}
|
126
|
+
gem.email = "chokorp@gmail.com"
|
127
|
+
gem.authors = ["Maxime Picaud"]
|
128
|
+
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
129
|
+
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
130
|
+
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
131
|
+
# gem.add_development_dependency 'rspec', '> 1.2.3'
|
132
|
+
end
|
133
|
+
Jeweler::RubygemsDotOrgTasks.new
|
134
|
+
|
135
|
+
require 'rake/testtask'
|
136
|
+
Rake::TestTask.new(:test) do |test|
|
137
|
+
test.libs << 'lib' << 'test'
|
138
|
+
test.pattern = 'test/**/test_*.rb'
|
139
|
+
test.verbose = true
|
140
|
+
end
|
141
|
+
|
142
|
+
require 'rcov/rcovtask'
|
143
|
+
Rcov::RcovTask.new do |test|
|
144
|
+
test.libs << 'test'
|
145
|
+
test.pattern = 'test/**/test_*.rb'
|
146
|
+
test.verbose = true
|
147
|
+
end
|
148
|
+
|
149
|
+
task :default => :test
|
150
|
+
|
151
|
+
require 'rake/rdoctask'
|
152
|
+
Rake::RDocTask.new do |rdoc|
|
153
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
154
|
+
|
155
|
+
rdoc.rdoc_dir = 'rdoc'
|
156
|
+
rdoc.title = "libxslt-ruby19 #{version}"
|
157
|
+
rdoc.rdoc_files.include('README*')
|
158
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
159
|
+
end
|
160
|
+
|
161
|
+
|
162
|
+
task :package => :rdoc
|
163
|
+
task :default => :package
|
data/Rakefile-jewel
ADDED
File without changes
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.0
|
@@ -0,0 +1,187 @@
|
|
1
|
+
|
2
|
+
SHELL = /bin/sh
|
3
|
+
|
4
|
+
#### Start of system configuration section. ####
|
5
|
+
|
6
|
+
srcdir = .
|
7
|
+
topdir = /usr/local/include/ruby-1.9.1
|
8
|
+
hdrdir = /usr/local/include/ruby-1.9.1
|
9
|
+
arch_hdrdir = /usr/local/include/ruby-1.9.1/$(arch)
|
10
|
+
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
|
11
|
+
prefix = $(DESTDIR)/usr/local
|
12
|
+
rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
|
13
|
+
exec_prefix = $(prefix)
|
14
|
+
vendorhdrdir = $(rubyhdrdir)/vendor_ruby
|
15
|
+
sitehdrdir = $(rubyhdrdir)/site_ruby
|
16
|
+
rubyhdrdir = $(includedir)/$(RUBY_BASE_NAME)-$(ruby_version)
|
17
|
+
vendordir = $(rubylibprefix)/vendor_ruby
|
18
|
+
sitedir = $(rubylibprefix)/site_ruby
|
19
|
+
ridir = $(datarootdir)/$(RI_BASE_NAME)
|
20
|
+
mandir = $(datarootdir)/man
|
21
|
+
localedir = $(datarootdir)/locale
|
22
|
+
libdir = $(exec_prefix)/lib
|
23
|
+
psdir = $(docdir)
|
24
|
+
pdfdir = $(docdir)
|
25
|
+
dvidir = $(docdir)
|
26
|
+
htmldir = $(docdir)
|
27
|
+
infodir = $(datarootdir)/info
|
28
|
+
docdir = $(datarootdir)/doc/$(PACKAGE)
|
29
|
+
oldincludedir = $(DESTDIR)/usr/include
|
30
|
+
includedir = $(prefix)/include
|
31
|
+
localstatedir = $(prefix)/var
|
32
|
+
sharedstatedir = $(prefix)/com
|
33
|
+
sysconfdir = $(prefix)/etc
|
34
|
+
datadir = $(datarootdir)
|
35
|
+
datarootdir = $(prefix)/share
|
36
|
+
libexecdir = $(exec_prefix)/libexec
|
37
|
+
sbindir = $(exec_prefix)/sbin
|
38
|
+
bindir = $(exec_prefix)/bin
|
39
|
+
rubylibdir = $(rubylibprefix)/$(ruby_version)
|
40
|
+
archdir = $(rubylibdir)/$(arch)
|
41
|
+
sitelibdir = $(sitedir)/$(ruby_version)
|
42
|
+
sitearchdir = $(sitelibdir)/$(sitearch)
|
43
|
+
vendorlibdir = $(vendordir)/$(ruby_version)
|
44
|
+
vendorarchdir = $(vendorlibdir)/$(sitearch)
|
45
|
+
|
46
|
+
CC = gcc
|
47
|
+
CXX = g++
|
48
|
+
LIBRUBY = $(LIBRUBY_A)
|
49
|
+
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
50
|
+
LIBRUBYARG_SHARED = -Wl,-R -Wl,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)
|
51
|
+
LIBRUBYARG_STATIC = -Wl,-R -Wl,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)-static
|
52
|
+
OUTFLAG = -o
|
53
|
+
COUTFLAG = -o
|
54
|
+
|
55
|
+
RUBY_EXTCONF_H = extconf.h
|
56
|
+
cflags = $(optflags) $(debugflags) $(warnflags)
|
57
|
+
optflags = -O3
|
58
|
+
debugflags = -ggdb
|
59
|
+
warnflags = -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long
|
60
|
+
CFLAGS = -fPIC $(cflags)
|
61
|
+
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir) -I/usr/local/lib/ruby/gems/1.9.1/gems/libxml-ruby-1.1.4/ext -I/usr/include/libxml2 -I/usr/include/libxslt -I/usr/include/libexslt
|
62
|
+
DEFS =
|
63
|
+
CPPFLAGS = -DRUBY_EXTCONF_H=\"$(RUBY_EXTCONF_H)\" $(DEFS) $(cppflags)
|
64
|
+
CXXFLAGS = $(CFLAGS) $(cxxflags)
|
65
|
+
ldflags = -L. -rdynamic -Wl,-export-dynamic
|
66
|
+
dldflags =
|
67
|
+
ARCH_FLAG =
|
68
|
+
DLDFLAGS = $(ldflags) $(dldflags)
|
69
|
+
LDSHARED = $(CC) -shared
|
70
|
+
LDSHAREDXX = $(CXX) -shared
|
71
|
+
AR = ar
|
72
|
+
EXEEXT =
|
73
|
+
|
74
|
+
RUBY_BASE_NAME = ruby
|
75
|
+
RUBY_INSTALL_NAME = ruby
|
76
|
+
RUBY_SO_NAME = ruby
|
77
|
+
arch = x86_64-linux
|
78
|
+
sitearch = $(arch)
|
79
|
+
ruby_version = 1.9.1
|
80
|
+
ruby = /usr/local/bin/ruby
|
81
|
+
RUBY = $(ruby)
|
82
|
+
RM = rm -f
|
83
|
+
RM_RF = $(RUBY) -run -e rm -- -rf
|
84
|
+
RMDIRS = $(RUBY) -run -e rmdir -- -p
|
85
|
+
MAKEDIRS = /bin/mkdir -p
|
86
|
+
INSTALL = /usr/bin/install -c
|
87
|
+
INSTALL_PROG = $(INSTALL) -m 0755
|
88
|
+
INSTALL_DATA = $(INSTALL) -m 644
|
89
|
+
COPY = cp
|
90
|
+
|
91
|
+
#### End of system configuration section. ####
|
92
|
+
|
93
|
+
preload =
|
94
|
+
|
95
|
+
libpath = . $(libdir) /usr/local/lib /usr/local/lib/ruby/gems/1.9.1/gems/libxml-ruby-1.1.4/lib
|
96
|
+
LIBPATH = -L. -L$(libdir) -Wl,-R$(libdir) -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/local/lib/ruby/gems/1.9.1/gems/libxml-ruby-1.1.4/lib -Wl,-R/usr/local/lib/ruby/gems/1.9.1/gems/libxml-ruby-1.1.4/lib
|
97
|
+
DEFFILE =
|
98
|
+
|
99
|
+
CLEANFILES = mkmf.log
|
100
|
+
DISTCLEANFILES =
|
101
|
+
DISTCLEANDIRS =
|
102
|
+
|
103
|
+
extout =
|
104
|
+
extout_prefix =
|
105
|
+
target_prefix =
|
106
|
+
LOCAL_LIBS =
|
107
|
+
LIBS = -lexslt -lxslt -lxml2 -lz -lm -lpthread -lrt -ldl -lcrypt -lm -lc
|
108
|
+
SRCS = libxslt.c ruby_xslt_stylesheet.c
|
109
|
+
OBJS = libxslt.o ruby_xslt_stylesheet.o
|
110
|
+
TARGET = libxslt_ruby
|
111
|
+
DLLIB = $(TARGET).so
|
112
|
+
EXTSTATIC =
|
113
|
+
STATIC_LIB =
|
114
|
+
|
115
|
+
BINDIR = $(bindir)
|
116
|
+
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
117
|
+
RUBYLIBDIR = /home/chok/.bundler/tmp/19210/gems/libxslt-ruby-0.9.7/lib$(target_prefix)
|
118
|
+
RUBYARCHDIR = /home/chok/.bundler/tmp/19210/gems/libxslt-ruby-0.9.7/lib$(target_prefix)
|
119
|
+
HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
|
120
|
+
ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
|
121
|
+
|
122
|
+
TARGET_SO = $(DLLIB)
|
123
|
+
CLEANLIBS = $(TARGET).so
|
124
|
+
CLEANOBJS = *.o *.bak
|
125
|
+
|
126
|
+
all: $(DLLIB)
|
127
|
+
static: $(STATIC_LIB)
|
128
|
+
.PHONY: all install static install-so install-rb
|
129
|
+
.PHONY: clean clean-so clean-rb
|
130
|
+
|
131
|
+
clean-rb-default::
|
132
|
+
clean-rb::
|
133
|
+
clean-so::
|
134
|
+
clean: clean-so clean-rb-default clean-rb
|
135
|
+
@-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
|
136
|
+
|
137
|
+
distclean-rb-default::
|
138
|
+
distclean-rb::
|
139
|
+
distclean-so::
|
140
|
+
distclean: clean distclean-so distclean-rb-default distclean-rb
|
141
|
+
@-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
|
142
|
+
@-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
|
143
|
+
@-$(RMDIRS) $(DISTCLEANDIRS)
|
144
|
+
|
145
|
+
realclean: distclean
|
146
|
+
install: install-so install-rb
|
147
|
+
|
148
|
+
install-so: $(RUBYARCHDIR)
|
149
|
+
install-so: $(RUBYARCHDIR)/$(DLLIB)
|
150
|
+
$(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
|
151
|
+
@-$(MAKEDIRS) $(@D)
|
152
|
+
$(INSTALL_PROG) $(DLLIB) $(@D)
|
153
|
+
install-rb: pre-install-rb install-rb-default
|
154
|
+
install-rb-default: pre-install-rb-default
|
155
|
+
pre-install-rb: Makefile
|
156
|
+
pre-install-rb-default: Makefile
|
157
|
+
$(RUBYARCHDIR):
|
158
|
+
$(MAKEDIRS) $@
|
159
|
+
|
160
|
+
site-install: site-install-so site-install-rb
|
161
|
+
site-install-so: install-so
|
162
|
+
site-install-rb: install-rb
|
163
|
+
|
164
|
+
.SUFFIXES: .c .m .cc .cxx .cpp .C .o
|
165
|
+
|
166
|
+
.cc.o:
|
167
|
+
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
168
|
+
|
169
|
+
.cxx.o:
|
170
|
+
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
171
|
+
|
172
|
+
.cpp.o:
|
173
|
+
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
174
|
+
|
175
|
+
.C.o:
|
176
|
+
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
177
|
+
|
178
|
+
.c.o:
|
179
|
+
$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
|
180
|
+
|
181
|
+
$(DLLIB): $(OBJS) Makefile
|
182
|
+
@-$(RM) $(@)
|
183
|
+
$(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
$(OBJS): $(hdrdir)/ruby.h $(hdrdir)/ruby/defines.h $(arch_hdrdir)/ruby/config.h $(RUBY_EXTCONF_H)
|