sqlite3-ruby 1.2.2-mswin32 → 1.2.3-mswin32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sqlite3-ruby might be problematic. Click here for more details.

@@ -4,6 +4,14 @@
4
4
  #include <sqlite3.h>
5
5
  #include "ruby.h"
6
6
 
7
+ #ifndef RSTRING_PTR
8
+ #define RSTRING_PTR(s) (RSTRING(s)->ptr)
9
+ #endif
10
+
11
+ #ifndef RSTRING_LEN
12
+ #define RSTRING_LEN(s) (RSTRING(s)->len)
13
+ #endif
14
+
7
15
  #define Init_API Init_sqlite3_api
8
16
 
9
17
  struct CallbackData {
@@ -1,7 +1,7 @@
1
- REM This is not guaranteed to work, ever. It's just a little helper
2
- REM script that I threw together to help me build the win32 version of
3
- REM the library. If someone with more win32-fu than I wants to make
4
- REM something more robust, please feel free! I'd love to include it.
5
- REM -- Jamis Buck
6
-
7
- cl /LD /Ie:\WinSDK\Include /Ic:\ruby\lib\ruby\1.8\i386-mswin32 /Ic:\ruby\sqlite3 /Ic:\ruby\src\ruby-1.8.4_2006-04-14 sqlite3_api_wrap.c /link /LIBPATH:c:\ruby\sqlite3 /LIBPATH:e:\WinSDK\Lib /LIBPATH:c:\ruby\lib sqlite3.lib msvcrt-ruby18.lib
1
+ REM This is not guaranteed to work, ever. It's just a little helper
2
+ REM script that I threw together to help me build the win32 version of
3
+ REM the library. If someone with more win32-fu than I wants to make
4
+ REM something more robust, please feel free! I'd love to include it.
5
+ REM -- Jamis Buck
6
+
7
+ cl /LD /Ie:\WinSDK\Include /Ic:\ruby\lib\ruby\1.8\i386-mswin32 /Ic:\ruby\sqlite3\src /Ic:\ruby\src\ruby-1.8.4_2006-04-14 sqlite3_api_wrap.c /link /LIBPATH:c:\ruby\sqlite3 /LIBPATH:e:\WinSDK\Lib /LIBPATH:c:\ruby\lib sqlite3.lib msvcrt-ruby18.lib
@@ -10,16 +10,25 @@ module SQLite3
10
10
  class ResultSet
11
11
  include Enumerable
12
12
 
13
- # A trivial module for adding a +types+ accessor to an object.
14
- module TypesContainer
13
+ # The class of which we return an object in case we want an Array as
14
+ # result. (ArrayFields is installed.)
15
+ class ArrayWithTypes < Array
15
16
  attr_accessor :types
16
17
  end
17
18
 
18
- # A trivial module for adding a +fields+ accessor to an object.
19
- module FieldsContainer
19
+ # The class of which we return an object in case we want an Array as
20
+ # result. (ArrayFields is not installed.)
21
+ class ArrayWithTypesAndFields < Array
22
+ attr_accessor :types
20
23
  attr_accessor :fields
21
24
  end
22
25
 
26
+ # The class of which we return an object in case we want a Hash as
27
+ # result.
28
+ class HashWithTypes < Hash
29
+ attr_accessor :types
30
+ end
31
+
23
32
  # Create a new ResultSet attached to the given database, using the
24
33
  # given sql text.
25
34
  def initialize( db, stmt )
@@ -112,15 +121,18 @@ module SQLite3
112
121
  end
113
122
 
114
123
  if @db.results_as_hash
115
- new_row = Hash[ *( @stmt.columns.zip( row ).flatten ) ]
124
+ new_row = HashWithTypes[ *( @stmt.columns.zip( row ).to_a.flatten ) ]
116
125
  row.each_with_index { |value,idx| new_row[idx] = value }
117
126
  row = new_row
118
127
  else
119
- row.extend FieldsContainer unless row.respond_to?(:fields)
128
+ if row.respond_to?(:fields)
129
+ row = ArrayWithTypes.new(row)
130
+ else
131
+ row = ArrayWithTypesAndFields.new(row)
132
+ end
120
133
  row.fields = @stmt.columns
121
134
  end
122
135
 
123
- row.extend TypesContainer
124
136
  row.types = @stmt.types
125
137
 
126
138
  return row
@@ -4,7 +4,7 @@ module SQLite3
4
4
 
5
5
  MAJOR = 1
6
6
  MINOR = 2
7
- TINY = 2
7
+ TINY = 3
8
8
 
9
9
  STRING = [ MAJOR, MINOR, TINY ].join( "." )
10
10
  #:beta-tag:
data/lib/sqlite3_api.dll CHANGED
Binary file
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: sqlite3-ruby
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.2.2
7
- date: 2008-05-31 00:00:00 -06:00
6
+ version: 1.2.3
7
+ date: 2008-08-26 00:00:00 -06:00
8
8
  summary: SQLite3/Ruby is a module to allow Ruby scripts to interface with a SQLite database.
9
9
  require_paths:
10
10
  - lib
@@ -37,10 +37,6 @@ files:
37
37
  - ext/sqlite3_api/MANIFEST
38
38
  - ext/sqlite3_api/sqlite3_api.i
39
39
  - ext/sqlite3_api/sqlite3_api_wrap.c
40
- - ext/sqlite3_api/sqlite3_api_wrap.dll
41
- - ext/sqlite3_api/sqlite3_api_wrap.exp
42
- - ext/sqlite3_api/sqlite3_api_wrap.lib
43
- - ext/sqlite3_api/sqlite3_api_wrap.obj
44
40
  - ext/sqlite3_api/win32
45
41
  - ext/sqlite3_api/win32/build.bat
46
42
  - lib/sqlite3
Binary file
Binary file
Binary file
Binary file