1
0
Fork 0

no mruby by default

This commit is contained in:
Frank Celler 2012-05-12 22:29:07 +02:00
parent 2e15b194cc
commit b130804329
3 changed files with 74 additions and 2 deletions

View File

@ -1032,7 +1032,8 @@ SHELL_COMMON = @srcdir@/js/common/tests/shell-document.js \
@srcdir@/js/common/tests/shell-index.js \
@srcdir@/js/common/tests/shell-index-geo.js \
@srcdir@/js/common/tests/shell-cap-constraint.js \
@srcdir@/js/common/tests/shell-unique-constraint.js
@srcdir@/js/common/tests/shell-unique-constraint.js \
@srcdir@/js/common/tests/shell-hash-index.js
SHELL_SERVER = $(SHELL_COMMON)
UNITTESTS_SERVER = $(addprefix --unit-tests ,$(SHELL_SERVER))

2
configure vendored
View File

@ -9037,7 +9037,7 @@ fi
if test "${enable_mruby+set}" = set; then :
enableval=$enable_mruby; tr_MRUBY="${enableval:-yes}"
else
tr_MRUBY=yes
tr_MRUBY=no
fi

View File

@ -1235,6 +1235,77 @@ static string JS_client_client =
"}\n"
"\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"/// @brief adds a unique constraint\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"\n"
"ArangoCollection.prototype.ensureUniqueConstraint = function () {\n"
" var body;\n"
" var fields = [];\n"
" \n"
" for (var i = 0; i < arguments.length; ++i) {\n"
" fields.push(arguments[i]);\n"
" }\n"
"\n"
" body = { type : \"hash\", unique : true, fields : fields };\n"
"\n"
" var requestResult = this._database._connection.POST(\"/_api/index?collection=\" + encodeURIComponent(this._id), JSON.stringify(body));\n"
"\n"
" TRI_CheckRequestResult(requestResult);\n"
"\n"
" return requestResult;\n"
"}\n"
"\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"/// @brief adds a hash index\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"\n"
"ArangoCollection.prototype.ensureHashIndex = function () {\n"
" var body;\n"
" var fields = [];\n"
" \n"
" for (var i = 0; i < arguments.length; ++i) {\n"
" fields.push(arguments[i]);\n"
" }\n"
"\n"
" body = { type : \"hash\", unique : false, fields : fields };\n"
"\n"
" var requestResult = this._database._connection.POST(\"/_api/index?collection=\" + encodeURIComponent(this._id), JSON.stringify(body));\n"
"\n"
" TRI_CheckRequestResult(requestResult);\n"
"\n"
" return requestResult;\n"
"}\n"
"\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"/// @brief queries by example\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"\n"
"ArangoCollection.prototype.BY_EXAMPLE_HASH = function (index, example, skip, limit) {\n"
" var body;\n"
"\n"
" limit = limit || null;\n"
" skip = skip || null;\n"
"\n"
" if (index.hasOwnProperty(\"id\")) {\n"
" index = index.id;\n"
" }\n"
"\n"
" body = { collection : this._id, index : index, skip : skip, limit : limit, example : {} };\n"
"\n"
" for (var key in example) {\n"
" if (example.hasOwnProperty(key)) {\n"
" body.example[key] = example[key];\n"
" }\n"
" }\n"
"\n"
" var requestResult = this._database._connection.PUT(\"/_api/simple/BY-EXAMPLE-HASH\", JSON.stringify(body));\n"
"\n"
" TRI_CheckRequestResult(requestResult);\n"
"\n"
" return requestResult;\n"
"}\n"
"\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"/// @brief adds an geo index\n"
"////////////////////////////////////////////////////////////////////////////////\n"
"\n"