Skip to content
Open
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/ScrapeGraphAI/scrapegraphai-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.SCRAPEGRAPHAI_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }}
GEM_HOST_API_KEY: ${{ secrets.SCRAPEGRAPHAI_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 == 'ScrapeGraphAI/scrapegraphai-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.SCRAPEGRAPHAI_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }}
GEM_HOST_API_KEY: ${{ secrets.SCRAPEGRAPHAI_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 @@
{
".": "0.1.0"
}
5 changes: 3 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=https://www.rubyschema.org/rubocop.json
---
# Explicitly disable pending cops for now. This is the default behaviour but
# this avoids a large warning every time we run it.
Expand All @@ -8,7 +9,7 @@ AllCops:
- "bin/*"
NewCops: enable
SuggestExtensions: false
TargetRubyVersion: 3.2.0
TargetRubyVersion: 3.2

# Whether MFA is required or not should be left to the token configuration.
Gemspec/RequireMFA:
Expand Down Expand Up @@ -149,7 +150,7 @@ Naming/ClassAndModuleCamelCase:
Naming/MethodParameterName:
Enabled: false

Naming/PredicateName:
Naming/PredicatePrefix:
Exclude:
- "**/*.rbi"

Expand Down
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 15
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/scrapegraphai%2Fscrapegraphai-969ebada41127057e4cda129b2e7206224743b5c7fd33aa8ae062ff71b775ac9.yml
openapi_spec_hash: 2b2c2c684e6f6885398efca5f2b1f854
config_hash: 30d69c79e34a1ea6a0405573ce30d927
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/scrapegraphai%2Fscrapegraphai-633fdeab6abaefbe666099e8f86ce6b2acc9dacff1c33a80813bb04e8e437229.yml
openapi_spec_hash: f41ec90694ca8e7233bd20cc7ff1afbf
config_hash: 6889576ba0fdc14f2c71cea09a60a0f6
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Changelog

## 0.1.0 (2025-08-25)

Full Changelog: [v0.0.1...v0.1.0](https://github.com/ScrapeGraphAI/scrapegraphai-ruby/compare/v0.0.1...v0.1.0)

### Features

* add files ([38693c7](https://github.com/ScrapeGraphAI/scrapegraphai-ruby/commit/38693c7bfbbb685cb67bd5608077160cfec2449b))
* **api:** update via SDK Studio ([f4212bc](https://github.com/ScrapeGraphAI/scrapegraphai-ruby/commit/f4212bc58fa4fc50bcb4e82c309ebe66856403bf))


### Bug Fixes

* bump sorbet version and fix new type errors from the breaking change ([5eac2d1](https://github.com/ScrapeGraphAI/scrapegraphai-ruby/commit/5eac2d183e1e82671df34e23af49d79794937575))


### Chores

* add json schema comment for rubocop.yml ([69c97ad](https://github.com/ScrapeGraphAI/scrapegraphai-ruby/commit/69c97add2b0d8b3719eb93ee1efd2941bb2a3013))
* configure new SDK language ([fb2515a](https://github.com/ScrapeGraphAI/scrapegraphai-ruby/commit/fb2515a6c3f6b1a96c9660246a9fac6ff8887826))
* update SDK settings ([feb82d3](https://github.com/ScrapeGraphAI/scrapegraphai-ruby/commit/feb82d35c7ad0a00c2425c19bf642c25572607e2))
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ 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 "scrapegraphai", git: "https://www.github.com/stainless-sdks/scrapegraphai-ruby"
gem "scrapegraphai", git: "https://www.github.com/ScrapeGraphAI/scrapegraphai-ruby"
```

Alternatively, reference local copy of the repo:

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

```ruby
Expand Down
90 changes: 52 additions & 38 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ GIT
PATH
remote: .
specs:
scrapegraphai (0.0.1)
scrapegraphai (0.1.0)
connection_pool

GEM
remote: https://rubygems.org/
specs:
activesupport (8.0.2)
activesupport (8.0.2.1)
base64
benchmark (>= 0.3)
bigdecimal
Expand All @@ -33,45 +33,50 @@ GEM
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
ast (2.4.3)
async (2.24.0)
async (2.27.3)
console (~> 1.29)
fiber-annotation
io-event (~> 1.9)
io-event (~> 1.11)
metrics (~> 0.12)
traces (~> 0.15)
base64 (0.2.0)
benchmark (0.4.0)
bigdecimal (3.1.9)
base64 (0.3.0)
benchmark (0.4.1)
bigdecimal (3.2.2)
concurrent-ruby (1.3.5)
connection_pool (2.5.3)
console (1.30.2)
console (1.33.0)
fiber-annotation
fiber-local (~> 1.1)
json
crack (1.0.0)
bigdecimal
rexml
csv (3.3.4)
drb (2.2.1)
csv (3.3.5)
drb (2.2.3)
erubi (1.13.1)
ffi (1.17.2-aarch64-linux-gnu)
ffi (1.17.2-aarch64-linux-musl)
ffi (1.17.2-arm64-darwin)
ffi (1.17.2-x86_64-darwin)
ffi (1.17.2-x86_64-linux-gnu)
ffi (1.17.2-x86_64-linux-musl)
fiber-annotation (0.2.0)
fiber-local (1.1.0)
fiber-storage
fiber-storage (1.0.1)
fileutils (1.7.3)
hashdiff (1.1.2)
hashdiff (1.2.0)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
io-event (1.10.0)
json (2.11.3)
language_server-protocol (3.17.0.4)
io-event (1.11.2)
json (2.13.2)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.7.0)
metrics (0.12.2)
metrics (0.13.0)
minitest (5.25.5)
minitest-focus (1.4.0)
minitest (>= 4, < 6)
Expand All @@ -84,54 +89,56 @@ GEM
mutex_m (0.3.0)
netrc (0.11.0)
parallel (1.27.0)
parser (3.3.8.0)
parser (3.3.9.0)
ast (~> 2.4.1)
racc
prettier_print (1.2.1)
prism (1.4.0)
public_suffix (6.0.2)
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
rake (13.3.0)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rbi (0.3.2)
rbi (0.3.6)
prism (~> 1.0)
rbs (>= 3.4.4)
sorbet-runtime (>= 0.5.9204)
rbs (3.9.2)
rbs (3.9.4)
logger
redcarpet (3.6.1)
regexp_parser (2.10.0)
regexp_parser (2.11.2)
rexml (3.4.1)
rubocop (1.75.5)
rubocop (1.79.2)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.44.0, < 2.0)
rubocop-ast (>= 1.46.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.44.1)
rubocop-ast (1.46.0)
parser (>= 3.3.7.2)
prism (~> 1.4)
ruby-progressbar (1.13.0)
securerandom (0.4.1)
sorbet (0.5.12067)
sorbet-static (= 0.5.12067)
sorbet-runtime (0.5.12067)
sorbet-static (0.5.12067-x86_64-linux)
sorbet-static-and-runtime (0.5.12067)
sorbet (= 0.5.12067)
sorbet-runtime (= 0.5.12067)
spoom (1.6.1)
sorbet (0.5.12424)
sorbet-static (= 0.5.12424)
sorbet-runtime (0.5.12424)
sorbet-static (0.5.12424-aarch64-linux)
sorbet-static (0.5.12424-universal-darwin)
sorbet-static (0.5.12424-x86_64-linux)
sorbet-static-and-runtime (0.5.12424)
sorbet (= 0.5.12424)
sorbet-runtime (= 0.5.12424)
spoom (1.6.3)
erubi (>= 1.10.0)
prism (>= 0.28.0)
rbi (>= 0.2.3)
rbi (>= 0.3.3)
rexml (>= 3.2.6)
sorbet-static-and-runtime (>= 0.5.10187)
thor (>= 0.19.2)
steep (1.10.0)
Expand All @@ -152,7 +159,7 @@ GEM
terminal-table (>= 2, < 5)
uri (>= 0.12.0)
strscan (3.1.5)
syntax_tree (6.2.0)
syntax_tree (6.3.0)
prettier_print (>= 1.2.0)
tapioca (0.16.11)
benchmark
Expand All @@ -166,11 +173,11 @@ GEM
yard-sorbet
terminal-table (4.0.0)
unicode-display_width (>= 1.1.1, < 4)
thor (1.3.2)
traces (0.15.2)
thor (1.4.0)
traces (0.17.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (3.1.4)
unicode-display_width (3.1.5)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
uri (1.0.3)
Expand All @@ -185,7 +192,14 @@ GEM
yard

PLATFORMS
x86_64-linux
aarch64-linux
aarch64-linux-gnu
aarch64-linux-musl
arm64-darwin
universal-darwin
x86_64-darwin
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
async
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Scrapegraphai Ruby API library

The Scrapegraphai Ruby library provides convenient access to the Scrapegraphai 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/scrapegraphai-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 Scrapegraphai Ruby library provides convenient access to the Scrapegraphai 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/ScrapeGraphAI/scrapegraphai-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/).

Expand All @@ -14,10 +14,14 @@ The REST API documentation can be found on [scrapegraphai.com](https://scrapegra

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

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

```ruby
gem "scrapegraphai", "~> 0.0.1"
gem "scrapegraphai", "~> 0.1.0"
```

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

## Usage

```ruby
Expand Down Expand Up @@ -235,4 +239,4 @@ Ruby 3.2.0 or higher.

## Contributing

See [the contributing documentation](https://github.com/stainless-sdks/scrapegraphai-ruby/tree/main/CONTRIBUTING.md).
See [the contributing documentation](https://github.com/ScrapeGraphAI/scrapegraphai-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!"
5 changes: 1 addition & 4 deletions lib/scrapegraphai/internal/transport/base_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,7 @@ def initialize(
# @return [Array(Integer, Net::HTTPResponse, Enumerable<String>)]
def send_request(request, redirect_count:, retry_count:, send_retry_header:)
url, headers, max_retries, timeout = request.fetch_values(:url, :headers, :max_retries, :timeout)
input = {
**request.except(:timeout),
deadline: Scrapegraphai::Internal::Util.monotonic_secs + timeout
}
input = {**request.except(:timeout), deadline: Scrapegraphai::Internal::Util.monotonic_secs + timeout}

if send_retry_header
headers["x-stainless-retry-count"] = retry_count.to_s
Expand Down
Loading
Loading