HAYASHI Kentaro
null+****@clear*****
Thu Sep 26 17:16:51 JST 2013
HAYASHI Kentaro 2013-09-26 17:16:51 +0900 (Thu, 26 Sep 2013) New Revision: 0d85181db324e89feecb3e88f4960f9a86d6c2bc https://github.com/groonga/groonga/commit/0d85181db324e89feecb3e88f4960f9a86d6c2bc Message: doc: add documentation about experimental ruby_eval command Added files: doc/source/example/reference/commands/ruby_eval/calc.log doc/source/reference/commands/ruby_eval.txt Added: doc/source/example/reference/commands/ruby_eval/calc.log (+6 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/ruby_eval/calc.log 2013-09-26 17:16:51 +0900 (35e2d13) @@ -0,0 +1,6 @@ +Execution example:: + + register ruby/eval + # [[0, 1337566253.89858, 0.000355720520019531], true] + ruby_eval "1 + 2" + # [[0, 1337566253.89858, 0.000355720520019531], {"value": 3}] Added: doc/source/reference/commands/ruby_eval.txt (+67 -0) 100644 =================================================================== --- /dev/null +++ doc/source/reference/commands/ruby_eval.txt 2013-09-26 17:16:51 +0900 (1b1f559) @@ -0,0 +1,67 @@ +.. -*- rst -*- + +.. highlightlang:: none + +.. groonga-command +.. database: commands_ruby_eval + +``ruby_eval`` +=============== + +Summary +------- + +``ruby_eval`` command evaluates ruby script and returns the result. + +Syntax +------ + +``ruby_eval`` has one required parameter:: + + ruby_eval ruby_script + +Usage +----- + +You can execute any scripts which mruby supports by calling ``ruby_eval``. + +Here is an example that just calculate ``1 + 2`` by mruby plugin. + +.. groonga-command +.. include:: ../../example/reference/commands/ruby_eval/calc.log +.. register ruby/eval +.. ruby_eval "1 + 2" + +Register ``ruby/eval`` plugin to use ``ruby_eval`` command in advance. + +Note that ``ruby_eval`` is implemented as an experimental plugin, +and the specification may be changed in the future. + +Parameters +---------- + +This section describes all parameters. + +``ruby_script`` +""""""""""""""" + +It specifies the ruby script which you want to evaluate. + +Return value +------------ + +``ruby_eval`` returns the evaluated result which key is "value" as json format:: + + [[HEADER, json]] + +``HEADER`` + + See :doc:`/reference/command/output_format` about ``HEADER``. + +``json`` + + The key of ``json`` is "value". The value of ``json`` must be a number. + +See also +-------- + -------------- next part -------------- HTML����������������������������... Descargar