Ruby configuration

View as Markdown

You can customize the behavior of the Ruby SDK generator in generators.yml:

generators.yml
1groups:
2 ruby-sdk:
3 generators:
4 - name: fernapi/fern-ruby-sdk
5 version: 1.0.0-rc85
6 config:
7 module: YourModuleName
8 enableWireTests: true
9 extraDependencies:
10 faraday: "~> 2.0"
11 oj: "~> 3.0"
12 extraDevDependencies:
13 rspec: "~> 3.0"
14 webmock: "~> 3.0"
clientModuleName
string

Custom name for the client module. This allows you to customize the module name that wraps the generated client class.

customPagerName
string

Custom name for the pager class used in paginated endpoints. By default, the generator creates a standard pager class, but you can customize its name to match your SDK’s naming conventions.

customReadmeSections
array of objects

Add custom sections to the generated README file. Each section requires a title and content.

1config:
2 customReadmeSections:
3 - title: "Custom integration"
4 content: "Instructions for custom integration..."
5 - title: "Advanced usage"
6 content: "Advanced usage examples for {{ packageName }}"

The content supports template variables like {{ packageName }} that are replaced with actual values during generation.

enableWireTests
booleanDefaults to false

When enabled, generates mock server (wire) tests to verify that the SDK sends and receives HTTP requests as expected.

extraDependencies
object
Pro and Enterprise feature

This feature is available only for the Pro and Enterprise plans. To get started, reach out to support@buildwithfern.com.

Specify additional dependencies to include in the generated SDK’s gemspec. This is useful when you need to add custom gems that your SDK depends on.

extraDevDependencies
object
Pro and Enterprise feature

This feature is available only for the Pro and Enterprise plans. To get started, reach out to support@buildwithfern.com.

Specify additional development dependencies to include in the generated SDK’s Gemfile. These are dependencies used for development and testing but not required by end users.

module
string

Custom module name for the generated SDK. This sets the top-level Ruby module that wraps all generated code. By default, the module name is derived from the package name in your publish configuration or your organization name.

1config:
2 module: MyCustomModule

This generates code like:

1module MyCustomModule
2 class Client
3 # ...
4 end
5end
requirePaths
array of strings
Pro and Enterprise feature

This feature is available only for the Pro and Enterprise plans. To get started, reach out to support@buildwithfern.com.

Paths to files that will be auto-loaded when the gem is required. This is useful for including custom integrations or extensions that should be loaded automatically.

1config:
2 requirePaths:
3 - custom_integration
4 - sentry_integration

This will load lib/<gem>/custom_integration.rb and lib/<gem>/sentry_integration.rb when the gem is required.