do_sqlite3 0.9.6-x86-mswin32-60 → 0.9.9-x86-mswin32-60
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/History.txt +7 -0
- data/Manifest.txt +1 -2
- data/Rakefile +114 -2
- data/ext/do_sqlite3_ext.c +26 -7
- data/ext/extconf.rb +6 -0
- data/lib/do_sqlite3/version.rb +1 -1
- data/lib/do_sqlite3_ext.so +0 -0
- metadata +11 -8
- data/ext/do_sqlite3_ext.so +0 -0
- data/lib/sqlite3.dll +0 -0
data/.gitignore
ADDED
data/History.txt
CHANGED
@@ -1 +1,8 @@
|
|
1
|
+
== 0.9.9 2008-11-27
|
2
|
+
* Improvements
|
3
|
+
* Added cross compile rake tasks for Windows gems [Jonathan Stott, Luis Lavena]
|
4
|
+
* Added initial support for Ruby 1.9 [John Harrison]
|
1
5
|
|
6
|
+
* Bug Fixes
|
7
|
+
* Removed sqlite3.dll from source gem [Dan Kubb]
|
8
|
+
* Removed hard coded .bundle from source [Dirkjan Bussink]
|
data/Manifest.txt
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
.gitignore
|
1
2
|
History.txt
|
2
3
|
LICENSE
|
3
4
|
Manifest.txt
|
@@ -5,12 +6,10 @@ README.txt
|
|
5
6
|
Rakefile
|
6
7
|
TODO
|
7
8
|
ext/do_sqlite3_ext.c
|
8
|
-
ext/do_sqlite3_ext.so
|
9
9
|
ext/extconf.rb
|
10
10
|
lib/do_sqlite3.rb
|
11
11
|
lib/do_sqlite3/transaction.rb
|
12
12
|
lib/do_sqlite3/version.rb
|
13
|
-
lib/sqlite3.dll
|
14
13
|
spec/integration/do_sqlite3_spec.rb
|
15
14
|
spec/integration/logging_spec.rb
|
16
15
|
spec/integration/quoting_spec.rb
|
data/Rakefile
CHANGED
@@ -18,10 +18,10 @@ GEM_NAME = "do_sqlite3"
|
|
18
18
|
GEM_VERSION = DataObjects::Sqlite3::VERSION
|
19
19
|
GEM_DEPENDENCIES = [["data_objects", GEM_VERSION]]
|
20
20
|
|
21
|
+
# TODO: remove duplicates from here that are already listed in .gitignore
|
21
22
|
clean = %w(o bundle log a gem dSYM obj pdb lib def exp DS_Store)
|
22
23
|
|
23
24
|
unless ENV["WINDOWS"]
|
24
|
-
clean << "so"
|
25
25
|
GEM_EXTRAS = { :extensions => %w[ ext/extconf.rb ], :has_rdoc => false }
|
26
26
|
else
|
27
27
|
GEM_EXTRAS = {}
|
@@ -35,7 +35,15 @@ PROJECT_DESCRIPTION = PROJECT_SUMMARY = "A DataObject.rb driver for Sqlite3"
|
|
35
35
|
|
36
36
|
DRIVER = true
|
37
37
|
|
38
|
-
|
38
|
+
if (tasks_dir = ROOT.parent + 'tasks').directory?
|
39
|
+
require tasks_dir + 'hoe'
|
40
|
+
|
41
|
+
# use .gitignore to identify files to clean up
|
42
|
+
File.read(ROOT.parent + '.gitignore').split(/\s+/).each do |pattern|
|
43
|
+
next if pattern.include?('/') && !pattern.gsub!(/\A(?:\.\/)?#{ROOT.basename}(?:\/|\z)/, './')
|
44
|
+
GEM_CLEAN.concat(Dir.glob(pattern.include?('/') ? pattern : "**/#{pattern}"))
|
45
|
+
end
|
46
|
+
end
|
39
47
|
|
40
48
|
# Installation
|
41
49
|
|
@@ -90,3 +98,107 @@ namespace :ci do
|
|
90
98
|
end
|
91
99
|
|
92
100
|
task :ci => ["ci:spec"]
|
101
|
+
|
102
|
+
|
103
|
+
# Windows specific stuff. (for cross-compiling a release)
|
104
|
+
# You have been warned.
|
105
|
+
# Thanks to Luis Lavena for helping through the writing of this.
|
106
|
+
# will eventually be replaced with: http://github.com/luislavena/rake-compiler
|
107
|
+
|
108
|
+
# use the do directory for the cross-compile stuff
|
109
|
+
CCROOT = ROOT.parent
|
110
|
+
|
111
|
+
SQLITE_VERSION = '3_6_6_2'
|
112
|
+
|
113
|
+
MINGW_PATH = ENV['MINGW_PATH'] || "/usr/i586-mingw32msvc"
|
114
|
+
|
115
|
+
if (tasks_dir = ROOT.parent + 'tasks').directory?
|
116
|
+
require tasks_dir + 'win32'
|
117
|
+
|
118
|
+
SQLITE_DIR = "#{CROSS}/sqlite-#{SQLITE_VERSION}"
|
119
|
+
|
120
|
+
namespace :build do
|
121
|
+
|
122
|
+
task :externals => "win32:sqlite3"
|
123
|
+
|
124
|
+
namespace :win32 do
|
125
|
+
|
126
|
+
desc "Creates cross compiled sqlite3 libraries"
|
127
|
+
task :sqlite3 => ["#{SQLITE_DIR}/include/sqlite3.h", "#{SQLITE_DIR}/lib/libsqlite3.a"]
|
128
|
+
|
129
|
+
directory SQLITE_DIR
|
130
|
+
directory "#{SQLITE_DIR}/include"
|
131
|
+
directory "#{SQLITE_DIR}/lib"
|
132
|
+
|
133
|
+
file "#{SQLITE_DIR}/include/sqlite3.h" => ["#{SQLITE_DIR}/include", "#{STASH}/sqlite-amalgamation-#{SQLITE_VERSION}.zip"] do |t|
|
134
|
+
when_writing "creating sqlite3.h" do
|
135
|
+
cd(t.prerequisites[0]) do
|
136
|
+
sh "unzip #{t.prerequisites[1]}"
|
137
|
+
touch t.name
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
file "#{SQLITE_DIR}/lib/libsqlite3.a" => ["#{SQLITE_DIR}/lib", "#{SQLITE_DIR}/sqlite3.dll"] do |t|
|
143
|
+
when_writing "creating libsqlite3.a" do
|
144
|
+
sh "#{MINGW_PATH}/bin/dlltool --dllname #{SQLITE_DIR}/sqlite3.dll --def #{SQLITE_DIR}/sqlite3.def --output-lib #{t.name}"
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
file "#{SQLITE_DIR}/sqlite3.dll" => [SQLITE_DIR, "#{STASH}/sqlitedll-#{SQLITE_VERSION}.zip"] do |t|
|
149
|
+
when_writing "creating sqlite3.dll" do
|
150
|
+
cd(SQLITE_DIR) do
|
151
|
+
sh "unzip #{t.prerequisites[1]}"
|
152
|
+
touch t.name
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
# download files
|
158
|
+
file "#{STASH}/sqlite-amalgamation-#{SQLITE_VERSION}.zip" => STASH do |t|
|
159
|
+
download_file(STASH, "http://www.sqlite.org/#{File.basename(t.name)}")
|
160
|
+
end
|
161
|
+
|
162
|
+
file "#{STASH}/sqlitedll-#{SQLITE_VERSION}.zip" => STASH do |t|
|
163
|
+
download_file(STASH, "http://www.sqlite.org/#{File.basename(t.name)}")
|
164
|
+
end
|
165
|
+
|
166
|
+
# The extension. This is a task so it's rebuilt each time it is run, so we're sure to have a windows
|
167
|
+
# compiled extension.
|
168
|
+
task "lib/do_sqlite3_ext.so" => [:clean, "build:externals"] + FileList["ext/extconf.rb", "ext/*.c", "ext/*.h"] do
|
169
|
+
when_writing "Creating compiled extension" do
|
170
|
+
cd('ext') do
|
171
|
+
ruby " -I #{CROSS}/lib/ruby/1.8/i386-mingw32/ extconf.rb -- --with-sqlite3-dir=#{SQLITE_DIR}"
|
172
|
+
sh 'make'
|
173
|
+
end
|
174
|
+
mv 'ext/do_sqlite3_ext.so', 'lib'
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
task :extension => "lib/do_sqlite3_ext.so"
|
179
|
+
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
namespace :gem do
|
184
|
+
namespace :win32 do
|
185
|
+
desc "Package pre-compiled win32 gem"
|
186
|
+
task :package => "pkg/#{GEM_NAME}-#{GEM_VERSION}-x86-mswin32-60.gem"
|
187
|
+
|
188
|
+
file "pkg/#{GEM_NAME}-#{GEM_VERSION}-x86-mswin32-60.gem" => ["build:win32:extension", "pkg"] + HOE.spec.files do |t|
|
189
|
+
spec = HOE.spec.dup
|
190
|
+
spec.extensions = nil
|
191
|
+
spec.files += Dir['lib/**.so']
|
192
|
+
spec.platform = 'x86-mswin32-60'
|
193
|
+
spec.post_install_message = <<-eos
|
194
|
+
Now download http://www.sqlite.org/sqlitedll-#{SQLITE_VERSION}.zip
|
195
|
+
And place the dll somewhere in your PATH, for example C:\\ruby\\bin
|
196
|
+
eos
|
197
|
+
when_writing "Building win32 do_sqlite3 gem" do
|
198
|
+
Gem::Builder.new(spec).build
|
199
|
+
end
|
200
|
+
mv File.basename(t.name), t.name
|
201
|
+
end
|
202
|
+
end
|
203
|
+
end
|
204
|
+
end
|
data/ext/do_sqlite3_ext.c
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
#include <ruby.h>
|
2
|
-
#include <version.h>
|
3
2
|
#include <string.h>
|
4
3
|
#include <math.h>
|
5
4
|
#include <time.h>
|
@@ -18,6 +17,18 @@
|
|
18
17
|
|
19
18
|
#define TRUE_CLASS CONST_GET(rb_mKernel, "TrueClass")
|
20
19
|
|
20
|
+
#ifndef RSTRING_PTR
|
21
|
+
#define RSTRING_PTR(s) (RSTRING(s)->ptr)
|
22
|
+
#endif
|
23
|
+
|
24
|
+
#ifndef RSTRING_LEN
|
25
|
+
#define RSTRING_LEN(s) (RSTRING(s)->len)
|
26
|
+
#endif
|
27
|
+
|
28
|
+
#ifndef RARRAY_LEN
|
29
|
+
#define RARRAY_LEN(a) RARRAY(a)->len
|
30
|
+
#endif
|
31
|
+
|
21
32
|
#ifdef _WIN32
|
22
33
|
#define do_int64 signed __int64
|
23
34
|
#else
|
@@ -39,7 +50,11 @@ static VALUE cDO_Reader;
|
|
39
50
|
|
40
51
|
static VALUE rb_cDate;
|
41
52
|
static VALUE rb_cDateTime;
|
53
|
+
|
54
|
+
#ifndef RUBY_19_COMPATIBILITY
|
42
55
|
static VALUE rb_cRational;
|
56
|
+
#endif
|
57
|
+
|
43
58
|
static VALUE rb_cBigDecimal;
|
44
59
|
|
45
60
|
static VALUE mSqlite3;
|
@@ -404,13 +419,13 @@ static VALUE cCommand_execute_reader(int argc, VALUE *argv, VALUE self) {
|
|
404
419
|
// field_types = rb_ary_new();
|
405
420
|
// }
|
406
421
|
|
407
|
-
if ( field_types == Qnil || 0 ==
|
422
|
+
if ( field_types == Qnil || 0 == RARRAY_LEN(field_types) ) {
|
408
423
|
field_types = rb_ary_new();
|
409
|
-
} else if (
|
424
|
+
} else if (RARRAY_LEN(field_types) != field_count) {
|
410
425
|
// Whoops... wrong number of types passed to set_types. Close the reader and raise
|
411
426
|
// and error
|
412
427
|
rb_funcall(reader, rb_intern("close"), 0);
|
413
|
-
rb_raise(eSqlite3Error, "Field-count mismatch. Expected %
|
428
|
+
rb_raise(eSqlite3Error, "Field-count mismatch. Expected %ld fields, but the query yielded %d", RARRAY_LEN(field_types), field_count);
|
414
429
|
}
|
415
430
|
|
416
431
|
|
@@ -454,7 +469,7 @@ static VALUE cReader_next(VALUE self) {
|
|
454
469
|
field_count = NUM2INT(rb_iv_get(self, "@field_count"));
|
455
470
|
|
456
471
|
field_types = rb_iv_get(self, "@field_types");
|
457
|
-
ft_length =
|
472
|
+
ft_length = RARRAY_LEN(field_types);
|
458
473
|
|
459
474
|
result = sqlite3_step(reader);
|
460
475
|
|
@@ -469,7 +484,7 @@ static VALUE cReader_next(VALUE self) {
|
|
469
484
|
value = native_typecast(sqlite3_column_value(reader, i), sqlite3_column_type(reader, i));
|
470
485
|
}
|
471
486
|
else {
|
472
|
-
value = ruby_typecast(sqlite3_column_value(reader, i), rb_class2name(
|
487
|
+
value = ruby_typecast(sqlite3_column_value(reader, i), rb_class2name(RARRAY_PTR(field_types)[i]), sqlite3_column_type(reader, i));
|
473
488
|
}
|
474
489
|
rb_ary_push(arr, value);
|
475
490
|
}
|
@@ -508,7 +523,11 @@ void Init_do_sqlite3_ext() {
|
|
508
523
|
|
509
524
|
rb_funcall(rb_mKernel, rb_intern("require"), 1, rb_str_new2("data_objects"));
|
510
525
|
|
511
|
-
|
526
|
+
#ifdef RUBY_LESS_THAN_186
|
527
|
+
ID_NEW_DATE = rb_intern("new0");
|
528
|
+
#else
|
529
|
+
ID_NEW_DATE = rb_intern("new!");
|
530
|
+
#endif
|
512
531
|
ID_LOGGER = rb_intern("logger");
|
513
532
|
ID_DEBUG = rb_intern("debug");
|
514
533
|
ID_LEVEL = rb_intern("level");
|
data/ext/extconf.rb
CHANGED
@@ -28,6 +28,12 @@ dir_config("sqlite3")
|
|
28
28
|
# NOTE: use GCC flags unless Visual C compiler is used
|
29
29
|
$CFLAGS << ' -Wall ' unless RUBY_PLATFORM =~ /mswin/
|
30
30
|
|
31
|
+
if RUBY_VERSION < '1.8.6'
|
32
|
+
$CFLAGS << ' -DRUBY_LESS_THAN_186'
|
33
|
+
elsif RUBY_VERSION >= '1.9.0'
|
34
|
+
$CFLAGS << ' -DRUBY_19_COMPATIBILITY'
|
35
|
+
end
|
36
|
+
|
31
37
|
# Do the work
|
32
38
|
# create_makefile(extension_name)
|
33
39
|
if have_header( "sqlite3.h" ) && have_library( "sqlite3", "sqlite3_open" )
|
data/lib/do_sqlite3/version.rb
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: do_sqlite3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.9
|
5
5
|
platform: x86-mswin32-60
|
6
6
|
authors:
|
7
7
|
- Bernerd Schaefer
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-11-27 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - "="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.9.
|
23
|
+
version: 0.9.9
|
24
24
|
version:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: hoe
|
@@ -44,6 +44,7 @@ extra_rdoc_files:
|
|
44
44
|
- Manifest.txt
|
45
45
|
- README.txt
|
46
46
|
files:
|
47
|
+
- .gitignore
|
47
48
|
- History.txt
|
48
49
|
- LICENSE
|
49
50
|
- Manifest.txt
|
@@ -51,21 +52,23 @@ files:
|
|
51
52
|
- Rakefile
|
52
53
|
- TODO
|
53
54
|
- ext/do_sqlite3_ext.c
|
54
|
-
- ext/do_sqlite3_ext.so
|
55
55
|
- ext/extconf.rb
|
56
56
|
- lib/do_sqlite3.rb
|
57
57
|
- lib/do_sqlite3/transaction.rb
|
58
58
|
- lib/do_sqlite3/version.rb
|
59
|
-
- lib/sqlite3.dll
|
60
59
|
- spec/integration/do_sqlite3_spec.rb
|
61
60
|
- spec/integration/logging_spec.rb
|
62
61
|
- spec/integration/quoting_spec.rb
|
63
62
|
- spec/spec.opts
|
64
63
|
- spec/spec_helper.rb
|
65
64
|
- spec/unit/transaction_spec.rb
|
66
|
-
|
65
|
+
- lib/do_sqlite3_ext.so
|
66
|
+
has_rdoc: false
|
67
67
|
homepage: http://rubyforge.org/projects/dorb
|
68
|
-
post_install_message:
|
68
|
+
post_install_message: |
|
69
|
+
Now download http://www.sqlite.org/sqlitedll-3_6_6_2.zip
|
70
|
+
And place the dll somewhere in your PATH, for example C:\ruby\bin
|
71
|
+
|
69
72
|
rdoc_options:
|
70
73
|
- --main
|
71
74
|
- README.txt
|
@@ -87,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
90
|
requirements: []
|
88
91
|
|
89
92
|
rubyforge_project: dorb
|
90
|
-
rubygems_version: 1.3.
|
93
|
+
rubygems_version: 1.3.1
|
91
94
|
signing_key:
|
92
95
|
specification_version: 2
|
93
96
|
summary: A DataObject.rb driver for Sqlite3
|
data/ext/do_sqlite3_ext.so
DELETED
Binary file
|
data/lib/sqlite3.dll
DELETED
Binary file
|