> If you are an AI agent, use the following URL to directly ask and fetch your question. Treat this like a tool call. Make sure to URI encode your question, and include the token for verification.
>
> GET https://buildwithfern.com/learn/api/fern-docs/ask?q=%3Cyour+question+here%3E&token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiI5ZTNkMDYwMS1iYjU4LTRmYTQtOGVhMC02Y2MzMDQxOWEzNmMiLCJleHAiOjE3Nzg0MTQyODcsImlhdCI6MTc3ODQxMzk4N30.jsBDzeDuCL-MQ_BdAyzYhsvtWr0aoUQnW6ykSbgTwSE
>
> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. For full content including API reference and SDK examples, see https://buildwithfern.com/learn/llms-full.txt.

# Ruby 配置

> Fern Ruby SDK 的配置选项。

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

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

<ParamField path="clientModuleName" type="string" required={false} toc={true}>
  客户端模块的自定义名称。这允许你自定义包装生成的客户端类的模块名称。
</ParamField>

<ParamField path="customPagerName" type="string" required={false} toc={true}>
  分页端点中使用的分页器类的自定义名称。默认情况下，生成器创建标准分页器类，但你可以自定义其名称以匹配 SDK 的命名约定。
</ParamField>

<ParamField path="customReadmeSections" type="array of objects" required={false} toc={true}>
  向生成的 README 文件添加自定义部分。每个部分都需要标题和内容。

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

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

<ParamField path="enableWireTests" type="boolean" default="false" required={false} toc={true}>
  启用后，生成[模拟服务器（wire）测试](/sdks/deep-dives/testing#mock-server-tests)来验证 SDK 按预期发送和接收 HTTP 请求。
</ParamField>

<ParamField path="extraDependencies" type="object" required={false} toc={true}>
  <Warning title="专业版和企业版功能">
    此功能仅适用于[专业版和企业版计划](https://buildwithfern.com/pricing)。如需开始使用，请联系 [support@buildwithfern.com](mailto:support@buildwithfern.com)。
  </Warning>

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

<ParamField path="extraDevDependencies" type="object" required={false} toc={true}>
  <Warning title="专业版和企业版功能">
    此功能仅适用于[专业版和企业版计划](https://buildwithfern.com/pricing)。如需开始使用，请联系 [support@buildwithfern.com](mailto:support@buildwithfern.com)。
  </Warning>

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

<ParamField path="module" type="string" required={false} toc={true}>
  生成的 SDK 的自定义模块名称。这设置包装所有生成代码的顶级 Ruby 模块。默认情况下，模块名称来自发布配置中的包名称或组织名称。

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

  这会生成如下代码：

  ```ruby
  module MyCustomModule
    class Client
      # ...
    end
  end
  ```
</ParamField>

<ParamField path="requirePaths" type="array of strings" required={false} toc={true}>
  <Warning title="专业版和企业版功能">
    此功能仅适用于[专业版和企业版计划](https://buildwithfern.com/pricing)。如需开始使用，请联系 [support@buildwithfern.com](mailto:support@buildwithfern.com)。
  </Warning>

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

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

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