File: ruby_load.rst

package info (click to toggle)
groonga 9.0.0-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 101,496 kB
  • sloc: ansic: 608,707; ruby: 35,042; xml: 23,643; cpp: 10,319; sh: 7,453; yacc: 5,968; python: 3,033; makefile: 2,609; perl: 133
file content (71 lines) | stat: -rw-r--r-- 1,409 bytes parent folder | download | duplicates (5)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.. -*- rst -*-

.. highlightlang:: none

.. groonga-command
.. database: commands_ruby_load

``ruby_load``
=============

Summary
-------

``ruby_load`` command loads specified Ruby script.

Syntax
------

This command takes only one required parameter::

  ruby_load path

Usage
-----

You can load any script file which mruby supports by calling ``ruby_load``.

Here is an example that just load ``expression.rb`` as Ruby script.

.. groonga-command
.. include:: ../../example/reference/commands/ruby_load/load.log
.. plugin_register ruby/load
.. ruby_load "expression.rb"

Register ``ruby/load`` plugin to use ``ruby_load`` command in advance.

Note that ``ruby_load`` is implemented as an experimental plugin,
and the specification may be changed in the future.

Parameters
----------

This section describes all parameters.

``path``
""""""""

Specifies the Ruby script path which you want to load.

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

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

  [HEADER, {"value": LOADED_VALUE}]

``HEADER``

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

``LOADED_VALUE``

  ``LOADED_VALUE`` is the loaded value of ruby script.

  ``ruby_load`` just return ``null`` as ``LOADED_VALUE`` for now, it will be supported in the future.

See also
--------

:doc:`/reference/commands/ruby_eval`