forked from biggora/caminte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
35 lines (29 loc) · 962 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var fs = require('fs');
var path = require('path');
exports.Schema = require('./lib/schema').Schema;
exports.AbstractClass = require('./lib/abstract-class').AbstractClass;
exports.Validatable = require('./lib/validatable').Validatable;
var baseSQL = './lib/sql';
exports.__defineGetter__('BaseSQL', function () {
return require(baseSQL);
});
exports.init = function (rw) {
if (global.railway) {
global.railway.orm = exports;
} else {
rw.orm = {Schema: exports.Schema, AbstractClass: exports.AbstractClass};
}
var railway = './lib/railway';
require(railway)(rw);
};
try {
if (process.versions.node < '0.6') {
exports.version = JSON.parse(fs.readFileSync(__dirname + '/package.json')).version;
} else {
exports.version = require('./package').version;
}
} catch (e) {}
var commonTest = './tests/common_test';
exports.__defineGetter__('test', function () {
return require(commonTest);
});