amalgalite 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +49 -46
- data/LICENSE +9 -11
- data/ext/amalgalite3.c +5 -5
- data/ext/amalgalite3_blob.c +9 -1
- data/ext/amalgalite3_constants.c +5 -0
- data/ext/amalgalite3_database.c +4 -1
- data/ext/sqlite3.c +1398 -915
- data/ext/sqlite3.h +103 -51
- data/lib/amalgalite/sqlite3/constants.rb +0 -3
- data/lib/amalgalite/version.rb +6 -1
- data/spec/sqlite3/version_spec.rb +2 -2
- data/tasks/config.rb +2 -2
- data/tasks/documentation.rake +3 -1
- data/tasks/extension.rake +34 -0
- metadata +4 -2
data/ext/sqlite3.h
CHANGED
@@ -30,7 +30,7 @@
|
|
30
30
|
** the version number) and changes its name to "sqlite3.h" as
|
31
31
|
** part of the build process.
|
32
32
|
**
|
33
|
-
** @(#) $Id: sqlite.h.in,v 1.
|
33
|
+
** @(#) $Id: sqlite.h.in,v 1.398 2008/09/10 13:09:24 drh Exp $
|
34
34
|
*/
|
35
35
|
#ifndef _SQLITE3_H_
|
36
36
|
#define _SQLITE3_H_
|
@@ -57,7 +57,7 @@ extern "C" {
|
|
57
57
|
#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
|
58
58
|
/* GCC added the deprecated attribute in version 3.1 */
|
59
59
|
#define SQLITE_DEPRECATED __attribute__ ((deprecated))
|
60
|
-
#elif defined(_MSC_VER)
|
60
|
+
#elif defined(_MSC_VER) && (_MSC_VER>1200)
|
61
61
|
#define SQLITE_DEPRECATED __declspec(deprecated)
|
62
62
|
#else
|
63
63
|
#define SQLITE_DEPRECATED
|
@@ -70,7 +70,7 @@ extern "C" {
|
|
70
70
|
/* I can confirm that it does not work on version 4.1.0... */
|
71
71
|
/* First appears in GCC docs for version 4.3.0 */
|
72
72
|
#define SQLITE_EXPERIMENTAL __attribute__ ((warning ("is experimental")))
|
73
|
-
#elif defined(_MSC_VER)
|
73
|
+
#elif defined(_MSC_VER) && (_MSC_VER>1200)
|
74
74
|
#define SQLITE_EXPERIMENTAL __declspec(deprecated("was declared experimental"))
|
75
75
|
#else
|
76
76
|
#define SQLITE_EXPERIMENTAL
|
@@ -116,8 +116,8 @@ extern "C" {
|
|
116
116
|
** with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z
|
117
117
|
** are the major version, minor version, and release number.
|
118
118
|
*/
|
119
|
-
#define SQLITE_VERSION "3.6.
|
120
|
-
#define SQLITE_VERSION_NUMBER
|
119
|
+
#define SQLITE_VERSION "3.6.3"
|
120
|
+
#define SQLITE_VERSION_NUMBER 3006003
|
121
121
|
|
122
122
|
/*
|
123
123
|
** CAPI3REF: Run-Time Library Version Numbers {H10020} <S60100>
|
@@ -154,8 +154,9 @@ int sqlite3_libversion_number(void);
|
|
154
154
|
** CAPI3REF: Test To See If The Library Is Threadsafe {H10100} <S60100>
|
155
155
|
**
|
156
156
|
** SQLite can be compiled with or without mutexes. When
|
157
|
-
** the [SQLITE_THREADSAFE] C preprocessor macro
|
158
|
-
** are enabled and SQLite is threadsafe. When
|
157
|
+
** the [SQLITE_THREADSAFE] C preprocessor macro 1 or 2, mutexes
|
158
|
+
** are enabled and SQLite is threadsafe. When the
|
159
|
+
** [SQLITE_THREADSAFE] macro is 0,
|
159
160
|
** the mutexes are omitted. Without the mutexes, it is not safe
|
160
161
|
** to use SQLite concurrently from more than one thread.
|
161
162
|
**
|
@@ -177,12 +178,13 @@ int sqlite3_libversion_number(void);
|
|
177
178
|
** only the default compile-time setting, not any run-time changes
|
178
179
|
** to that setting.
|
179
180
|
**
|
181
|
+
** See the [threading mode] documentation for additional information.
|
182
|
+
**
|
180
183
|
** INVARIANTS:
|
181
184
|
**
|
182
185
|
** {H10101} The [sqlite3_threadsafe()] function shall return nonzero if
|
183
|
-
**
|
184
|
-
**
|
185
|
-
** permanently disabled.
|
186
|
+
** and only if
|
187
|
+
** SQLite was compiled with the its mutexes enabled by default.
|
186
188
|
**
|
187
189
|
** {H10102} The value returned by the [sqlite3_threadsafe()] function
|
188
190
|
** shall not change when mutex setting are modified at
|
@@ -1097,7 +1099,9 @@ struct sqlite3_mem_methods {
|
|
1097
1099
|
** The application is responsible for serializing access to
|
1098
1100
|
** [database connections] and [prepared statements]. But other mutexes
|
1099
1101
|
** are enabled so that SQLite will be safe to use in a multi-threaded
|
1100
|
-
** environment
|
1102
|
+
** environment as long as no two threads attempt to use the same
|
1103
|
+
** [database connection] at the same time. See the [threading mode]
|
1104
|
+
** documentation for additional information.</dd>
|
1101
1105
|
**
|
1102
1106
|
** <dt>SQLITE_CONFIG_SERIALIZED</dt>
|
1103
1107
|
** <dd>There are no arguments to this option. This option enables
|
@@ -1108,11 +1112,7 @@ struct sqlite3_mem_methods {
|
|
1108
1112
|
** to [database connections] and [prepared statements] so that the
|
1109
1113
|
** application is free to use the same [database connection] or the
|
1110
1114
|
** same [prepared statement] in different threads at the same time.
|
1111
|
-
**
|
1112
|
-
** <p>This configuration option merely sets the default mutex
|
1113
|
-
** behavior to serialize access to [database connections]. Individual
|
1114
|
-
** [database connections] can override this setting
|
1115
|
-
** using the [SQLITE_OPEN_NOMUTEX] flag to [sqlite3_open_v2()].</p></dd>
|
1115
|
+
** See the [threading mode] documentation for additional information.</dd>
|
1116
1116
|
**
|
1117
1117
|
** <dt>SQLITE_CONFIG_MALLOC</dt>
|
1118
1118
|
** <dd>This option takes a single argument which is a pointer to an
|
@@ -1575,6 +1575,10 @@ int sqlite3_complete16(const void *sql);
|
|
1575
1575
|
** previously set handler. Note that calling [sqlite3_busy_timeout()]
|
1576
1576
|
** will also set or clear the busy handler.
|
1577
1577
|
**
|
1578
|
+
** The busy callback should not take any actions which modify the
|
1579
|
+
** database connection that invoked the busy handler. Any such actions
|
1580
|
+
** result in undefined behavior.
|
1581
|
+
**
|
1578
1582
|
** INVARIANTS:
|
1579
1583
|
**
|
1580
1584
|
** {H12311} The [sqlite3_busy_handler(D,C,A)] function shall replace
|
@@ -2103,6 +2107,11 @@ void sqlite3_randomness(int N, void *P);
|
|
2103
2107
|
** previous call. Disable the authorizer by installing a NULL callback.
|
2104
2108
|
** The authorizer is disabled by default.
|
2105
2109
|
**
|
2110
|
+
** The authorizer callback must not do anything that will modify
|
2111
|
+
** the database connection that invoked the authorizer callback.
|
2112
|
+
** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
|
2113
|
+
** database connections for the meaning of "modify" in this paragraph.
|
2114
|
+
**
|
2106
2115
|
** When [sqlite3_prepare_v2()] is used to prepare a statement, the
|
2107
2116
|
** statement might be reprepared during [sqlite3_step()] due to a
|
2108
2117
|
** schema change. Hence, the application should ensure that the
|
@@ -2327,7 +2336,12 @@ SQLITE_EXPERIMENTAL void *sqlite3_profile(sqlite3*,
|
|
2327
2336
|
**
|
2328
2337
|
** If the progress callback returns non-zero, the operation is
|
2329
2338
|
** interrupted. This feature can be used to implement a
|
2330
|
-
** "Cancel" button on a GUI dialog box.
|
2339
|
+
** "Cancel" button on a GUI progress dialog box.
|
2340
|
+
**
|
2341
|
+
** The progress handler must not do anything that will modify
|
2342
|
+
** the database connection that invoked the progress handler.
|
2343
|
+
** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
|
2344
|
+
** database connections for the meaning of "modify" in this paragraph.
|
2331
2345
|
**
|
2332
2346
|
** INVARIANTS:
|
2333
2347
|
**
|
@@ -2390,7 +2404,7 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
|
|
2390
2404
|
** except that it accepts two additional parameters for additional control
|
2391
2405
|
** over the new database connection. The flags parameter can take one of
|
2392
2406
|
** the following three values, optionally combined with the
|
2393
|
-
** [SQLITE_OPEN_NOMUTEX]
|
2407
|
+
** [SQLITE_OPEN_NOMUTEX] or [SQLITE_OPEN_FULLMUTEX] flags:
|
2394
2408
|
**
|
2395
2409
|
** <dl>
|
2396
2410
|
** <dt>[SQLITE_OPEN_READONLY]</dt>
|
@@ -2410,16 +2424,15 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
|
|
2410
2424
|
**
|
2411
2425
|
** If the 3rd parameter to sqlite3_open_v2() is not one of the
|
2412
2426
|
** combinations shown above or one of the combinations shown above combined
|
2413
|
-
** with the [SQLITE_OPEN_NOMUTEX]
|
2427
|
+
** with the [SQLITE_OPEN_NOMUTEX] or [SQLITE_OPEN_FULLMUTEX] flags,
|
2428
|
+
** then the behavior is undefined.
|
2414
2429
|
**
|
2415
|
-
** If the [SQLITE_OPEN_NOMUTEX] flag is set, then
|
2416
|
-
**
|
2417
|
-
**
|
2418
|
-
** [
|
2419
|
-
**
|
2420
|
-
**
|
2421
|
-
** to [sqlite3_config()]. The [SQLITE_OPEN_NOMUTEX] flag only makes a
|
2422
|
-
** difference when SQLite is in its default [SQLITE_CONFIG_SERIALIZED] mode.
|
2430
|
+
** If the [SQLITE_OPEN_NOMUTEX] flag is set, then the database connection
|
2431
|
+
** opens in the multi-thread [threading mode] as long as the single-thread
|
2432
|
+
** mode has not been set at compile-time or start-time. If the
|
2433
|
+
** [SQLITE_OPEN_FULLMUTEX] flag is set then the database connection opens
|
2434
|
+
** in the serialized [threading mode] unless single-thread was
|
2435
|
+
** previously selected at compile-time or start-time.
|
2423
2436
|
**
|
2424
2437
|
** If the filename is ":memory:", then a private, temporary in-memory database
|
2425
2438
|
** is created for the connection. This in-memory database will vanish when
|
@@ -3838,7 +3851,8 @@ int sqlite3_reset(sqlite3_stmt *pStmt);
|
|
3838
3851
|
** characters. Any attempt to create a function with a longer name
|
3839
3852
|
** will result in [SQLITE_ERROR] being returned.
|
3840
3853
|
**
|
3841
|
-
** The third parameter
|
3854
|
+
** The third parameter (nArg)
|
3855
|
+
** is the number of arguments that the SQL function or
|
3842
3856
|
** aggregate takes. If this parameter is negative, then the SQL function or
|
3843
3857
|
** aggregate may take any number of arguments.
|
3844
3858
|
**
|
@@ -3869,72 +3883,91 @@ int sqlite3_reset(sqlite3_stmt *pStmt);
|
|
3869
3883
|
** functions with the same name but with either differing numbers of
|
3870
3884
|
** arguments or differing preferred text encodings. SQLite will use
|
3871
3885
|
** the implementation most closely matches the way in which the
|
3872
|
-
** SQL function is used.
|
3886
|
+
** SQL function is used. A function implementation with a non-negative
|
3887
|
+
** nArg parameter is a better match than a function implementation with
|
3888
|
+
** a negative nArg. A function where the preferred text encoding
|
3889
|
+
** matches the database encoding is a better
|
3890
|
+
** match than a function where the encoding is different.
|
3891
|
+
** A function where the encoding difference is between UTF16le and UTF16be
|
3892
|
+
** is a closer match than a function where the encoding difference is
|
3893
|
+
** between UTF8 and UTF16.
|
3894
|
+
**
|
3895
|
+
** Built-in functions may be overloaded by new application-defined functions.
|
3896
|
+
** The first application-defined function with a given name overrides all
|
3897
|
+
** built-in functions in the same [database connection] with the same name.
|
3898
|
+
** Subsequent application-defined functions of the same name only override
|
3899
|
+
** prior application-defined functions that are an exact match for the
|
3900
|
+
** number of parameters and preferred encoding.
|
3901
|
+
**
|
3902
|
+
** An application-defined function is permitted to call other
|
3903
|
+
** SQLite interfaces. However, such calls must not
|
3904
|
+
** close the database connection nor finalize or reset the prepared
|
3905
|
+
** statement in which the function is running.
|
3873
3906
|
**
|
3874
3907
|
** INVARIANTS:
|
3875
3908
|
**
|
3876
|
-
** {H16103} The [sqlite3_create_function16()] interface
|
3877
|
-
**
|
3878
|
-
** interprets the
|
3909
|
+
** {H16103} The [sqlite3_create_function16(D,X,...)] interface shall behave
|
3910
|
+
** as [sqlite3_create_function(D,X,...)] in every way except that it
|
3911
|
+
** interprets the X argument as zero-terminated UTF-16
|
3879
3912
|
** native byte order instead of as zero-terminated UTF-8.
|
3880
3913
|
**
|
3881
|
-
** {H16106} A successful invocation of
|
3882
|
-
**
|
3914
|
+
** {H16106} A successful invocation of the
|
3915
|
+
** [sqlite3_create_function(D,X,N,E,...)] interface shall register
|
3883
3916
|
** or replaces callback functions in the [database connection] D
|
3884
3917
|
** used to implement the SQL function named X with N parameters
|
3885
3918
|
** and having a preferred text encoding of E.
|
3886
3919
|
**
|
3887
3920
|
** {H16109} A successful call to [sqlite3_create_function(D,X,N,E,P,F,S,L)]
|
3888
|
-
**
|
3921
|
+
** shall replace the P, F, S, and L values from any prior calls with
|
3889
3922
|
** the same D, X, N, and E values.
|
3890
3923
|
**
|
3891
|
-
** {H16112} The [sqlite3_create_function(D,X,...)] interface
|
3892
|
-
**
|
3924
|
+
** {H16112} The [sqlite3_create_function(D,X,...)] interface shall fail
|
3925
|
+
** if the SQL function name X is
|
3893
3926
|
** longer than 255 bytes exclusive of the zero terminator.
|
3894
3927
|
**
|
3895
|
-
** {H16118}
|
3896
|
-
** is
|
3897
|
-
|
3928
|
+
** {H16118} The [sqlite3_create_function(D,X,N,E,P,F,S,L)] interface
|
3929
|
+
** shall fail unless either F is NULL and S and L are non-NULL or
|
3930
|
+
*** F is non-NULL and S and L are NULL.
|
3898
3931
|
**
|
3899
|
-
** {H16121} The [sqlite3_create_function(D,...)] interface fails with an
|
3932
|
+
** {H16121} The [sqlite3_create_function(D,...)] interface shall fails with an
|
3900
3933
|
** error code of [SQLITE_BUSY] if there exist [prepared statements]
|
3901
3934
|
** associated with the [database connection] D.
|
3902
3935
|
**
|
3903
|
-
** {H16124} The [sqlite3_create_function(D,X,N,...)] interface
|
3904
|
-
** error code of [SQLITE_ERROR] if parameter N
|
3905
|
-
** of arguments to the SQL function being registered) is less
|
3936
|
+
** {H16124} The [sqlite3_create_function(D,X,N,...)] interface shall fail with
|
3937
|
+
** an error code of [SQLITE_ERROR] if parameter N is less
|
3906
3938
|
** than -1 or greater than 127.
|
3907
3939
|
**
|
3908
3940
|
** {H16127} When N is non-negative, the [sqlite3_create_function(D,X,N,...)]
|
3909
|
-
** interface
|
3941
|
+
** interface shall register callbacks to be invoked for the
|
3942
|
+
** SQL function
|
3910
3943
|
** named X when the number of arguments to the SQL function is
|
3911
3944
|
** exactly N.
|
3912
3945
|
**
|
3913
3946
|
** {H16130} When N is -1, the [sqlite3_create_function(D,X,N,...)]
|
3914
|
-
** interface
|
3915
|
-
** named X with any number of arguments.
|
3947
|
+
** interface shall register callbacks to be invoked for the SQL
|
3948
|
+
** function named X with any number of arguments.
|
3916
3949
|
**
|
3917
3950
|
** {H16133} When calls to [sqlite3_create_function(D,X,N,...)]
|
3918
3951
|
** specify multiple implementations of the same function X
|
3919
3952
|
** and when one implementation has N>=0 and the other has N=(-1)
|
3920
|
-
** the implementation with a non-zero N
|
3953
|
+
** the implementation with a non-zero N shall be preferred.
|
3921
3954
|
**
|
3922
3955
|
** {H16136} When calls to [sqlite3_create_function(D,X,N,E,...)]
|
3923
3956
|
** specify multiple implementations of the same function X with
|
3924
3957
|
** the same number of arguments N but with different
|
3925
3958
|
** encodings E, then the implementation where E matches the
|
3926
|
-
** database encoding
|
3959
|
+
** database encoding shall preferred.
|
3927
3960
|
**
|
3928
3961
|
** {H16139} For an aggregate SQL function created using
|
3929
3962
|
** [sqlite3_create_function(D,X,N,E,P,0,S,L)] the finalizer
|
3930
|
-
** function L
|
3963
|
+
** function L shall always be invoked exactly once if the
|
3931
3964
|
** step function S is called one or more times.
|
3932
3965
|
**
|
3933
3966
|
** {H16142} When SQLite invokes either the xFunc or xStep function of
|
3934
3967
|
** an application-defined SQL function or aggregate created
|
3935
3968
|
** by [sqlite3_create_function()] or [sqlite3_create_function16()],
|
3936
3969
|
** then the array of [sqlite3_value] objects passed as the
|
3937
|
-
** third parameter
|
3970
|
+
** third parameter shall be [protected sqlite3_value] objects.
|
3938
3971
|
*/
|
3939
3972
|
int sqlite3_create_function(
|
3940
3973
|
sqlite3 *db,
|
@@ -4846,6 +4879,14 @@ sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
|
|
4846
4879
|
** If another function was previously registered, its
|
4847
4880
|
** pArg value is returned. Otherwise NULL is returned.
|
4848
4881
|
**
|
4882
|
+
** The callback implementation must not do anything that will modify
|
4883
|
+
** the database connection that invoked the callback. Any actions
|
4884
|
+
** to modify the database connection must be deferred until after the
|
4885
|
+
** completion of the [sqlite3_step()] call that triggered the commit
|
4886
|
+
** or rollback hook in the first place.
|
4887
|
+
** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
|
4888
|
+
** database connections for the meaning of "modify" in this paragraph.
|
4889
|
+
**
|
4849
4890
|
** Registering a NULL function disables the callback.
|
4850
4891
|
**
|
4851
4892
|
** For the purposes of this API, a transaction is said to have been
|
@@ -4920,6 +4961,13 @@ void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
|
|
4920
4961
|
** The update hook is not invoked when internal system tables are
|
4921
4962
|
** modified (i.e. sqlite_master and sqlite_sequence).
|
4922
4963
|
**
|
4964
|
+
** The update hook implementation must not do anything that will modify
|
4965
|
+
** the database connection that invoked the update hook. Any actions
|
4966
|
+
** to modify the database connection must be deferred until after the
|
4967
|
+
** completion of the [sqlite3_step()] call that triggered the update hook.
|
4968
|
+
** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
|
4969
|
+
** database connections for the meaning of "modify" in this paragraph.
|
4970
|
+
**
|
4923
4971
|
** If another function was previously registered, its pArg value
|
4924
4972
|
** is returned. Otherwise NULL is returned.
|
4925
4973
|
**
|
@@ -6197,6 +6245,10 @@ SQLITE_EXPERIMENTAL int sqlite3_status(int op, int *pCurrent, int *pHighwater, i
|
|
6197
6245
|
*/
|
6198
6246
|
SQLITE_EXPERIMENTAL int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
|
6199
6247
|
|
6248
|
+
|
6249
|
+
int sqlite3_wsd_init(int N, int J);
|
6250
|
+
void *sqlite3_wsd_find(void *K, int L);
|
6251
|
+
|
6200
6252
|
/*
|
6201
6253
|
** CAPI3REF: Status Parameters {H17250} <H17200>
|
6202
6254
|
** EXPERIMENTAL
|
data/lib/amalgalite/version.rb
CHANGED
@@ -9,7 +9,7 @@ module Amalgalite
|
|
9
9
|
|
10
10
|
MAJOR = 0
|
11
11
|
MINOR = 4
|
12
|
-
BUILD =
|
12
|
+
BUILD = 1
|
13
13
|
|
14
14
|
#
|
15
15
|
# return the Version as an array of MAJOR, MINOR, BUILD
|
@@ -23,6 +23,11 @@ module Amalgalite
|
|
23
23
|
to_a.join(".")
|
24
24
|
end
|
25
25
|
|
26
|
+
# return the Vesion as a hash
|
27
|
+
def self.to_hash
|
28
|
+
{ :major => MAJOR, :minor => MINOR, :build => BUILD }
|
29
|
+
end
|
30
|
+
|
26
31
|
# Version string constant
|
27
32
|
STRING = Version.to_s.freeze
|
28
33
|
end
|
@@ -5,10 +5,10 @@ describe "Amalgalite::SQLite3::Version" do
|
|
5
5
|
it "should have the sqlite3 version" do
|
6
6
|
Amalgalite::SQLite3::VERSION.should =~ /\d\.\d\.\d/
|
7
7
|
Amalgalite::SQLite3::Version.to_s.should =~ /\d\.\d\.\d/
|
8
|
-
Amalgalite::SQLite3::Version.to_i.should ==
|
8
|
+
Amalgalite::SQLite3::Version.to_i.should == 3006003
|
9
9
|
Amalgalite::SQLite3::Version::MAJOR.should == 3
|
10
10
|
Amalgalite::SQLite3::Version::MINOR.should == 6
|
11
|
-
Amalgalite::SQLite3::Version::RELEASE.should ==
|
11
|
+
Amalgalite::SQLite3::Version::RELEASE.should == 3
|
12
12
|
Amalgalite::SQLite3::Version.to_a.should have(3).items
|
13
13
|
end
|
14
14
|
end
|
data/tasks/config.rb
CHANGED
@@ -11,7 +11,7 @@ Configuration.for('project') {
|
|
11
11
|
version Amalgalite::Version.to_s
|
12
12
|
author "Jeremy Hinegardner"
|
13
13
|
email "jeremy at copiousfreetime dot org"
|
14
|
-
homepage "http://
|
14
|
+
homepage "http://copiousfreetime.rubyforge.org/amalgalite/"
|
15
15
|
description Utils.section_of("README", "description")
|
16
16
|
summary description.split(".").first
|
17
17
|
history "HISTORY"
|
@@ -85,7 +85,7 @@ Configuration.for('rdoc') {
|
|
85
85
|
files Configuration.for('packaging').files.rdoc
|
86
86
|
main_page files.first
|
87
87
|
title Configuration.for('project').name
|
88
|
-
options %w[ --line-numbers --inline-source ]
|
88
|
+
options %w[ --line-numbers --inline-source -f darkfish ]
|
89
89
|
output_dir "doc"
|
90
90
|
}
|
91
91
|
|
data/tasks/documentation.rake
CHANGED
@@ -9,11 +9,13 @@ if rdoc_config = Configuration.for_if_exist?('rdoc') then
|
|
9
9
|
namespace :doc do
|
10
10
|
|
11
11
|
require 'rake/rdoctask'
|
12
|
+
gem 'darkfish-rdoc'
|
13
|
+
require 'darkfish-rdoc'
|
12
14
|
|
13
15
|
# generating documentation locally
|
14
16
|
Rake::RDocTask.new do |rdoc|
|
15
17
|
rdoc.rdoc_dir = rdoc_config.output_dir
|
16
|
-
rdoc.options = rdoc_config.options
|
18
|
+
rdoc.options = rdoc_config.options
|
17
19
|
rdoc.rdoc_files = rdoc_config.files
|
18
20
|
rdoc.title = rdoc_config.title
|
19
21
|
rdoc.main = rdoc_config.main_page
|
data/tasks/extension.rake
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
require 'tasks/config'
|
2
2
|
require 'pathname'
|
3
|
+
require 'zlib'
|
4
|
+
require 'archive/tar/minitar'
|
3
5
|
|
4
6
|
#-----------------------------------------------------------------------
|
5
7
|
# Extensions
|
@@ -44,5 +46,37 @@ if ext_config = Configuration.for_if_exist?('extension') then
|
|
44
46
|
end
|
45
47
|
end
|
46
48
|
end
|
49
|
+
|
50
|
+
desc "Download and integrate the next version of sqlite"
|
51
|
+
task :update_sqlite do
|
52
|
+
next_version = ENV['VERSION']
|
53
|
+
puts "downloading ..."
|
54
|
+
url = URI.parse("http://sqlite.org/sqlite-amalgamation-#{next_version}.tar.gz")
|
55
|
+
file = "tmp/#{File.basename( url.path ) }"
|
56
|
+
File.open( file, "wb+") do |f|
|
57
|
+
res = Net::HTTP.get_response( url )
|
58
|
+
f.write( res.body )
|
59
|
+
end
|
60
|
+
|
61
|
+
puts "extracting..."
|
62
|
+
upstream_files = %w[ sqlite3.h sqlite3.c sqlite3ext.h ]
|
63
|
+
Zlib::GzipReader.open( file ) do |tgz|
|
64
|
+
Archive::Tar::Minitar::Reader.open( tgz ) do |tar|
|
65
|
+
tar.each_entry do |entry|
|
66
|
+
bname = File.basename( entry.full_name )
|
67
|
+
if upstream_files.include?( bname ) then
|
68
|
+
dest_file = File.join( "ext", bname )
|
69
|
+
puts "updating #{ dest_file }"
|
70
|
+
File.open( dest_file, "wb" ) do |df|
|
71
|
+
while bytes = entry.read do
|
72
|
+
df.write bytes
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
47
81
|
end
|
48
82
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amalgalite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Hinegardner
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-09-
|
12
|
+
date: 2008-09-28 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -164,6 +164,8 @@ post_install_message:
|
|
164
164
|
rdoc_options:
|
165
165
|
- --line-numbers
|
166
166
|
- --inline-source
|
167
|
+
- -f
|
168
|
+
- darkfish
|
167
169
|
- --main
|
168
170
|
- README
|
169
171
|
require_paths:
|