ruby-xslt 0.9.7 → 0.9.8

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,6 @@
1
+ 0.9.8 :
2
+ * Replace STR2CSTR by StringValuePtr
3
+
1
4
  0.9.7 :
2
5
  * Ruby 1.9
3
6
  * Bug correction (Issue #1)
data/Rakefile CHANGED
@@ -11,6 +11,7 @@ begin
11
11
  gem.homepage = "http://github.com/glejeune/ruby-xslt"
12
12
  gem.authors = ["Gregoire Lejeune"]
13
13
  gem.extensions = FileList["ext/**/extconf.rb"].to_a
14
+ gem.test_files = Dir.glob('test/**/*.rb')
14
15
  end
15
16
  Jeweler::GemcutterTasks.new
16
17
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.7
1
+ 0.9.8
@@ -127,7 +127,7 @@ xmlXPathObjectPtr value2xpathObj (VALUE val) {
127
127
  xmlChar *str;
128
128
 
129
129
  // we need the Strdup (this is the major bugfix for 0.8.1)
130
- str = xmlStrdup((const xmlChar *) STR2CSTR(val));
130
+ str = xmlStrdup((const xmlChar *) StringValuePtr(val));
131
131
  ret = xmlXPathWrapString(str);
132
132
  }
133
133
  break;
@@ -152,7 +152,7 @@ xmlXPathObjectPtr value2xpathObj (VALUE val) {
152
152
  if( strcmp( getRubyObjectName( val ), "REXML::Document" ) == 0 || strcmp(getRubyObjectName( val ), "REXML::Element") == 0 ) {
153
153
 
154
154
  VALUE to_s = rb_funcall( val, rb_intern( "to_s" ), 0 );
155
- xmlDocPtr doc = xmlParseDoc((xmlChar *) STR2CSTR(to_s));
155
+ xmlDocPtr doc = xmlParseDoc((xmlChar *) StringValuePtr(to_s));
156
156
 
157
157
  ret = xmlXPathNewNodeSet((xmlNode *)doc->children);
158
158
  break;
@@ -161,7 +161,7 @@ xmlXPathObjectPtr value2xpathObj (VALUE val) {
161
161
 
162
162
  xmlChar *str;
163
163
 
164
- str = xmlStrdup((const xmlChar *) STR2CSTR(to_s));
164
+ str = xmlStrdup((const xmlChar *) StringValuePtr(to_s));
165
165
  ret = xmlXPathWrapString(str);
166
166
  break;
167
167
  }
@@ -45,7 +45,7 @@ VALUE process_pair( VALUE pair, VALUE rbparams ) {
45
45
  Check_Type( key, T_STRING );
46
46
  Check_Type( value, T_STRING );
47
47
 
48
- xValue = STR2CSTR( value );
48
+ xValue = StringValuePtr( value );
49
49
  if( xValue[0] != '\'' && xValue[strlen( xValue ) - 1] != '\'' ) {
50
50
  value = rb_str_concat( value, rb_str_new2( "'" ) );
51
51
  value = rb_str_concat( rb_str_new2( "'" ), value );
@@ -113,14 +113,14 @@ VALUE object_to_string( VALUE object ) {
113
113
  switch( TYPE( object ) ) {
114
114
  case T_STRING:
115
115
  {
116
- if( isFile( STR2CSTR( object ) ) == 0 ) {
116
+ if( isFile( StringValuePtr( object ) ) == 0 ) {
117
117
  vOut = object;
118
118
  } else {
119
119
  long iBufferLength;
120
120
  long iCpt;
121
121
  char *xBuffer;
122
122
 
123
- FILE* fStream = fopen( STR2CSTR( object ), "r" );
123
+ FILE* fStream = fopen( StringValuePtr( object ), "r" );
124
124
  if( fStream == NULL ) {
125
125
  return( Qnil );
126
126
  }
@@ -178,7 +178,7 @@ int objectIsFile( VALUE object ) {
178
178
  switch( TYPE( object ) ) {
179
179
  case T_STRING:
180
180
  {
181
- if( isFile( STR2CSTR( object ) ) == 0 )
181
+ if( isFile( StringValuePtr( object ) ) == 0 )
182
182
  bOut = 0;
183
183
  else
184
184
  bOut = 1;
@@ -20,7 +20,8 @@
20
20
 
21
21
  char * getRubyObjectName( VALUE rb_Object ) {
22
22
  VALUE klass = rb_funcall( rb_Object, rb_intern( "class" ), 0 );
23
- return( STR2CSTR( rb_funcall( klass, rb_intern( "to_s" ), 0 ) ) );
23
+ VALUE tmp = rb_funcall( klass, rb_intern( "to_s" ), 0 );
24
+ return( StringValuePtr( tmp ) );
24
25
  }
25
26
 
26
27
  int isFile( const char *filename ) {
@@ -57,8 +57,8 @@
57
57
  #include "parameters.h"
58
58
  #include "extfunc.h"
59
59
 
60
- #define RUBY_XSLT_VERSION "0.9.7"
61
- #define RUBY_XSLT_VERNUM 097
60
+ #define RUBY_XSLT_VERSION "0.9.8"
61
+ #define RUBY_XSLT_VERNUM 098
62
62
 
63
63
  #define RUBY_XSLT_XSLSRC_TYPE_NULL 0
64
64
  #define RUBY_XSLT_XSLSRC_TYPE_STR 1
@@ -139,7 +139,7 @@ VALUE ruby_xslt_xml_obj_set( VALUE self, VALUE xml_doc_obj ) {
139
139
  xmlFreeDoc(pRbTxslt->tXMLDocument);
140
140
  }
141
141
 
142
- pRbTxslt->tXMLDocument = parse_xml( STR2CSTR( pRbTxslt->xXmlData ), pRbTxslt->iXmlType );
142
+ pRbTxslt->tXMLDocument = parse_xml( StringValuePtr( pRbTxslt->xXmlData ), pRbTxslt->iXmlType );
143
143
  if( pRbTxslt->tXMLDocument == NULL ) {
144
144
  rb_raise( eXSLTParsingError, "XML parsing error" );
145
145
  }
@@ -238,7 +238,7 @@ VALUE ruby_xslt_xsl_obj_set( VALUE self, VALUE xsl_doc_obj ) {
238
238
  xsltFreeStylesheet(pRbTxslt->tParsedXslt);
239
239
  }
240
240
 
241
- pRbTxslt->tParsedXslt = parse_xsl( STR2CSTR( pRbTxslt->xXslData ), pRbTxslt->iXslType );
241
+ pRbTxslt->tParsedXslt = parse_xsl( StringValuePtr( pRbTxslt->xXslData ), pRbTxslt->iXslType );
242
242
  if( pRbTxslt->tParsedXslt == NULL ) {
243
243
  rb_raise( eXSLTParsingError, "XSL Stylesheet parsing error" );
244
244
  }
@@ -305,7 +305,8 @@ VALUE ruby_xslt_serve( VALUE self ) {
305
305
  MEMZERO( pxParams, void *, pRbTxslt->iNbParams );
306
306
 
307
307
  for( iCpt = 0; iCpt <= pRbTxslt->iNbParams - 3; iCpt++ ) {
308
- pxParams[iCpt] = STR2CSTR( rb_ary_entry( pRbTxslt->pxParams, iCpt ) );
308
+ VALUE tmp = rb_ary_entry( pRbTxslt->pxParams, iCpt );
309
+ pxParams[iCpt] = StringValuePtr( tmp );
309
310
  }
310
311
  }
311
312
 
@@ -342,12 +343,12 @@ VALUE ruby_xslt_save( VALUE self, VALUE xOutFilename ) {
342
343
  rOut = ruby_xslt_serve( self );
343
344
 
344
345
  if( rOut != Qnil ) {
345
- xOut = STR2CSTR( rOut );
346
+ xOut = StringValuePtr( rOut );
346
347
 
347
- fOutFile = fopen( STR2CSTR( xOutFilename ), "w" );
348
+ fOutFile = fopen( StringValuePtr( xOutFilename ), "w" );
348
349
  if( fOutFile == NULL ) {
349
350
  free( xOut );
350
- rb_raise( rb_eRuntimeError, "Can't create file %s\n", STR2CSTR( xOutFilename ) );
351
+ rb_raise( rb_eRuntimeError, "Can't create file %s\n", StringValuePtr( xOutFilename ) );
351
352
  rOut = Qnil;
352
353
  } else {
353
354
  fwrite( xOut, 1, strlen( xOut ), fOutFile );
@@ -480,7 +481,7 @@ VALUE ruby_xslt_media_type( VALUE self ) {
480
481
  * internal use only.
481
482
  */
482
483
  VALUE ruby_xslt_reg_function( VALUE class, VALUE namespace, VALUE name ) {
483
- xsltRegisterExtModuleFunction( BAD_CAST STR2CSTR(name), BAD_CAST STR2CSTR(namespace), xmlXPathFuncCallback );
484
+ xsltRegisterExtModuleFunction( BAD_CAST StringValuePtr(name), BAD_CAST StringValuePtr(namespace), xmlXPathFuncCallback );
484
485
 
485
486
  return Qnil;
486
487
  }
@@ -496,7 +497,7 @@ VALUE ruby_xslt_to_s( VALUE self ) {
496
497
 
497
498
  Data_Get_Struct( self, RbTxslt, pRbTxslt );
498
499
 
499
- //vXSLTSheet = xsltParseStylesheetDoc( xmlParseMemory( STR2CSTR( pRbTxslt->xXslData ), strlen( STR2CSTR( pRbTxslt->xXslData ) ) ) );
500
+ //vXSLTSheet = xsltParseStylesheetDoc( xmlParseMemory( StringValuePtr( pRbTxslt->xXslData ), strlen( StringValuePtr( pRbTxslt->xXslData ) ) ) );
500
501
  vXSLTSheet = pRbTxslt->tParsedXslt;
501
502
  if (vXSLTSheet == NULL) return Qnil;
502
503
 
@@ -1,67 +1,55 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ruby-xslt}
8
- s.version = "0.9.7"
8
+ s.version = "0.9.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Gregoire Lejeune"]
12
- s.date = %q{2010-06-28}
12
+ s.date = %q{2010-11-26}
13
13
  s.description = %q{Ruby/XSLT is a simple XSLT class based on libxml <http://xmlsoft.org/> and libxslt <http://xmlsoft.org/XSLT/>}
14
14
  s.email = %q{gregoire.lejeune@free.fr}
15
15
  s.extensions = ["ext/xslt_lib/extconf.rb"]
16
16
  s.extra_rdoc_files = [
17
17
  "ChangeLog",
18
- "README.rdoc"
18
+ "README.rdoc"
19
19
  ]
20
20
  s.files = [
21
- ".gitignore",
22
- "AUTHORS",
23
- "COPYING",
24
- "ChangeLog",
25
- "README.rdoc",
26
- "Rakefile",
27
- "VERSION",
28
- "ext/xslt_lib/extconf.rb",
29
- "ext/xslt_lib/extfunc.c",
30
- "ext/xslt_lib/extfunc.h",
31
- "ext/xslt_lib/parameters.c",
32
- "ext/xslt_lib/parameters.h",
33
- "ext/xslt_lib/parser.c",
34
- "ext/xslt_lib/parser.h",
35
- "ext/xslt_lib/rb_utils.c",
36
- "ext/xslt_lib/rb_utils.h",
37
- "ext/xslt_lib/xslt.h",
38
- "ext/xslt_lib/xslt_lib.c",
39
- "lib/xml/xslt.rb",
40
- "ruby-xslt.gemspec",
41
- "setup.rb",
42
- "test/subdir/result.xsl",
43
- "test/subdir/test.xsl",
44
- "test/t.xml",
45
- "test/t.xsl",
46
- "test/test.rb"
21
+ "AUTHORS",
22
+ "COPYING",
23
+ "ChangeLog",
24
+ "README.rdoc",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "ext/xslt_lib/extconf.rb",
28
+ "ext/xslt_lib/extfunc.c",
29
+ "ext/xslt_lib/extfunc.h",
30
+ "ext/xslt_lib/parameters.c",
31
+ "ext/xslt_lib/parameters.h",
32
+ "ext/xslt_lib/parser.c",
33
+ "ext/xslt_lib/parser.h",
34
+ "ext/xslt_lib/rb_utils.c",
35
+ "ext/xslt_lib/rb_utils.h",
36
+ "ext/xslt_lib/xslt.h",
37
+ "ext/xslt_lib/xslt_lib.c",
38
+ "lib/xml/xslt.rb",
39
+ "ruby-xslt.gemspec",
40
+ "setup.rb",
41
+ "test/subdir/result.xsl",
42
+ "test/subdir/test.xsl",
43
+ "test/t.xml",
44
+ "test/t.xsl",
45
+ "test/test.rb"
47
46
  ]
48
47
  s.homepage = %q{http://github.com/glejeune/ruby-xslt}
49
- s.rdoc_options = ["--charset=UTF-8"]
50
48
  s.require_paths = ["lib"]
51
49
  s.rubygems_version = %q{1.3.7}
52
50
  s.summary = %q{Ruby/XSLT is a simple XSLT class based on libxml <http://xmlsoft.org/> and libxslt <http://xmlsoft.org/XSLT/>}
53
51
  s.test_files = [
54
- "test/test.rb",
55
- "examples/bug.rb",
56
- "examples/fuzface.rb",
57
- "examples/fuzface_data.rb",
58
- "examples/fuzface_error.rb",
59
- "examples/fuzface_REXML.rb",
60
- "examples/fuzface_to_s.rb",
61
- "examples/fuzface_XML-Simple.rb",
62
- "examples/info.rb",
63
- "examples/test_functions.rb",
64
- "examples/test_parameters.rb"
52
+ "test/test.rb"
65
53
  ]
66
54
 
67
55
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-xslt
3
3
  version: !ruby/object:Gem::Version
4
- hash: 53
4
+ hash: 43
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 7
10
- version: 0.9.7
9
+ - 8
10
+ version: 0.9.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gregoire Lejeune
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-06-28 00:00:00 +02:00
18
+ date: 2010-11-26 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -29,7 +29,6 @@ extra_rdoc_files:
29
29
  - ChangeLog
30
30
  - README.rdoc
31
31
  files:
32
- - .gitignore
33
32
  - AUTHORS
34
33
  - COPYING
35
34
  - ChangeLog
@@ -55,23 +54,13 @@ files:
55
54
  - test/t.xml
56
55
  - test/t.xsl
57
56
  - test/test.rb
58
- - examples/bug.rb
59
- - examples/fuzface.rb
60
- - examples/fuzface_data.rb
61
- - examples/fuzface_error.rb
62
- - examples/fuzface_REXML.rb
63
- - examples/fuzface_to_s.rb
64
- - examples/fuzface_XML-Simple.rb
65
- - examples/info.rb
66
- - examples/test_functions.rb
67
- - examples/test_parameters.rb
68
57
  has_rdoc: true
69
58
  homepage: http://github.com/glejeune/ruby-xslt
70
59
  licenses: []
71
60
 
72
61
  post_install_message:
73
- rdoc_options:
74
- - --charset=UTF-8
62
+ rdoc_options: []
63
+
75
64
  require_paths:
76
65
  - lib
77
66
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -101,13 +90,3 @@ specification_version: 3
101
90
  summary: Ruby/XSLT is a simple XSLT class based on libxml <http://xmlsoft.org/> and libxslt <http://xmlsoft.org/XSLT/>
102
91
  test_files:
103
92
  - test/test.rb
104
- - examples/bug.rb
105
- - examples/fuzface.rb
106
- - examples/fuzface_data.rb
107
- - examples/fuzface_error.rb
108
- - examples/fuzface_REXML.rb
109
- - examples/fuzface_to_s.rb
110
- - examples/fuzface_XML-Simple.rb
111
- - examples/info.rb
112
- - examples/test_functions.rb
113
- - examples/test_parameters.rb
data/.gitignore DELETED
@@ -1,24 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
20
-
21
- ## PROJECT::SPECIFIC
22
- ext/xslt_lib/Makefile
23
- ext/xslt_lib/mkmf.log
24
- examples