qoobaa-sqlite3-ruby 1.2.5 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.5
1
+ 1.2.6
@@ -130,12 +130,19 @@
130
130
  #include "ruby/encoding.h"
131
131
  #define STR_NEW(p,n) rb_enc_str_new((p),(n),rb_utf8_encoding())
132
132
  #define STR_NEW2(p) rb_enc_str_new((p),strlen(p),rb_utf8_encoding())
133
+ // TODO: using ASCII-8BIT for UTF-16 encoding. There's no function
134
+ // like rb_utf16_encoding(), we need also to determine which UTF-16
135
+ // we want to use (LE, BE)
136
+ #define STR_NEW_UTF_16(p,n) rb_str_new((p),(n))
137
+ #define STR_NEW_ASCII_8BIT(p,n) rb_str_new((p),(n))
133
138
 
134
139
  #else
135
140
 
136
141
  // For Ruby 1.8
137
142
  #define STR_NEW(p,n) rb_str_new((p),(n))
138
143
  #define STR_NEW2(p) rb_str_new2((p))
144
+ #define STR_NEW_UTF_16(p,n) rb_str_new((p),(n))
145
+ #define STR_NEW_ASCII_8BIT(p,n) rb_str_new((p),(n))
139
146
 
140
147
  #endif
141
148
 
@@ -1702,7 +1709,7 @@ _wrap_sqlite3_prepare16(int argc, VALUE *argv, VALUE self) {
1702
1709
  ary = rb_ary_new2(3);
1703
1710
  rb_ary_push( ary, vresult );
1704
1711
  rb_ary_push( ary, SWIG_NewPointerObj( stmt2, SWIGTYPE_p_sqlite3_stmt, 0 ) );
1705
- rb_ary_push( ary, errmsg2 ? STR_NEW( (char*)errmsg2, i ) : Qnil );
1712
+ rb_ary_push( ary, errmsg2 ? STR_NEW_UTF_16( (char*)errmsg2, i ) : Qnil );
1706
1713
  vresult = ary;
1707
1714
  }
1708
1715
  return vresult;
@@ -1974,7 +1981,7 @@ _wrap_sqlite3_column_name16(int argc, VALUE *argv, VALUE self) {
1974
1981
  int i;
1975
1982
  if( result ) {
1976
1983
  for( i = 0; ((char*)result)[i]; i += 2 );
1977
- vresult = STR_NEW( (char*)result, i );
1984
+ vresult = STR_NEW_UTF_16( (char*)result, i );
1978
1985
  } else vresult = Qnil;
1979
1986
  }
1980
1987
  return vresult;
@@ -2018,7 +2025,7 @@ _wrap_sqlite3_column_decltype16(int argc, VALUE *argv, VALUE self) {
2018
2025
  int i;
2019
2026
  if( result ) {
2020
2027
  for( i = 0; ((char*)result)[i]; i += 2 );
2021
- vresult = STR_NEW( (char*)result, i );
2028
+ vresult = STR_NEW_UTF_16( (char*)result, i );
2022
2029
  } else vresult = Qnil;
2023
2030
  }
2024
2031
  return vresult;
@@ -2207,7 +2214,7 @@ _wrap_sqlite3_column_text16(int argc, VALUE *argv, VALUE self) {
2207
2214
  int i;
2208
2215
  if( result ) {
2209
2216
  for( i = 0; ((char*)result)[i]; i += 2 );
2210
- vresult = STR_NEW( (char*)result, i );
2217
+ vresult = STR_NEW_UTF_16( (char*)result, i );
2211
2218
  } else vresult = Qnil;
2212
2219
  }
2213
2220
  return vresult;
@@ -2354,7 +2361,7 @@ _wrap_sqlite3_value_blob(int argc, VALUE *argv, VALUE self) {
2354
2361
  result = (RUBY_VALBLOB *)sqlite3_value_blob(arg1);
2355
2362
 
2356
2363
  {
2357
- vresult = result ? STR_NEW( (char*)result, sqlite3_value_bytes( arg1 ) ) : Qnil;
2364
+ vresult = result ? STR_NEW_ASCII_8BIT( (char*)result, sqlite3_value_bytes( arg1 ) ) : Qnil;
2358
2365
  }
2359
2366
  return vresult;
2360
2367
  }
@@ -0,0 +1,80 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{sqlite3-ruby}
5
+ s.version = "1.2.6"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Jakub Kuźma"]
9
+ s.date = %q{2009-05-13}
10
+ s.email = %q{qoobaa@gmail.com}
11
+ s.extensions = ["ext/sqlite3_api/extconf.rb"]
12
+ s.extra_rdoc_files = [
13
+ "LICENSE",
14
+ "README.rdoc"
15
+ ]
16
+ s.files = [
17
+ ".document",
18
+ ".gitignore",
19
+ "CHANGELOG.rdoc",
20
+ "LICENSE",
21
+ "README.rdoc",
22
+ "Rakefile",
23
+ "VERSION",
24
+ "doc/faq/faq.rb",
25
+ "doc/faq/faq.yml",
26
+ "ext/sqlite3_api/.gitignore",
27
+ "ext/sqlite3_api/MANIFEST",
28
+ "ext/sqlite3_api/extconf.rb",
29
+ "ext/sqlite3_api/sqlite3_api.i",
30
+ "ext/sqlite3_api/sqlite3_api_wrap.c",
31
+ "ext/sqlite3_api/win32/build.bat",
32
+ "lib/sqlite3.rb",
33
+ "lib/sqlite3/constants.rb",
34
+ "lib/sqlite3/database.rb",
35
+ "lib/sqlite3/driver/dl/api.rb",
36
+ "lib/sqlite3/driver/dl/driver.rb",
37
+ "lib/sqlite3/driver/native/driver.rb",
38
+ "lib/sqlite3/errors.rb",
39
+ "lib/sqlite3/pragmas.rb",
40
+ "lib/sqlite3/resultset.rb",
41
+ "lib/sqlite3/statement.rb",
42
+ "lib/sqlite3/translator.rb",
43
+ "lib/sqlite3/value.rb",
44
+ "lib/sqlite3/version.rb",
45
+ "sqlite3-ruby.gemspec",
46
+ "test/bm.rb",
47
+ "test/driver/dl/tc_driver.rb",
48
+ "test/mocks.rb",
49
+ "test/native-vs-dl.rb",
50
+ "test/tc_database.rb",
51
+ "test/tc_errors.rb",
52
+ "test/tc_integration.rb",
53
+ "test/tests.rb"
54
+ ]
55
+ s.homepage = %q{http://github.com/qoobaa/sqlite3-ruby}
56
+ s.rdoc_options = ["--charset=UTF-8"]
57
+ s.require_paths = ["lib"]
58
+ s.rubygems_version = %q{1.3.3}
59
+ s.summary = %q{A Ruby interface for the SQLite database engine.}
60
+ s.test_files = [
61
+ "test/driver/dl/tc_driver.rb",
62
+ "test/tests.rb",
63
+ "test/mocks.rb",
64
+ "test/tc_errors.rb",
65
+ "test/tc_integration.rb",
66
+ "test/native-vs-dl.rb",
67
+ "test/tc_database.rb",
68
+ "test/bm.rb"
69
+ ]
70
+
71
+ if s.respond_to? :specification_version then
72
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
73
+ s.specification_version = 3
74
+
75
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
76
+ else
77
+ end
78
+ else
79
+ end
80
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qoobaa-sqlite3-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Jakub Ku\xC5\xBAma"
@@ -51,6 +51,7 @@ files:
51
51
  - lib/sqlite3/translator.rb
52
52
  - lib/sqlite3/value.rb
53
53
  - lib/sqlite3/version.rb
54
+ - sqlite3-ruby.gemspec
54
55
  - test/bm.rb
55
56
  - test/driver/dl/tc_driver.rb
56
57
  - test/mocks.rb