Skip to content

fix(ruby): separate packageName from moduleName in ruby-v2 generator#11857

Merged
fern-support merged 5 commits intomainfrom
devin/1769576130-fix-ruby-v2-packagename-modulename
Jan 28, 2026
Merged

fix(ruby): separate packageName from moduleName in ruby-v2 generator#11857
fern-support merged 5 commits intomainfrom
devin/1769576130-fix-ruby-v2-packagename-modulename

Conversation

@jsklan
Copy link
Copy Markdown
Contributor

@jsklan jsklan commented Jan 28, 2026

Description

Refs: #11567

Fixes a regression introduced in PR #11567 where packageName from publish config was incorrectly being used for folder/module naming in addition to the gemspec name. This broke existing SDKs like Square by:

  • Changing folder structure (e.g., lib/square_rb/ instead of lib/square/)
  • Normalizing the gemspec name (e.g., square_rb instead of square.rb)

Changes Made

  • Removed packageName from the fallback chain in getRootFolderName() and getRootModuleName() - these now only use customConfig.moduleName or organization name
  • Added new getGemName() method that returns packageName directly (without normalization) for the gemspec spec.name field
  • Updated gemspec generation to use getGemName() instead of getRootFolderName() for the gem name
  • Renamed custom config field from module to moduleName for clarity in BaseRubyCustomConfigSchema.ts
  • Updated all references in AbstractRubyGeneratorContext.ts and DynamicSnippetsGeneratorContext.ts
  • Added custom rubySnakeCase() function that preserves letter-digit sequences (e.g., "auth0" stays "auth0", not "auth_0")
  • Added changelog entry for version 1.0.0-rc83

Updates since last revision

  • Added fix for organization names with digits (e.g., "auth0") being incorrectly transformed to "auth_0"
  • Replaced lodash's snakeCase with custom rubySnakeCase function that doesn't treat letter-to-number transitions as word boundaries
  • Examples: "auth0" → "auth0", "OAuth2" → "oauth2", "MyCompany" → "my_company"

Testing

  • Lint checks pass (pnpm run check)
  • TypeScript compilation passes
  • CI seed tests pass

Human Review Checklist

  • Verify the separation of packageName (gemspec only) from folder/module naming is correct
  • Confirm this restores the expected behavior for SDKs like Square
  • Breaking change: The custom config field was renamed from module to moduleName - verify this is acceptable or if backward compatibility is needed
  • Verify the custom rubySnakeCase function handles edge cases correctly (consecutive uppercase like "AWS" → "aws", mixed like "HTTPServer" → "http_server")
  • Consider if any seed test fixtures should be updated to validate the auth0 edge case

Link to Devin run
Requested by: @jsklan

Co-Authored-By: judah@buildwithfern.com <jsklan.development@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Co-Authored-By: judah@buildwithfern.com <jsklan.development@gmail.com>
devin-ai-integration bot and others added 3 commits January 28, 2026 13:03
…ansformation

Co-Authored-By: judah@buildwithfern.com <jsklan.development@gmail.com>
Update changelog entry to fix organization name transformation.
@fern-support fern-support merged commit b5cd7ee into main Jan 28, 2026
119 checks passed
@fern-support fern-support deleted the devin/1769576130-fix-ruby-v2-packagename-modulename branch January 28, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants