Home

Awesome

GridDB Ruby Client

Overview

GridDB Ruby Client is developed using GridDB C Client and SWIG (Simplified Wrapper and Interface Generator).

The new Ruby Client brings improved usability.

Main differences to the old Ruby Client are as follows:

Operating environment

Building of the library and execution of the sample programs have been checked in the following environment.

OS:              CentOS 6.9(x64)
SWIG:            3.0.12
GCC:             4.8.2
Ruby:            2.5.3
GridDB Server and C Client:   4.0 CE

QuickStart

Preparations

Install SWIG as below.

$ wget https://sourceforge.net/projects/pcre/files/pcre/8.39/pcre-8.39.tar.gz
$ tar xvfz pcre-8.39.tar.gz
$ cd pcre-8.39
$ ./configure
$ make
$ make install

$ wget https://prdownloads.sourceforge.net/swig/swig-3.0.12.tar.gz
$ tar xvfz swig-3.0.12.tar.gz
$ cd swig-3.0.12
$ ./configure
$ make
$ make install

Install Ruby and GridDB C Client.

If required, change INCLUDES_RUBY path in Makefile.

Set LIBRARY_PATH.

export LIBRARY_PATH=$LIBRARY_PATH:<C client library file directory path>

Build and Run

1. Execute the command on project directory.

$ make

2. Set the RUBYLIB variable for griddb griddb_ruby.so module files.

$ export RUBYLIB=<installed directory path>

How to run sample

GridDB Server need to be started in advance.

1. Set LD_LIBRARY_PATH

    export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:<C client library file directory path>

2. The command to run sample

    $ ruby sample/sample.rb <GridDB notification address> <GridDB notification port>
        <GridDB cluster name> <GridDB user> <GridDB password>
      -->['name01', false, 1, 'ABCDEFGHIJ' ]

Function

(available)

(not available)

Please refer to the following files for more detailed information.

Note:

  1. The current API might be changed in the next version. e.g. ContainerInfo()

Community

License

GridDB Ruby Client source license is Apache License, version 2.0.