ruby-xslt 0.9.5 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
data/AUTHORS CHANGED
@@ -19,7 +19,10 @@ Pau Garcia i Quiles <pgquiles at elpauer dot org>
19
19
 
20
20
  St�phane Mariel <smariel at rift dot fr>
21
21
  * Bugfix in extfunc.c
22
-
22
+
23
+ Tom <tom@spongecell.com>
24
+ * Found and patched some serious memory leaks
25
+
23
26
  == Thanks to :
24
27
 
25
28
  knu <knu at freebsd dot org> for FreeBSD port (see http://www.freshports.org/textproc/ruby-xslt/)
data/ChangeLog CHANGED
@@ -1,3 +1,6 @@
1
+ 0.9.6 :
2
+ * "found and patched some serious memory leaks" (thanks to Tom)
3
+
1
4
  0.9.5 :
2
5
  * Bugfix in extconf.c (thanks to Stephane Mariel)
3
6
 
data/README CHANGED
@@ -6,7 +6,7 @@ Ruby/XSLT is a simple XSLT class based on libxml <http://xmlsoft.org/> and libxs
6
6
 
7
7
  == Licence
8
8
 
9
- Copyright (C) 2003, 2004, 2005, 2006, 2007 Gregoire Lejeune <gregoire dot lejeune at free dot fr>
9
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Gregoire Lejeune <gregoire dot lejeune at free dot fr>
10
10
 
11
11
  Ruby/XSLT is freely distributable according to the terms of the
12
12
  GNU General Public License (see the file 'COPYING').
@@ -14,27 +14,6 @@ GNU General Public License (see the file 'COPYING').
14
14
  This program is distributed without any warranty. See the file
15
15
  'COPYING' for details.
16
16
 
17
- == DOWNLOAD
18
-
19
- === Last version
20
- * version 0.9.5[http://gregoire.lejeune.free.fr/ruby-xslt_0.9.5.tar.gz]
21
-
22
- === Old versions
23
- * version 0.9.4[http://gregoire.lejeune.free.fr/ruby-xslt_0.9.4.tar.gz]
24
- * version 0.9.3[http://gregoire.lejeune.free.fr/ruby-xslt_0.9.3.tar.gz]
25
- * version 0.9.2[http://gregoire.lejeune.free.fr/ruby-xslt_0.9.2.tar.gz]
26
- * version 0.9.1[http://gregoire.lejeune.free.fr/ruby-xslt_0.9.1.tar.gz]
27
- * version 0.8.2[http://gregoire.lejeune.free.fr/ruby-xslt_0.8.2.tar.gz]
28
- * version 0.8.1[http://gregoire.lejeune.free.fr/ruby-xslt_0.8.1.tar.gz]
29
- * version 0.8.0[http://gregoire.lejeune.free.fr/ruby-xslt_0.8.0.tar.gz]
30
- * version 0.7.0[http://gregoire.lejeune.free.fr/ruby-xslt_0.7.0.tar.gz]
31
- * version 0.6.0[http://gregoire.lejeune.free.fr/ruby-xslt_0.6.0.tar.gz]
32
- * version 0.5.0[http://gregoire.lejeune.free.fr/ruby-xslt_0.5.0.tar.gz]
33
- * version 0.4.0[http://gregoire.lejeune.free.fr/ruby-xslt_0.4.0.tar.gz]
34
- * version 0.3.0[http://gregoire.lejeune.free.fr/ruby-xslt_0.3.0.tar.gz]
35
- * version 0.2.0[http://gregoire.lejeune.free.fr/ruby-xslt_0.2.0.tar.gz]
36
- * version 0.1.0[http://gregoire.lejeune.free.fr/ruby-xslt_0.1.0.tar.gz]
37
-
38
17
  === CVS access
39
18
  The CVS repository is available at rubyforge.org[http://rubyforge.org/projects/ruby-asp]. You can browse[http://rubyforge.org/cgi-bin/viewcvs.cgi/ruby-xslt/?cvsroot=ruby-asp] it or access it via anonymous access :
40
19
 
@@ -55,25 +55,3 @@ $CFLAGS = '-g -Wall ' + `xml2-config --cflags`.chomp + " " + `xslt-config --cfla
55
55
  create_header()
56
56
  create_makefile("xml/xslt_lib")
57
57
 
58
- File.rename( "Makefile", "Makefile.orig" )
59
- File.open( "Makefile.orig" ) do |oldmkfl|
60
- File.open( "Makefile", "w" ) do |newmkfl|
61
- oldmkfl.each_line do |line|
62
- case(line)
63
- when /^all:/
64
- newmkfl.puts(line)
65
- newmkfl.puts("")
66
- newmkfl.puts("test: all") # insert the "test" target
67
- newmkfl.puts("\t\t@cd tests && ruby test.rb && cd ..")
68
- newmkfl.puts("doc: all") # insert the "doc" target
69
- newmkfl.puts("\t\t@rdoc -S -t \"Ruby/XSLT Documentation\" README AUTHORS ChangeLog xslt_lib.c lib/xslt.rb")
70
- when /^distclean:/
71
- newmkfl.puts(line)
72
- newmkfl.puts("\t\t@-$(RM) Makefile.orig")
73
- newmkfl.puts("\t\t@-$(RM)r doc")
74
- else
75
- newmkfl.puts(line)
76
- end
77
- end
78
- end
79
- end
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (C) 2005 Gregoire Lejeune <gregoire.lejeune@free.fr>
2
+ * Copyright (C) 2005, 2006, 2007, 2008 Gregoire Lejeune <gregoire.lejeune@free.fr>
3
3
  *
4
4
  * This program is free software; you can redistribute it and/or modify
5
5
  * it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (C) 2005 Gregoire Lejeune <gregoire.lejeune@free.fr>
2
+ * Copyright (C) 2005, 2006, 2007, 2008 Gregoire Lejeune <gregoire.lejeune@free.fr>
3
3
  *
4
4
  * This program is free software; you can redistribute it and/or modify
5
5
  * it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (C) 2005 Gregoire Lejeune <gregoire.lejeune@free.fr>
2
+ * Copyright (C) 2005, 2006, 2007, 2008 Gregoire Lejeune <gregoire.lejeune@free.fr>
3
3
  *
4
4
  * This program is free software; you can redistribute it and/or modify
5
5
  * it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (C) 2005 Gregoire Lejeune <gregoire.lejeune@free.fr>
2
+ * Copyright (C) 2005, 2006, 2007, 2008 Gregoire Lejeune <gregoire.lejeune@free.fr>
3
3
  *
4
4
  * This program is free software; you can redistribute it and/or modify
5
5
  * it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (C) 2005 Gregoire Lejeune <gregoire.lejeune@free.fr>
2
+ * Copyright (C) 2005, 2006, 2007, 2008 Gregoire Lejeune <gregoire.lejeune@free.fr>
3
3
  *
4
4
  * This program is free software; you can redistribute it and/or modify
5
5
  * it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (C) 2005 Gregoire Lejeune <gregoire.lejeune@free.fr>
2
+ * Copyright (C) 2005, 2006, 2007, 2008 Gregoire Lejeune <gregoire.lejeune@free.fr>
3
3
  *
4
4
  * This program is free software; you can redistribute it and/or modify
5
5
  * it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (C) 2005 Gregoire Lejeune <gregoire.lejeune@free.fr>
2
+ * Copyright (C) 2005, 2006, 2007, 2008 Gregoire Lejeune <gregoire.lejeune@free.fr>
3
3
  *
4
4
  * This program is free software; you can redistribute it and/or modify
5
5
  * it under the terms of the GNU General Public License as published by
@@ -15,6 +15,7 @@
15
15
  * along with this program; if not, write to the Free Software
16
16
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
17
  */
18
+
18
19
  #include "rb_utils.h"
19
20
 
20
21
  char * getRubyObjectName( VALUE rb_Object ) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (C) 2005 Gregoire Lejeune <gregoire.lejeune@free.fr>
2
+ * Copyright (C) 2005, 2006, 2007, 2008 Gregoire Lejeune <gregoire.lejeune@free.fr>
3
3
  *
4
4
  * This program is free software; you can redistribute it and/or modify
5
5
  * it under the terms of the GNU General Public License as published by
data/ext/xslt_lib/xslt.h CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (C) 2005 Gregoire Lejeune <gregoire.lejeune@free.fr>
2
+ * Copyright (C) 2005, 2006, 2007, 2008 Gregoire Lejeune <gregoire.lejeune@free.fr>
3
3
  *
4
4
  * This program is free software; you can redistribute it and/or modify
5
5
  * it under the terms of the GNU General Public License as published by
@@ -53,8 +53,8 @@
53
53
  #include "parameters.h"
54
54
  #include "extfunc.h"
55
55
 
56
- #define RUBY_XSLT_VERSION "0.9.4"
57
- #define RUBY_XSLT_VERNUM 094
56
+ #define RUBY_XSLT_VERSION "0.9.6"
57
+ #define RUBY_XSLT_VERNUM 096
58
58
 
59
59
  #define RUBY_XSLT_XSLSRC_TYPE_NULL 0
60
60
  #define RUBY_XSLT_XSLSRC_TYPE_STR 1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (C) 2005 Gregoire Lejeune <gregoire.lejeune@free.fr>
2
+ * Copyright (C) 2005, 2006, 2007, 2008 Gregoire Lejeune <gregoire.lejeune@free.fr>
3
3
  *
4
4
  * This program is free software; you can redistribute it and/or modify
5
5
  * it under the terms of the GNU General Public License as published by
@@ -35,7 +35,7 @@ void ruby_xslt_free( RbTxslt *pRbTxslt ) {
35
35
  free( pRbTxslt );
36
36
  }
37
37
 
38
- /* xsltCleanupGlobals(); */
38
+ xsltCleanupGlobals();
39
39
  xmlCleanupParser();
40
40
  xmlMemoryDump();
41
41
  }
@@ -135,6 +135,10 @@ VALUE ruby_xslt_xml_obj_set( VALUE self, VALUE xml_doc_obj ) {
135
135
 
136
136
  pRbTxslt->iXmlResultType = RUBY_XSLT_XMLSRC_TYPE_NULL;
137
137
 
138
+ if( pRbTxslt->tXMLDocument != NULL ) {
139
+ xmlFreeDoc(pRbTxslt->tXMLDocument);
140
+ }
141
+
138
142
  pRbTxslt->tXMLDocument = parse_xml( STR2CSTR( pRbTxslt->xXmlData ), pRbTxslt->iXmlType );
139
143
  if( pRbTxslt->tXMLDocument == NULL ) {
140
144
  rb_raise( eXSLTParsingError, "XML parsing error" );
@@ -230,6 +234,10 @@ VALUE ruby_xslt_xsl_obj_set( VALUE self, VALUE xsl_doc_obj ) {
230
234
 
231
235
  pRbTxslt->iXmlResultType = RUBY_XSLT_XMLSRC_TYPE_NULL;
232
236
 
237
+ if( pRbTxslt->tParsedXslt != NULL ) {
238
+ xsltFreeStylesheet(pRbTxslt->tParsedXslt);
239
+ }
240
+
233
241
  pRbTxslt->tParsedXslt = parse_xsl( STR2CSTR( pRbTxslt->xXslData ), pRbTxslt->iXslType );
234
242
  if( pRbTxslt->tParsedXslt == NULL ) {
235
243
  rb_raise( eXSLTParsingError, "XSL Stylesheet parsing error" );
@@ -310,6 +318,7 @@ VALUE ruby_xslt_serve( VALUE self ) {
310
318
  } else {
311
319
  pRbTxslt->xXmlResultCache = rb_str_new2( xOut );
312
320
  pRbTxslt->iXmlResultType = RUBY_XSLT_XMLSRC_TYPE_STR;
321
+ free( xOut );
313
322
  }
314
323
  } else {
315
324
  pRbTxslt->xXmlResultCache = Qnil;
data/lib/xml/xslt.rb CHANGED
@@ -1,3 +1,21 @@
1
+ ##
2
+ # Copyright (C) 2005, 2006, 2007, 2008 Gregoire Lejeune <gregoire.lejeune@free.fr>
3
+ #
4
+ # This program is free software; you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation; either version 2 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program; if not, write to the Free Software
16
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
+ #
18
+
1
19
  require "xml/xslt_lib"
2
20
 
3
21
  module XML
data/test/test.rb CHANGED
@@ -2,34 +2,8 @@
2
2
 
3
3
  require "test/unit"
4
4
 
5
- $LOAD_PATH << '..'
6
-
7
- # this is ugly, but it's the only way I can think of
8
- # (lib/xslt.rb requires xml/xslt_lib.so, so we copy it and delete when done)
9
- require "ftools"
10
- Dir.mkdir "../xml"
11
-
12
- begin
13
- File.copy "../xslt_lib.so", "../xml"
14
- rescue
15
- begin
16
- File.copy "../xslt_lib.bundle", "../xml"
17
- rescue
18
- raise
19
- end
20
- end
21
-
22
- require "lib/xslt"
23
- begin
24
- File.delete "../xml/xslt_lib.so"
25
- rescue
26
- begin
27
- File.delete "../xml/xslt_lib.bundle"
28
- rescue
29
- raise
30
- end
31
- end
32
- Dir.rmdir "../xml"
5
+ require "rubygems"
6
+ require "xml/xslt"
33
7
 
34
8
  EXT_FUNC_XSL =<<END
35
9
  <xsl:stylesheet
metadata CHANGED
@@ -1,33 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: ruby-xslt
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.9.5
7
- date: 2007-08-28 00:00:00 +02:00
8
- summary: A Ruby class for processing XSLT
9
- require_paths:
10
- - lib
11
- email: gregoire.lejeune@free.fr
12
- homepage: http://raa.ruby-lang.org/project/ruby-xslt/
13
- rubyforge_project:
14
- description: Ruby/XSLT is a simple XSLT class based on libxml <http://xmlsoft.org/> and libxslt <http://xmlsoft.org/XSLT/>
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 0.9.6
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Gregoire Lejeune
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-04-06 00:00:00 +02:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: Ruby/XSLT is a simple XSLT class based on libxml <http://xmlsoft.org/> and libxslt <http://xmlsoft.org/XSLT/>
17
+ email: gregoire.lejeune@free.fr
18
+ executables: []
19
+
20
+ extensions:
21
+ - ext/xslt_lib/extconf.rb
22
+ extra_rdoc_files:
23
+ - README
24
+ - ChangeLog
25
+ - COPYING
26
+ - AUTHORS
31
27
  files:
32
28
  - ChangeLog
33
29
  - COPYING
@@ -42,7 +38,6 @@ files:
42
38
  - test/test.rb
43
39
  - lib/xml
44
40
  - lib/xml/xslt.rb
45
- - ext/xslt_lib/extconf.h
46
41
  - ext/xslt_lib/extfunc.h
47
42
  - ext/xslt_lib/parameters.h
48
43
  - ext/xslt_lib/parser.h
@@ -54,24 +49,35 @@ files:
54
49
  - ext/xslt_lib/rb_utils.c
55
50
  - ext/xslt_lib/xslt_lib.c
56
51
  - ext/xslt_lib/extconf.rb
57
- test_files: []
58
-
52
+ has_rdoc: true
53
+ homepage: http://raa.ruby-lang.org/project/ruby-xslt/
54
+ post_install_message:
59
55
  rdoc_options:
60
56
  - --title
61
57
  - Ruby/XSLT
62
58
  - --main
63
59
  - README
64
60
  - --line-numbers
65
- extra_rdoc_files:
66
- - README
67
- - ChangeLog
68
- - COPYING
69
- - AUTHORS
70
- executables: []
71
-
72
- extensions:
73
- - ext/xslt_lib/extconf.rb
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ version:
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: "0"
74
+ version:
74
75
  requirements: []
75
76
 
76
- dependencies: []
77
+ rubyforge_project: ruby-asp
78
+ rubygems_version: 1.1.0
79
+ signing_key:
80
+ specification_version: 2
81
+ summary: A Ruby class for processing XSLT
82
+ test_files: []
77
83
 
@@ -1,3 +0,0 @@
1
- #ifndef EXTCONF_H
2
- #define EXTCONF_H
3
- #endif