Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Ruby converter #77

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update README to add Ruby
picandocodigo committed Feb 27, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit a585a474e2a55ea0e681cb5fef88c02a216c1472
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -79,8 +79,8 @@ const { convertRequests, listFormats } = require("@elastic/request-converter");

## Available Formats

At this time the converter supports `curl` and `python`. Work is currently in
progress to add support for `javascript`, `ruby` and `php`.
At this time the converter supports `curl`, `python`, `javascript` and `ruby`. Work is currently in
progress to add support for `php`.

### curl

@@ -107,6 +107,18 @@ Supported options:
| `complete` | `boolean` | no | If `true`, generate a complete script. If `false`, only generate the request code. The default is `false`. |
| `elasticsearchUrl` | `string` | no | The Elasticsearch endpoint to use. The default is `http://localhost:9200`. |

### ruby

The Ruby exporter generates code for the Elasticsearch Ruby client.

Supported options:

| Option name | Type | Required | Description |
| ----------- | ---- | -------- | ----------- |
| `printResponse` | `boolean` | no | If `true`, add code to print the response. The default is `false`. |
| `complete` | `boolean` | no | If `true`, generate a complete script. If `false`, only generate the request code. The default is `false`. |
| `elasticsearchUrl` | `string` | no | The Elasticsearch endpoint to use. The default is `http://localhost:9200`. |

## Command-Line Interface

For convenience, a CLI that wraps the `convertRequests` function is also available.