Sha256: 0eb262d86eddc6d8dd1817895b99f201336c02e1d006afcb5c6ea7f0c8a64bcf

Contents?: true

Size: 1.38 KB

Versions: 56

Compression:

Stored size: 1.38 KB

Contents

.. -*- 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 script

Usage
-----

You can execute any scripts which mruby supports by calling ``ruby_eval``.

Here is an example that just calculate ``1 + 2`` as Ruby script.

.. 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.

``script``
""""""""""

It specifies the Ruby script which you want to evaluate.

Return value
------------

``ruby_eval`` returns the evaluated result with metadata such as
exception information (Including metadata isn't implemented yet)::

  [HEADER, {"value": EVALUATED_VALUE}]

``HEADER``

  See :doc:`/reference/command/output_format` about ``HEADER``.

``EVALUATED_VALUE``

  ``EVALUATED_VALUE`` is the evaludated value of ``ruby_script``.

  ``ruby_eval`` supports only a number for evaluated value for now.
  Supported types will be increased in the future.

See also
--------

Version data entries

56 entries across 28 versions & 1 rubygems

Version Path
rroonga-5.0.0-x64-mingw32 vendor/local/share/doc/groonga/en/html/_sources/reference/commands/ruby_eval.txt
rroonga-5.0.0-x64-mingw32 vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/ruby_eval.txt
rroonga-5.0.0-x86-mingw32 vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/ruby_eval.txt
rroonga-5.0.0-x86-mingw32 vendor/local/share/doc/groonga/en/html/_sources/reference/commands/ruby_eval.txt
rroonga-4.0.8-x64-mingw32 vendor/local/share/doc/groonga/en/html/_sources/reference/commands/ruby_eval.txt
rroonga-4.0.8-x64-mingw32 vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/ruby_eval.txt
rroonga-4.0.8-x86-mingw32 vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/ruby_eval.txt
rroonga-4.0.8-x86-mingw32 vendor/local/share/doc/groonga/en/html/_sources/reference/commands/ruby_eval.txt
rroonga-4.0.7-x64-mingw32 vendor/local/share/doc/groonga/en/html/_sources/reference/commands/ruby_eval.txt
rroonga-4.0.7-x64-mingw32 vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/ruby_eval.txt
rroonga-4.0.7-x86-mingw32 vendor/local/share/doc/groonga/en/html/_sources/reference/commands/ruby_eval.txt
rroonga-4.0.7-x86-mingw32 vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/ruby_eval.txt
rroonga-4.0.6-x64-mingw32 vendor/local/share/doc/groonga/en/html/_sources/reference/commands/ruby_eval.txt
rroonga-4.0.6-x64-mingw32 vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/ruby_eval.txt
rroonga-4.0.6-x86-mingw32 vendor/local/share/doc/groonga/en/html/_sources/reference/commands/ruby_eval.txt
rroonga-4.0.6-x86-mingw32 vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/ruby_eval.txt
rroonga-4.0.5-x64-mingw32 vendor/local/share/doc/groonga/en/html/_sources/reference/commands/ruby_eval.txt
rroonga-4.0.5-x64-mingw32 vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/ruby_eval.txt
rroonga-4.0.5-x86-mingw32 vendor/local/share/doc/groonga/en/html/_sources/reference/commands/ruby_eval.txt
rroonga-4.0.5-x86-mingw32 vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/ruby_eval.txt