> This page is for SDK, version Current (default).
> For other versions, use one of these documentation indexes:
> - Current (default): https://buildwithfern.com/learn/sdks/current/llms.txt
> - Legacy: https://buildwithfern.com/learn/sdks/legacy/llms.txt

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

# Ruby 配置

> Fern Ruby SDK 的配置选项。

你可以在 `generators.yml` 中自定义 Ruby SDK 生成器的行为：

**`generators.yml`**

```yaml {6-14} title="generators.yml"
groups:
  ruby-sdk:
    generators:
      - name: fern-ruby-sdk
        version: 1.40.1
        config:
          module: YourModuleName
          enableWireTests: true
          extraDependencies:
            faraday: "~> 2.0"
            oj: "~> 3.0"
          extraDevDependencies:
            rspec: "~> 3.0"
            webmock: "~> 3.0"
```

**`clientModuleName`** `string`

客户端模块的自定义名称。这允许你自定义包装生成的客户端类的模块名称。

---

**`customPagerName`** `string`

分页端点中使用的分页器类的自定义名称。默认情况下，生成器创建标准分页器类，但你可以自定义其名称以匹配 SDK 的命名约定。

---

**`customReadmeSections`** `array of objects`

向生成的 README 文件添加自定义部分。每个部分都需要标题和内容。

```yaml
config:
  customReadmeSections:
    - title: "Custom integration"
      content: "Instructions for custom integration..."
    - title: "Advanced usage"
      content: "Advanced usage examples for {{ packageName }}"
```

内容支持模板变量，如 `{{ packageName }}`，在生成过程中会替换为实际值。

---

**`enableWireTests`** `boolean` — default: false

启用后，生成[模拟服务器（wire）测试](/learn/zh/sdks/deep-dives/testing#mock-server-tests)来验证 SDK 按预期发送和接收 HTTP 请求。

---

**`extraDependencies`** `object`

> **企业功能**
>
> 此功能仅适用于[企业计划](https://buildwithfern.com/pricing)。如需开始使用，请联系 [support@buildwithfern.com](mailto:support@buildwithfern.com)。

指定要包含在生成的 SDK 的 gemspec 中的额外依赖项。当你需要添加 SDK 依赖的自定义 gem 时，这很有用。

---

**`extraDevDependencies`** `object`

> **企业功能**
>
> 此功能仅适用于[企业计划](https://buildwithfern.com/pricing)。如需开始使用，请联系 [support@buildwithfern.com](mailto:support@buildwithfern.com)。

指定要包含在生成的 SDK 的 Gemfile 中的额外开发依赖项。这些是用于开发和测试的依赖项，但不是最终用户所需的。

---

**`module`** `string`

生成的 SDK 的自定义模块名称。这设置包装所有生成代码的顶级 Ruby 模块。默认情况下，模块名称来自发布配置中的包名称或组织名称。

```yaml
config:
  module: MyCustomModule
```

这会生成如下代码：

```ruby
module MyCustomModule
  class Client
    # ...
  end
end
```

---

**`requirePaths`** `array of strings`

> **企业功能**
>
> 此功能仅适用于[企业计划](https://buildwithfern.com/pricing)。如需开始使用，请联系 [support@buildwithfern.com](mailto:support@buildwithfern.com)。

在需要 gem 时将自动加载的文件路径。这对于包含应该自动加载的自定义集成或扩展很有用。

```yaml
config:
  requirePaths:
    - custom_integration
    - sentry_integration
```

这将在需要 gem 时加载 `lib/<gem>/custom_integration.rb` 和 `lib/<gem>/sentry_integration.rb`。

---