diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 93e8660..d52d2b9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.12.2" + ".": "0.13.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a4e52cf..723c248 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.13.0 (2026-05-07) + +Full Changelog: [v0.12.2...v0.13.0](https://github.com/openlayer-ai/openlayer-ruby/compare/v0.12.2...v0.13.0) + +### Features + +* support setting headers via env ([9818ac9](https://github.com/openlayer-ai/openlayer-ruby/commit/9818ac9cea9643c819533ff310982db22883bdae)) + ## 0.12.2 (2026-04-23) Full Changelog: [v0.12.1...v0.12.2](https://github.com/openlayer-ai/openlayer-ruby/compare/v0.12.1...v0.12.2) diff --git a/Gemfile.lock b/Gemfile.lock index 58483b7..9aef4a5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - openlayer (0.12.2) + openlayer (0.13.0) cgi connection_pool diff --git a/README.md b/README.md index 5e4274c..1df318b 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "openlayer", "~> 0.12.2" +gem "openlayer", "~> 0.13.0" ``` diff --git a/lib/openlayer/client.rb b/lib/openlayer/client.rb index 3859f85..24d534e 100644 --- a/lib/openlayer/client.rb +++ b/lib/openlayer/client.rb @@ -69,6 +69,19 @@ def initialize( ) base_url ||= "https://api.openlayer.com/v1" + headers = {} + custom_headers_env = ENV["OPENLAYER_CUSTOM_HEADERS"] + unless custom_headers_env.nil? + parsed = {} + custom_headers_env.split("\n").each do |line| + colon = line.index(":") + unless colon.nil? + parsed[line[0...colon].strip] = line[(colon + 1)..].strip + end + end + headers = parsed.merge(headers) + end + @api_key = api_key&.to_s super( @@ -76,7 +89,8 @@ def initialize( timeout: timeout, max_retries: max_retries, initial_retry_delay: initial_retry_delay, - max_retry_delay: max_retry_delay + max_retry_delay: max_retry_delay, + headers: headers ) @projects = Openlayer::Resources::Projects.new(client: self) diff --git a/lib/openlayer/version.rb b/lib/openlayer/version.rb index 182419c..a08a7d4 100644 --- a/lib/openlayer/version.rb +++ b/lib/openlayer/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Openlayer - VERSION = "0.12.2" + VERSION = "0.13.0" end