You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/products/sdks/overview/ruby/publishing-to-rubygems.mdx
+211-2Lines changed: 211 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,215 @@ title: Publishing to RubyGems
3
3
description: How to publish the Fern Ruby SDK to RubyGems.
4
4
---
5
5
6
-
Learn how to publish your Fern Ruby SDK to the RubyGems registry.
6
+
Publish your public-facing Fern Ruby SDK to the [RubyGems
7
+
registry](https://rubygems.org/). After following the steps on this page,
8
+
you'll have a versioned package published on RubyGems.
7
9
8
-
<Warning>This page is a WIP, please refer to our previous [documentation](https://buildwithfern.com/learn/sdks/guides/publish-a-public-facing-sdk).</Warning>
10
+
<Frame>
11
+
<imgsrc="assets/pypi-package.png"alt="Versioned package published on RubyGems" />
12
+
</Frame>
13
+
14
+
<Info>This guide assumes that you already have an initialized `fern` folder on your local machine. If you don’t, run `fern init`. See [ruby Quickstart](quickstart.mdx) for more details.</Info>
15
+
16
+
## Set up your GitHub integration
17
+
18
+
1. Create a new GitHub repository called `company-ruby` (or something similar) for your SDK, if you haven't done so already.
19
+
1. Install the [Fern GitHub App](https://github.com/apps/fern-api): Select **Configure**, then scroll down to **Repository Access**. Select **Only select repositories** and in the dropdown select the repository for your SDK. Click **Save**.
20
+
21
+
22
+
## Configure `generators.yml`
23
+
24
+
<Steps>
25
+
26
+
<Steptitle="Run `fern add <generator>`">
27
+
28
+
Navigate to your `generators.yml` on your local machine. Your `generators.yml` lives inside of your `fern` folder and contains all the configuration for your Fern generators.
29
+
30
+
Add a new generator to `generators.yml`:
31
+
32
+
33
+
```bash
34
+
fern add fern-ruby-sdk --group ruby-sdk
35
+
```
36
+
37
+
Once the command completes, you'll see a new group created in your `generators.yml`:
Next, change the output location in `generators.yml` from `local-file-system` (the default) to `pypi` to indicate that Fern should publish your package directly to the PyPI registry:
Your package name must be unique in the RubyGems repository, otherwise publishing your SDK to RubyGems will fail. Update your package name if you haven't done so already:
The `clientClassName` option controls the name of the generated client. This is the name customers use to import your SDK (`import { your-client-name } from 'your-package-name';`).
Add `api-key: ${RUBYGEMS_API_KEY}` to `generators.yml` to tell Fern to use the `RUBYGEMS_API_KEY` environment variable for authentication when publishing to the PyPI registry.
0 commit comments