do_sqlite3 0.9.6 → 0.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ pkg
2
+ *.db
3
+ spec/test.db
data/Manifest.txt CHANGED
@@ -1,3 +1,4 @@
1
+ .gitignore
1
2
  History.txt
2
3
  LICENSE
3
4
  Manifest.txt
@@ -9,6 +10,7 @@ ext/extconf.rb
9
10
  lib/do_sqlite3.rb
10
11
  lib/do_sqlite3/transaction.rb
11
12
  lib/do_sqlite3/version.rb
13
+ lib/sqlite3.dll
12
14
  spec/integration/do_sqlite3_spec.rb
13
15
  spec/integration/logging_spec.rb
14
16
  spec/integration/quoting_spec.rb
data/Rakefile CHANGED
@@ -17,12 +17,21 @@ EMAIL = "bj.schaefer@gmail.com"
17
17
  GEM_NAME = "do_sqlite3"
18
18
  GEM_VERSION = DataObjects::Sqlite3::VERSION
19
19
  GEM_DEPENDENCIES = [["data_objects", GEM_VERSION]]
20
- GEM_CLEAN = ['**/*.{o,so,bundle,log,a,gem,dSYM,obj,pdb,lib,def,exp,DS_Store}', 'ext/Makefile']
21
- GEM_EXTRAS = { :extensions => %w[ ext/extconf.rb ], :has_rdoc => false }
20
+
21
+ clean = %w(o bundle log a gem dSYM obj pdb lib def exp DS_Store)
22
+
23
+ unless ENV["WINDOWS"]
24
+ clean << "so"
25
+ GEM_EXTRAS = { :extensions => %w[ ext/extconf.rb ], :has_rdoc => false }
26
+ else
27
+ GEM_EXTRAS = {}
28
+ end
29
+
30
+ GEM_CLEAN = ["**/*.{#{clean.join(",")}}", 'ext/Makefile']
22
31
 
23
32
  PROJECT_NAME = "dorb"
24
33
  PROJECT_URL = "http://rubyforge.org/projects/dorb"
25
- PROJECT_DESCRIPTION = PROJECT_SUMMARY = "A DataObject.rb driver for MySQL"
34
+ PROJECT_DESCRIPTION = PROJECT_SUMMARY = "A DataObject.rb driver for Sqlite3"
26
35
 
27
36
  DRIVER = true
28
37
 
data/ext/do_sqlite3_ext.c CHANGED
@@ -156,6 +156,10 @@ static VALUE parse_date_time(char *date) {
156
156
 
157
157
  int tokens_read, max_tokens;
158
158
 
159
+ if ( strcmp(date, "") == 0 ) {
160
+ return Qnil;
161
+ }
162
+
159
163
  if (0 != strchr(date, '.')) {
160
164
  // This is a datetime with sub-second precision
161
165
  tokens_read = sscanf(date, "%4d-%2d-%2d%*c%2d:%2d:%2d.%d%3d:%2d", &year, &month, &day, &hour, &min, &sec, &usec, &hour_offset, &minute_offset);
@@ -378,6 +382,7 @@ static VALUE cCommand_execute_reader(int argc, VALUE *argv, VALUE self) {
378
382
  Data_Get_Struct(rb_iv_get(conn_obj, "@connection"), sqlite3, db);
379
383
 
380
384
  query = build_query_from_args(self, argc, argv);
385
+
381
386
  data_objects_debug(query);
382
387
 
383
388
  status = sqlite3_prepare_v2(db, StringValuePtr(query), -1, &sqlite3_reader, 0);
data/lib/do_sqlite3.rb CHANGED
@@ -1,4 +1,12 @@
1
1
 
2
+ # HACK: If running on Windows, then add the current directory to the PATH
3
+ # for the current process so it can find the bundled dlls before the require
4
+ # of the actual extension file.
5
+ if RUBY_PLATFORM.match(/mingw|mswin/i)
6
+ libdir = File.expand_path(File.dirname(__FILE__)).gsub(File::SEPARATOR, File::ALT_SEPARATOR)
7
+ ENV['PATH'] = "#{libdir};" + ENV['PATH']
8
+ end
9
+
2
10
  require 'rubygems'
3
11
  require 'data_objects'
4
12
  require 'do_sqlite3_ext'
@@ -1,5 +1,5 @@
1
1
  module DataObjects
2
2
  module Sqlite3
3
- VERSION = "0.9.6"
3
+ VERSION = "0.9.7"
4
4
  end
5
5
  end
data/lib/sqlite3.dll ADDED
Binary file
@@ -136,6 +136,14 @@ describe "DataObjects::Sqlite3::Result" do
136
136
  end
137
137
  end
138
138
 
139
+ it "should not blow up when an empty string for a timestamp is used" do
140
+ id = insert("INSERT INTO users (name, age, type, created_at) VALUES (?, ?, ?, ?)", 'Sam', 30, Person, "")
141
+
142
+ select("SELECT created_at FROM users WHERE id = ?", [DateTime], id) do |reader|
143
+ reader.values.last.should == nil
144
+ end
145
+ end
146
+
139
147
  it "should return DateTimes using the same timezone that was used to insert it" do
140
148
  pending "improved support for timezone checking"
141
149
 
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.6
4
+ version: 0.9.7
5
5
  platform: ruby
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-10-12 00:00:00 -06:00
12
+ date: 2008-11-18 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.6
23
+ version: 0.9.7
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: hoe
@@ -30,9 +30,9 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.7.0
33
+ version: 1.8.2
34
34
  version:
35
- description: A DataObject.rb driver for MySQL
35
+ description: A DataObject.rb driver for Sqlite3
36
36
  email:
37
37
  - bj.schaefer@gmail.com
38
38
  executables: []
@@ -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
@@ -55,6 +56,7 @@ files:
55
56
  - lib/do_sqlite3.rb
56
57
  - lib/do_sqlite3/transaction.rb
57
58
  - lib/do_sqlite3/version.rb
59
+ - lib/sqlite3.dll
58
60
  - spec/integration/do_sqlite3_spec.rb
59
61
  - spec/integration/logging_spec.rb
60
62
  - spec/integration/quoting_spec.rb
@@ -85,9 +87,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
87
  requirements: []
86
88
 
87
89
  rubyforge_project: dorb
88
- rubygems_version: 1.2.0
90
+ rubygems_version: 1.3.1
89
91
  signing_key:
90
92
  specification_version: 2
91
- summary: A DataObject.rb driver for MySQL
93
+ summary: A DataObject.rb driver for Sqlite3
92
94
  test_files: []
93
95