Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/publish-gem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow is triggered when a GitHub release is created.
# It can also be run manually to re-publish to rubygems.org in case it failed for some reason.
# You can run this workflow by navigating to https://www.github.com/moderation-api/sdk-ruby/actions/workflows/publish-gem.yml
name: Publish Gem
on:
workflow_dispatch:

release:
types: [published]

jobs:
publish:
name: publish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: false
- run: |-
bundle install

- name: Publish to RubyGems.org
run: |
bash ./bin/publish-gem
env:
# `RUBYGEMS_HOST` is only required for private gem repositories, not https://rubygems.org
RUBYGEMS_HOST: ${{ secrets.MODERATION_API_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }}
GEM_HOST_API_KEY: ${{ secrets.MODERATION_API_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }}
22 changes: 22 additions & 0 deletions .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release Doctor
on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
release_doctor:
name: release doctor
runs-on: ubuntu-latest
if: github.repository == 'moderation-api/sdk-ruby' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v4

- name: Check release environment
run: |
bash ./bin/check-release-environment
env:
RUBYGEMS_HOST: ${{ secrets.MODERATION_API_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }}
GEM_HOST_API_KEY: ${{ secrets.MODERATION_API_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }}
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "2.0.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 27
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api%2Fmoderation-api-b71e4bef3bf1d91ff75dc3414d212613e5be0efb29b773ff12363814491fc604.yml
openapi_spec_hash: 261c3af6614314fbdd6ea3f7fb61979a
config_hash: f38dc79204f0ce87448d88959cebe94f
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api%2Fmoderation-api-00998c942fa9c81cb927833a3ebb681744bf59757610d9e6ce64ecf71ff2c13e.yml
openapi_spec_hash: 73a0d08c06aa948c82999fe0bca9a5e9
config_hash: d3a21c98941e21d1937472ca25c37abb
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Changelog

## 2.0.0 (2025-12-05)

Full Changelog: [v0.0.1...v2.0.0](https://github.com/moderation-api/sdk-ruby/compare/v0.0.1...v2.0.0)

### Features

* **api:** api update ([400d1cc](https://github.com/moderation-api/sdk-ruby/commit/400d1cc55e946cd047ebe6837c64e881f9796120))
* **api:** api update ([34ddc34](https://github.com/moderation-api/sdk-ruby/commit/34ddc3478338af0c07107d739c570bd0cb688215))
* **api:** api update ([7b0c383](https://github.com/moderation-api/sdk-ruby/commit/7b0c38363370d29eeacc1a5e6cecb909c0b16353))
* **api:** manual updates ([aa5e0e6](https://github.com/moderation-api/sdk-ruby/commit/aa5e0e6d3afd7be708d96205d2748a40845b7931))
* **api:** manual updates ([c38719d](https://github.com/moderation-api/sdk-ruby/commit/c38719de057b770b675e67383cc4e5fac1973a9c))
* **api:** manual updates ([e304765](https://github.com/moderation-api/sdk-ruby/commit/e304765ec2028a345bcc3e860f1e7f53ffb30a58))
* **api:** manual updates ([2e5bc4c](https://github.com/moderation-api/sdk-ruby/commit/2e5bc4cfc267ccdfe6d26a9873409856d01ddc5d))
* **api:** manual updates ([667a0b8](https://github.com/moderation-api/sdk-ruby/commit/667a0b81c42ac2f4fd04035386dedf0cf67380ea))
* **api:** manual updates ([ed95ed4](https://github.com/moderation-api/sdk-ruby/commit/ed95ed44d04677ce0699a00d9bfedca7b1a1db8f))
* **api:** manual updates ([495a03b](https://github.com/moderation-api/sdk-ruby/commit/495a03b50318611091d581c0ef3892c44883e391))
* **api:** manual updates ([a17bf98](https://github.com/moderation-api/sdk-ruby/commit/a17bf98e0d126505db304b1d316812a42ccd2a81))
* **api:** manual updates ([f20d9aa](https://github.com/moderation-api/sdk-ruby/commit/f20d9aaa79b9d5b043a07bcc133bbdcd930c25c7))
* **api:** manual updates ([6dc2d9d](https://github.com/moderation-api/sdk-ruby/commit/6dc2d9d4c46a7b4c0fed2a5e2b5821c951e5ccdf))
* **api:** removed deprecated moderate endpoints ([5b163bc](https://github.com/moderation-api/sdk-ruby/commit/5b163bc4faf3fc881ea176aef9c58cef265943fe))


### Chores

* configure new SDK language ([22d6295](https://github.com/moderation-api/sdk-ruby/commit/22d6295c55898708f8e39df213365f37ad17f075))
* update SDK settings ([492eccb](https://github.com/moderation-api/sdk-ruby/commit/492eccbceb612aef715d3f9c295882c1e5bd5961))
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ If you’d like to use the repository from source, you can either install from g
To install via git in your `Gemfile`:

```ruby
gem "moderation-api", git: "https://www.github.com/stainless-sdks/moderation-api-ruby"
gem "moderation_api", git: "https://www.github.com/moderation-api/sdk-ruby"
```

Alternatively, reference local copy of the repo:

```bash
$ git clone -- 'https://www.github.com/stainless-sdks/moderation-api-ruby' '<path-to-repo>'
$ git clone -- 'https://www.github.com/moderation-api/sdk-ruby' '<path-to-repo>'
```

```ruby
gem "moderation-api", path: "<path-to-repo>"
gem "moderation_api", path: "<path-to-repo>"
```

## Running commands
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
moderation-api (0.0.1)
moderation_api (2.0.0)
connection_pool

GEM
Expand Down Expand Up @@ -208,7 +208,7 @@ DEPENDENCIES
minitest-hooks
minitest-proveit
minitest-rg
moderation-api!
moderation_api!
rake
rbs
redcarpet
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
# Moderation API Ruby API library

The Moderation API Ruby library provides convenient access to the Moderation API REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/stainless-sdks/moderation-api-ruby#Sorbet) for usage with Sorbet. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.
The Moderation API Ruby library provides convenient access to the Moderation API REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/moderation-api/sdk-ruby#Sorbet) for usage with Sorbet. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.

It is generated with [Stainless](https://www.stainless.com/).

## Documentation

Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/moderation-api).
Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/moderation_api).

The REST API documentation can be found on [docs.moderationapi.com](https://docs.moderationapi.com).

## Installation

To use this gem, install via Bundler by adding the following to your application's `Gemfile`:

<!-- x-release-please-start-version -->

```ruby
gem "moderation-api", "~> 0.0.1"
gem "moderation_api", "~> 2.0.0"
```

<!-- x-release-please-end -->

## Usage

```ruby
Expand Down Expand Up @@ -230,4 +234,4 @@ Ruby 3.2.0 or higher.

## Contributing

See [the contributing documentation](https://github.com/stainless-sdks/moderation-api-ruby/tree/main/CONTRIBUTING.md).
See [the contributing documentation](https://github.com/moderation-api/sdk-ruby/tree/main/CONTRIBUTING.md).
21 changes: 21 additions & 0 deletions bin/check-release-environment
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

errors=()

if [ -z "${GEM_HOST_API_KEY}" ]; then
errors+=("The GEM_HOST_API_KEY secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi

lenErrors=${#errors[@]}

if [[ lenErrors -gt 0 ]]; then
echo -e "Found the following errors in the release environment:\n"

for error in "${errors[@]}"; do
echo -e "- $error\n"
done

exit 1
fi

echo "The environment is ready to push releases!"
Loading