do_sqlite3 0.10.6 → 0.10.7
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog.markdown +4 -0
- data/Rakefile +1 -4
- data/ext/do_sqlite3/do_common.c +11 -0
- data/ext/do_sqlite3/extconf.rb +5 -0
- data/lib/do_sqlite3/version.rb +1 -1
- data/tasks/compile.rake +1 -1
- metadata +8 -10
data/ChangeLog.markdown
CHANGED
data/Rakefile
CHANGED
data/ext/do_sqlite3/do_common.c
CHANGED
@@ -185,11 +185,16 @@ VALUE data_objects_parse_date(const char *date) {
|
|
185
185
|
return Qnil;
|
186
186
|
}
|
187
187
|
|
188
|
+
#ifdef HAVE_NO_DATETIME_NEWBANG
|
189
|
+
return rb_funcall(rb_cDate, ID_NEW, 3, INT2NUM(year), INT2NUM(month), INT2NUM(day));
|
190
|
+
#else
|
191
|
+
|
188
192
|
jd = data_objects_jd_from_date(year, month, day);
|
189
193
|
ajd = (jd * 2) - 1; // Math from Date.jd_to_ajd
|
190
194
|
rational = rb_funcall(rb_mKernel, ID_RATIONAL, 2, INT2NUM(ajd), INT2NUM(2));
|
191
195
|
|
192
196
|
return rb_funcall(rb_cDate, ID_NEW_DATE, 3, rational, INT2NUM(0), INT2NUM(2299161));
|
197
|
+
#endif
|
193
198
|
}
|
194
199
|
|
195
200
|
VALUE data_objects_parse_time(const char *date) {
|
@@ -299,6 +304,11 @@ VALUE data_objects_parse_date_time(const char *date) {
|
|
299
304
|
rb_raise(eDataError, "Couldn't parse date: %s", date);
|
300
305
|
}
|
301
306
|
|
307
|
+
#ifdef HAVE_NO_DATETIME_NEWBANG
|
308
|
+
offset = data_objects_timezone_to_offset(hour_offset, minute_offset);
|
309
|
+
return rb_funcall(rb_cDateTime, ID_NEW, 7, INT2NUM(year), INT2NUM(month), INT2NUM(day),
|
310
|
+
INT2NUM(hour), INT2NUM(min), INT2NUM(sec), offset);
|
311
|
+
#else
|
302
312
|
jd = data_objects_jd_from_date(year, month, day);
|
303
313
|
|
304
314
|
/*
|
@@ -327,6 +337,7 @@ VALUE data_objects_parse_date_time(const char *date) {
|
|
327
337
|
offset = data_objects_timezone_to_offset(hour_offset, minute_offset);
|
328
338
|
|
329
339
|
return rb_funcall(rb_cDateTime, ID_NEW_DATE, 3, ajd, offset, INT2NUM(2299161));
|
340
|
+
#endif
|
330
341
|
}
|
331
342
|
|
332
343
|
VALUE data_objects_cConnection_character_set(VALUE self) {
|
data/ext/do_sqlite3/extconf.rb
CHANGED
@@ -2,6 +2,7 @@ ENV["RC_ARCHS"] = "" if RUBY_PLATFORM =~ /darwin/
|
|
2
2
|
|
3
3
|
# Loads mkmf which is used to make makefiles for Ruby extensions
|
4
4
|
require 'mkmf'
|
5
|
+
require 'date'
|
5
6
|
|
6
7
|
# Allow for custom compiler to be specified.
|
7
8
|
RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
|
@@ -16,6 +17,10 @@ if RUBY_VERSION < '1.8.6'
|
|
16
17
|
$CFLAGS << ' -DRUBY_LESS_THAN_186'
|
17
18
|
end
|
18
19
|
|
20
|
+
unless DateTime.respond_to?(:new!)
|
21
|
+
$CFLAGS << ' -DHAVE_NO_DATETIME_NEWBANG'
|
22
|
+
end
|
23
|
+
|
19
24
|
# Do the work
|
20
25
|
# create_makefile(extension_name)
|
21
26
|
if have_header( "sqlite3.h" ) && have_library( "sqlite3", "sqlite3_open" )
|
data/lib/do_sqlite3/version.rb
CHANGED
data/tasks/compile.rake
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: do_sqlite3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 57
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 10
|
9
|
-
-
|
10
|
-
version: 0.10.
|
9
|
+
- 7
|
10
|
+
version: 0.10.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dirkjan Bussink
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-03-29 00:00:00
|
19
|
-
default_executable:
|
18
|
+
date: 2011-03-29 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: data_objects
|
@@ -26,12 +25,12 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - "="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
28
|
+
hash: 57
|
30
29
|
segments:
|
31
30
|
- 0
|
32
31
|
- 10
|
33
|
-
-
|
34
|
-
version: 0.10.
|
32
|
+
- 7
|
33
|
+
version: 0.10.7
|
35
34
|
type: :runtime
|
36
35
|
version_requirements: *id001
|
37
36
|
- !ruby/object:Gem::Dependency
|
@@ -115,7 +114,6 @@ files:
|
|
115
114
|
- tasks/release.rake
|
116
115
|
- tasks/retrieve.rake
|
117
116
|
- tasks/spec.rake
|
118
|
-
has_rdoc: true
|
119
117
|
homepage:
|
120
118
|
licenses: []
|
121
119
|
|
@@ -145,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
143
|
requirements: []
|
146
144
|
|
147
145
|
rubyforge_project: dorb
|
148
|
-
rubygems_version: 1.
|
146
|
+
rubygems_version: 1.8.6
|
149
147
|
signing_key:
|
150
148
|
specification_version: 3
|
151
149
|
summary: DataObjects Sqlite3 Driver
|