Publish Ruby SDKs manually

View as Markdown

This guide covers publishing Ruby SDKs manually. For information on automating Ruby SDK publishing, see Publish Ruby SDKs automatically.

To share your generated Ruby SDK with the community, you can publish it to RubyGems. This enables other developers to easily install it using the gem install command. Follow the steps below to publish your SDK to RubyGems.

Publish your Ruby SDK to RubyGems

To publish your SDK to RubyGems, do the following:

  1. If you haven’t done so, create a RubyGems account:

    • Register at RubyGems.
    • Set up your API credentials:
    $gem push --help # This will prompt for credentials on first use
  2. Prepare your gem for publishing:

    $# Check code style
    $bundle exec rubocop
    $
    $# Build the gem
    $gem build your-sdk.gemspec

    This creates your-sdk-1.0.0.gem in the current directory.

  3. Validate the gem:

    $gem specification your-sdk-1.0.0.gem
  4. Publish to RubyGems:

    $gem push your-sdk-1.0.0.gem
  5. Verify publication:

    $gem install your-sdk
    $# Or visit: https://rubygems.org/gems/your-sdk

Publish updates

  1. Update the version in lib/your_sdk/version.rb:

    1module YourSdk
    2 VERSION = "1.0.1"
    3end
  2. Update CHANGELOG.md with changes.

  3. Build and publish:

    $gem build your-sdk.gemspec
    $gem push your-sdk-1.0.1.gem

Best practices for publishing Ruby SDKs

Use the following best practices when publishing your Ruby SDK to RubyGems:

  • Use semantic versioning (MAJOR.MINOR.PATCH).
  • Maintain a CHANGELOG.md documenting changes.
  • Use YARD documentation comments for API documentation.
  • Follow Ruby style guidelines (use RuboCop).
  • Pin major versions of dependencies in your gemspec.
  • Include metadata URLs in your gemspec for better discoverability.
  • Test your gem installation in a clean environment before publishing.