diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2c45013c..54e3872c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.0.24" + ".": "1.0.25" } \ No newline at end of file diff --git a/.rubocop.yml b/.rubocop.yml index b4f256d1..a095e860 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -149,7 +149,7 @@ Naming/ClassAndModuleCamelCase: Naming/MethodParameterName: Enabled: false -Naming/PredicateName: +Naming/PredicatePrefix: Exclude: - "**/*.rbi" diff --git a/CHANGELOG.md b/CHANGELOG.md index 9dfb533f..6285f5c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.0.25 (2025-08-20) + +Full Changelog: [v1.0.24...v1.0.25](https://github.com/OneBusAway/ruby-sdk/compare/v1.0.24...v1.0.25) + +### Bug Fixes + +* bump sorbet version and fix new type errors from the breaking change ([c072aac](https://github.com/OneBusAway/ruby-sdk/commit/c072aac4d761e83878e4cb6a1ef9d66f277d5269)) + ## 1.0.24 (2025-08-10) Full Changelog: [v1.0.23...v1.0.24](https://github.com/OneBusAway/ruby-sdk/compare/v1.0.23...v1.0.24) diff --git a/Gemfile.lock b/Gemfile.lock index 770360cc..9dd2f2a2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,13 +11,13 @@ GIT PATH remote: . specs: - onebusaway-sdk (1.0.20) + onebusaway-sdk (1.0.25) connection_pool GEM remote: https://rubygems.org/ specs: - activesupport (8.0.2) + activesupport (8.0.2.1) base64 benchmark (>= 0.3) bigdecimal @@ -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) @@ -84,7 +89,7 @@ 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) @@ -92,20 +97,19 @@ GEM 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) @@ -113,25 +117,28 @@ GEM 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) @@ -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 @@ -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) @@ -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 diff --git a/README.md b/README.md index 51cd1dce..d63fc4fc 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 "onebusaway-sdk", "~> 1.0.24" +gem "onebusaway-sdk", "~> 1.0.25" ``` diff --git a/lib/onebusaway_sdk/internal/transport/base_client.rb b/lib/onebusaway_sdk/internal/transport/base_client.rb index d0a1705e..68ab318e 100644 --- a/lib/onebusaway_sdk/internal/transport/base_client.rb +++ b/lib/onebusaway_sdk/internal/transport/base_client.rb @@ -370,10 +370,7 @@ def initialize( # @return [Array(Integer, Net::HTTPResponse, Enumerable)] 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: OnebusawaySDK::Internal::Util.monotonic_secs + timeout - } + input = {**request.except(:timeout), deadline: OnebusawaySDK::Internal::Util.monotonic_secs + timeout} if send_retry_header headers["x-stainless-retry-count"] = retry_count.to_s diff --git a/lib/onebusaway_sdk/internal/transport/pooled_net_requester.rb b/lib/onebusaway_sdk/internal/transport/pooled_net_requester.rb index 41dbe446..2ce859d7 100644 --- a/lib/onebusaway_sdk/internal/transport/pooled_net_requester.rb +++ b/lib/onebusaway_sdk/internal/transport/pooled_net_requester.rb @@ -193,15 +193,7 @@ def initialize(size: self.class::DEFAULT_MAX_CONNECTIONS) end define_sorbet_constant!(:Request) do - T.type_alias do - { - method: Symbol, - url: URI::Generic, - headers: T::Hash[String, String], - body: T.anything, - deadline: Float - } - end + T.type_alias { {method: Symbol, url: URI::Generic, headers: T::Hash[String, String], body: T.anything, deadline: Float} } end end end diff --git a/lib/onebusaway_sdk/internal/type/base_model.rb b/lib/onebusaway_sdk/internal/type/base_model.rb index 4de83164..c99e72e3 100644 --- a/lib/onebusaway_sdk/internal/type/base_model.rb +++ b/lib/onebusaway_sdk/internal/type/base_model.rb @@ -64,14 +64,7 @@ def fields setter = :"#{name_sym}=" api_name = info.fetch(:api_name, name_sym) nilable = info.fetch(:nil?, false) - const = if required && !nilable - info.fetch( - :const, - OnebusawaySDK::Internal::OMIT - ) - else - OnebusawaySDK::Internal::OMIT - end + const = required && !nilable ? info.fetch(:const, OnebusawaySDK::Internal::OMIT) : OnebusawaySDK::Internal::OMIT [name_sym, setter].each { undef_method(_1) } if known_fields.key?(name_sym) diff --git a/lib/onebusaway_sdk/internal/util.rb b/lib/onebusaway_sdk/internal/util.rb index 3f0fa0bb..db73c220 100644 --- a/lib/onebusaway_sdk/internal/util.rb +++ b/lib/onebusaway_sdk/internal/util.rb @@ -244,7 +244,7 @@ class << self # # @return [String] def uri_origin(uri) - "#{uri.scheme}://#{uri.host}#{uri.port == uri.default_port ? '' : ":#{uri.port}"}" + "#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}" end # @api private diff --git a/lib/onebusaway_sdk/models/references.rb b/lib/onebusaway_sdk/models/references.rb index 4df007dd..bde24132 100644 --- a/lib/onebusaway_sdk/models/references.rb +++ b/lib/onebusaway_sdk/models/references.rb @@ -16,10 +16,7 @@ class References < OnebusawaySDK::Internal::Type::BaseModel # @!attribute situations # # @return [Array] - required :situations, - -> { - OnebusawaySDK::Internal::Type::ArrayOf[OnebusawaySDK::References::Situation] - } + required :situations, -> { OnebusawaySDK::Internal::Type::ArrayOf[OnebusawaySDK::References::Situation] } # @!attribute stops # @@ -215,9 +212,7 @@ class Situation < OnebusawaySDK::Internal::Type::BaseModel # # @return [Array, nil] optional :consequences, - -> { - OnebusawaySDK::Internal::Type::ArrayOf[OnebusawaySDK::References::Situation::Consequence] - } + -> { OnebusawaySDK::Internal::Type::ArrayOf[OnebusawaySDK::References::Situation::Consequence] } # @!attribute description # diff --git a/lib/onebusaway_sdk/version.rb b/lib/onebusaway_sdk/version.rb index f995bfb4..b96f6f6d 100644 --- a/lib/onebusaway_sdk/version.rb +++ b/lib/onebusaway_sdk/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module OnebusawaySDK - VERSION = "1.0.24" + VERSION = "1.0.25" end diff --git a/rbi/onebusaway_sdk/errors.rbi b/rbi/onebusaway_sdk/errors.rbi index 73380e0d..4f4cf0a1 100644 --- a/rbi/onebusaway_sdk/errors.rbi +++ b/rbi/onebusaway_sdk/errors.rbi @@ -59,10 +59,10 @@ module OnebusawaySDK end class APIConnectionError < OnebusawaySDK::Errors::APIError - sig { void } + sig { returns(NilClass) } attr_accessor :status - sig { void } + sig { returns(NilClass) } attr_accessor :body # @api private diff --git a/test/onebusaway_sdk/internal/type/base_model_test.rb b/test/onebusaway_sdk/internal/type/base_model_test.rb index 32f0e96a..48e1a1de 100644 --- a/test/onebusaway_sdk/internal/type/base_model_test.rb +++ b/test/onebusaway_sdk/internal/type/base_model_test.rb @@ -157,6 +157,7 @@ def test_dump_retry class OnebusawaySDK::Test::EnumModelTest < Minitest::Test class E0 include OnebusawaySDK::Internal::Type::Enum + attr_reader :values def initialize(*values) = (@values = values) @@ -476,6 +477,7 @@ def initialize(*variants) = variants.each { variant(_1) } module U1 extend OnebusawaySDK::Internal::Type::Union + variant const: :a variant const: 2 end @@ -492,6 +494,7 @@ class M2 < OnebusawaySDK::Internal::Type::BaseModel module U2 extend OnebusawaySDK::Internal::Type::Union + discriminator :type variant :a, M1 @@ -500,6 +503,7 @@ module U2 module U3 extend OnebusawaySDK::Internal::Type::Union + discriminator :type variant :a, M1 @@ -508,6 +512,7 @@ module U3 module U4 extend OnebusawaySDK::Internal::Type::Union + discriminator :type variant String @@ -601,6 +606,7 @@ def test_coerce class OnebusawaySDK::Test::BaseModelQoLTest < Minitest::Test class E0 include OnebusawaySDK::Internal::Type::Enum + attr_reader :values def initialize(*values) = (@values = values) diff --git a/test/onebusaway_sdk/internal/util_test.rb b/test/onebusaway_sdk/internal/util_test.rb index 79782c1d..2a5c60c5 100644 --- a/test/onebusaway_sdk/internal/util_test.rb +++ b/test/onebusaway_sdk/internal/util_test.rb @@ -242,11 +242,7 @@ def test_hash_encode {strio: StringIO.new("a")} => {"strio" => "a"}, {strio: OnebusawaySDK::FilePart.new("a")} => {"strio" => "a"}, {pathname: Pathname(__FILE__)} => {"pathname" => -> { _1.read in /^class OnebusawaySDK/ }}, - {pathname: OnebusawaySDK::FilePart.new(Pathname(__FILE__))} => { - "pathname" => -> { - _1.read in /^class OnebusawaySDK/ - } - } + {pathname: OnebusawaySDK::FilePart.new(Pathname(__FILE__))} => {"pathname" => -> { _1.read in /^class OnebusawaySDK/ }} } cases.each do |body, testcase| encoded = OnebusawaySDK::Internal::Util.encode_content(headers, body) @@ -324,9 +320,9 @@ def test_rewind_chain end def test_external_iteration - it = [1, 2, 3].to_enum - first = it.next - fused = OnebusawaySDK::Internal::Util.fused_enum(it, external: true) + iter = [1, 2, 3].to_enum + first = iter.next + fused = OnebusawaySDK::Internal::Util.fused_enum(iter, external: true) assert_equal(1, first) assert_equal([2, 3], fused.to_a)