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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.2.0"
".": "4.2.1"
}
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 4.2.1 (2026-02-19)

Full Changelog: [v4.2.0...v4.2.1](https://github.com/imagekit-developer/imagekit-ruby/compare/v4.2.0...v4.2.1)

### Bug Fixes

* **client:** always add content-length to post body, even when empty ([e156b70](https://github.com/imagekit-developer/imagekit-ruby/commit/e156b70c82c9b38de49307218fb3f687f651aa5b))
* **client:** loosen json header parsing ([9fc1fc6](https://github.com/imagekit-developer/imagekit-ruby/commit/9fc1fc60c60173f92f1f99fabe38f9ec826d940d))


### Chores

* **docs:** remove www prefix ([a4b9610](https://github.com/imagekit-developer/imagekit-ruby/commit/a4b961058ac8967dcfef109421dbca9ee3eedf0b))
* **internal:** remove mock server code ([c8aa3b8](https://github.com/imagekit-developer/imagekit-ruby/commit/c8aa3b8c2320102d8e29941f78f1f1ade06cab00))
* update mock server docs ([1e5ed9e](https://github.com/imagekit-developer/imagekit-ruby/commit/1e5ed9ea31388b76995c292fc22f9ed773ad6f40))

## 4.2.0 (2026-02-02)

Full Changelog: [v4.1.2...v4.2.0](https://github.com/imagekit-developer/imagekit-ruby/compare/v4.1.2...v4.2.0)
Expand Down
10 changes: 2 additions & 8 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 "imagekitio", git: "https://www.github.com/imagekit-developer/imagekit-ruby"
gem "imagekitio", git: "https://github.com/imagekit-developer/imagekit-ruby"
```

Alternatively, reference local copy of the repo:

```bash
$ git clone -- 'https://www.github.com/imagekit-developer/imagekit-ruby' '<path-to-repo>'
$ git clone -- 'https://github.com/imagekit-developer/imagekit-ruby' '<path-to-repo>'
```

```ruby
Expand All @@ -66,12 +66,6 @@ $ bundle exec rake

## Running tests

Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.

```bash
$ npx prism mock path/to/your/openapi.yml
```

```bash
$ bundle exec rake test
```
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
imagekitio (4.2.0)
imagekitio (4.2.1)
cgi
connection_pool

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "imagekitio", "~> 4.2.0"
gem "imagekitio", "~> 4.2.1"
```

<!-- x-release-please-end -->
Expand Down
2 changes: 1 addition & 1 deletion lib/imagekitio/internal/transport/pooled_net_requester.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def build_request(request, &blk)

case body
in nil
nil
req["content-length"] ||= 0 unless req["transfer-encoding"]
in String
req["content-length"] ||= body.bytesize.to_s unless req["transfer-encoding"]
req.body_stream = Imagekitio::Internal::Util::ReadIOAdapter.new(body, &blk)
Expand Down
2 changes: 1 addition & 1 deletion lib/imagekitio/internal/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ def writable_enum(&blk)
end

# @type [Regexp]
JSON_CONTENT = %r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)}
JSON_CONTENT = %r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)}
# @type [Regexp]
JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}

Expand Down
2 changes: 1 addition & 1 deletion lib/imagekitio/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Imagekitio
VERSION = "4.2.0"
VERSION = "4.2.1"
end
2 changes: 1 addition & 1 deletion rbi/imagekitio/internal/util.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ module Imagekitio
end

JSON_CONTENT =
T.let(%r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)}, Regexp)
T.let(%r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)}, Regexp)
JSONL_CONTENT =
T.let(%r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}, Regexp)

Expand Down
41 changes: 0 additions & 41 deletions scripts/mock

This file was deleted.

46 changes: 0 additions & 46 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,7 @@ set -e

cd -- "$(dirname -- "$0")/.."

RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color

function prism_is_running() {
curl --silent "http://localhost:4010" >/dev/null 2>&1
}

kill_server_on_port() {
pids=$(lsof -t -i tcp:"$1" || echo "")
if [ "$pids" != "" ]; then
kill "$pids"
echo "Stopped $pids."
fi
}

function is_overriding_api_base_url() {
[ -n "$TEST_API_BASE_URL" ]
}

if ! is_overriding_api_base_url && ! prism_is_running ; then
# When we exit this script, make sure to kill the background mock server process
trap 'kill_server_on_port 4010' EXIT

# Start the dev server
./scripts/mock --daemon
fi

if is_overriding_api_base_url ; then
echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"
echo
elif ! prism_is_running ; then
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server"
echo -e "running against your OpenAPI spec."
echo
echo -e "To run the server, pass in the path or url of your OpenAPI"
echo -e "spec to the prism command:"
echo
echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}"
echo

exit 1
else
echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}"
echo
fi

echo "==> Running tests"
bundle exec rake test "$@"
2 changes: 2 additions & 0 deletions test/imagekitio/internal/util_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ def test_json_content
cases = {
"application/json" => true,
"application/jsonl" => false,
"application/arbitrary+json" => true,
"application/ARBITRARY+json" => true,
"application/vnd.github.v3+json" => true,
"application/vnd.api+json" => true
}
Expand Down
10 changes: 5 additions & 5 deletions test/imagekitio/resources/accounts/origins_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class Imagekitio::Test::Resources::Accounts::OriginsTest < Imagekitio::Test::ResourceTest
def test_create_required_params
skip("Prism tests are disabled")
skip("Mock server tests are disabled")

response =
@image_kit.accounts.origins.create(
Expand Down Expand Up @@ -114,7 +114,7 @@ def test_create_required_params
end

def test_update_required_params
skip("Prism tests are disabled")
skip("Mock server tests are disabled")

response =
@image_kit.accounts.origins.update(
Expand Down Expand Up @@ -225,7 +225,7 @@ def test_update_required_params
end

def test_list
skip("Prism tests are disabled")
skip("Mock server tests are disabled")

response = @image_kit.accounts.origins.list

Expand All @@ -235,7 +235,7 @@ def test_list
end

def test_delete
skip("Prism tests are disabled")
skip("Mock server tests are disabled")

response = @image_kit.accounts.origins.delete("id")

Expand All @@ -245,7 +245,7 @@ def test_delete
end

def test_get
skip("Prism tests are disabled")
skip("Mock server tests are disabled")

response = @image_kit.accounts.origins.get("id")

Expand Down
10 changes: 5 additions & 5 deletions test/imagekitio/resources/accounts/url_endpoints_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class Imagekitio::Test::Resources::Accounts::URLEndpointsTest < Imagekitio::Test::ResourceTest
def test_create_required_params
skip("Prism tests are disabled")
skip("Mock server tests are disabled")

response = @image_kit.accounts.url_endpoints.create(description: "My custom URL endpoint")

Expand All @@ -24,7 +24,7 @@ def test_create_required_params
end

def test_update_required_params
skip("Prism tests are disabled")
skip("Mock server tests are disabled")

response = @image_kit.accounts.url_endpoints.update("id", description: "My custom URL endpoint")

Expand All @@ -44,7 +44,7 @@ def test_update_required_params
end

def test_list
skip("Prism tests are disabled")
skip("Mock server tests are disabled")

response = @image_kit.accounts.url_endpoints.list

Expand All @@ -54,7 +54,7 @@ def test_list
end

def test_delete
skip("Prism tests are disabled")
skip("Mock server tests are disabled")

response = @image_kit.accounts.url_endpoints.delete("id")

Expand All @@ -64,7 +64,7 @@ def test_delete
end

def test_get
skip("Prism tests are disabled")
skip("Mock server tests are disabled")

response = @image_kit.accounts.url_endpoints.get("id")

Expand Down
2 changes: 1 addition & 1 deletion test/imagekitio/resources/accounts/usage_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class Imagekitio::Test::Resources::Accounts::UsageTest < Imagekitio::Test::ResourceTest
def test_get_required_params
skip("Prism tests are disabled")
skip("Mock server tests are disabled")

response = @image_kit.accounts.usage.get(end_date: "2019-12-27", start_date: "2019-12-27")

Expand Down
2 changes: 1 addition & 1 deletion test/imagekitio/resources/assets_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class Imagekitio::Test::Resources::AssetsTest < Imagekitio::Test::ResourceTest
def test_list
skip("Prism tests are disabled")
skip("Mock server tests are disabled")

response = @image_kit.assets.list

Expand Down
2 changes: 1 addition & 1 deletion test/imagekitio/resources/beta/v2/files_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class Imagekitio::Test::Resources::Beta::V2::FilesTest < Imagekitio::Test::ResourceTest
def test_upload_required_params
skip("Prism tests are disabled")
skip("Mock server tests are disabled")

response = @image_kit.beta.v2.files.upload(file: Pathname(__FILE__), file_name: "fileName")

Expand Down
4 changes: 2 additions & 2 deletions test/imagekitio/resources/cache/invalidation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class Imagekitio::Test::Resources::Cache::InvalidationTest < Imagekitio::Test::ResourceTest
def test_create_required_params
skip("Prism tests are disabled")
skip("Mock server tests are disabled")

response =
@image_kit.cache.invalidation.create(url: "https://ik.imagekit.io/your_imagekit_id/default-image.jpg")
Expand All @@ -21,7 +21,7 @@ def test_create_required_params
end

def test_get
skip("Prism tests are disabled")
skip("Mock server tests are disabled")

response = @image_kit.cache.invalidation.get("requestId")

Expand Down
8 changes: 4 additions & 4 deletions test/imagekitio/resources/custom_metadata_fields_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class Imagekitio::Test::Resources::CustomMetadataFieldsTest < Imagekitio::Test::ResourceTest
def test_create_required_params
skip("Prism tests are disabled")
skip("Mock server tests are disabled")

response =
@image_kit.custom_metadata_fields.create(label: "price", name: "price", schema: {type: :Number})
Expand All @@ -24,7 +24,7 @@ def test_create_required_params
end

def test_update
skip("Prism tests are disabled")
skip("Mock server tests are disabled")

response = @image_kit.custom_metadata_fields.update("id")

Expand All @@ -43,7 +43,7 @@ def test_update
end

def test_list
skip("Prism tests are disabled")
skip("Mock server tests are disabled")

response = @image_kit.custom_metadata_fields.list

Expand All @@ -53,7 +53,7 @@ def test_list
end

def test_delete
skip("Prism tests are disabled")
skip("Mock server tests are disabled")

response = @image_kit.custom_metadata_fields.delete("id")

Expand Down
Loading
Loading