sports-odds-api 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f689a7b1270baa4209b9172d7de7ad334f3931c5dbb7e810724c01502cea09aa
4
- data.tar.gz: f10d47f2bc573bfad258aaa4a14883e05e94e1fb343eaacc50f1ad842b967c59
3
+ metadata.gz: bdfcac63dcdf37a24e24996746997cfabab7b955decbee450576fd0fdc6f62c3
4
+ data.tar.gz: c34370dccf8a5ca2f6b539eccc830b74876017a9637e704ba455395e9ff44292
5
5
  SHA512:
6
- metadata.gz: 3a88d1344291e1d8bcc85d3414e38f1f9b16f2d23e9b8ce13ccef14637f5606c556de3054f6efcba69c0b97690fc24331816d16aa5022c7cd2c84ac42a8719de
7
- data.tar.gz: 4ad9da993cb19e8a3ea0398ec730f46d4fb5c71032c69bb481c5900d0b7f7950500f545458b9b6d360ab94ab8c84df4efe232447a960d6163c4e552b0a3962af
6
+ metadata.gz: fbb548a78f81ea7bcf0f72dbb284bc95f25dcc35d85e12c9da784ef69c53e131013362b39b5eddcc083c99315aa12452740b4d0def24649f211c5fbeab4cb25d
7
+ data.tar.gz: e3b6187cfeb6ba6d40b5257e90f6c55de22b8b08adb843dc7031939ded3dac59282cc6fb447d37c444ef39655863ebdaf6d49a0f078eaacb975a951de41d2f0d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.3 (2026-07-08)
4
+
5
+ Full Changelog: [v1.2.2...v1.2.3](https://github.com/SportsGameOdds/sports-odds-api-ruby/compare/v1.2.2...v1.2.3)
6
+
7
+ ### Bug Fixes
8
+
9
+ * calling `break` out of streams should be instantaneous ([537aad0](https://github.com/SportsGameOdds/sports-odds-api-ruby/commit/537aad0b2ceb50068372914cba30d0379fc7ec3d))
10
+ * **client:** always add content-length to post body, even when empty ([99718bd](https://github.com/SportsGameOdds/sports-odds-api-ruby/commit/99718bd9cebc1fee4c5efb390607345cdb27f281))
11
+ * **client:** loosen json header parsing ([0307d97](https://github.com/SportsGameOdds/sports-odds-api-ruby/commit/0307d97a3844180cc3227902b52baeb37d319a86))
12
+ * **docs:** fix mcp installation instructions for remote servers ([e60c40c](https://github.com/SportsGameOdds/sports-odds-api-ruby/commit/e60c40ccdca70f2e59548db754db3cb8e72e8cf9))
13
+ * issue where json.parse errors when receiving HTTP 204 with nobody ([bb722ce](https://github.com/SportsGameOdds/sports-odds-api-ruby/commit/bb722cee2d0fbadc59bb38ab7fb8c3276ac60654))
14
+
15
+
16
+ ### Chores
17
+
18
+ * **docs:** remove www prefix ([a4bf528](https://github.com/SportsGameOdds/sports-odds-api-ruby/commit/a4bf528f53d3fc10396f2f39e4ab122ccc393178))
19
+ * **internal:** codegen related update ([2aebae3](https://github.com/SportsGameOdds/sports-odds-api-ruby/commit/2aebae36d92c62daa0156477d60a1a0624f9ab77))
20
+ * **internal:** update `actions/checkout` version ([ab57614](https://github.com/SportsGameOdds/sports-odds-api-ruby/commit/ab57614a39b81bf558804846d9bad83e50cb8834))
21
+ * move `cgi` into dependencies for ruby 4 ([0ea92c6](https://github.com/SportsGameOdds/sports-odds-api-ruby/commit/0ea92c68f0c0eb91e49103b03ce11531f5f1e99d))
22
+
23
+
24
+ ### Documentation
25
+
26
+ * prominently feature MCP server setup in root SDK readmes ([ff8bb53](https://github.com/SportsGameOdds/sports-odds-api-ruby/commit/ff8bb53a4a14cf7c78b33070e17d483cd60e5cfa))
27
+
3
28
  ## 1.2.2 (2025-11-26)
4
29
 
5
30
  Full Changelog: [v1.2.1...v1.2.2](https://github.com/SportsGameOdds/sports-odds-api-ruby/compare/v1.2.1...v1.2.2)
data/README.md CHANGED
@@ -4,6 +4,16 @@ Get live betting odds, spreads, and totals for NFL, NBA, MLB, and 50 additional
4
4
 
5
5
  [![Gem Version](https://img.shields.io/gem/v/sports-odds-api.svg?label=rubygems%20(stable))](https://rubygems.org/gems/sports-odds-api)
6
6
 
7
+ ## MCP Server
8
+
9
+ Use the Sports Game Odds MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
10
+
11
+ [![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=sports-odds-api-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsInNwb3J0cy1vZGRzLWFwaS1tY3AiXSwiZW52Ijp7IlNQT1JUU19PRERTX0FQSV9LRVlfSEVBREVSIjoiTXkgQVBJIEtleSBQYXJhbSJ9fQ)
12
+ [![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22sports-odds-api-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22sports-odds-api-mcp%22%5D%2C%22env%22%3A%7B%22SPORTS_ODDS_API_KEY_HEADER%22%3A%22My%20API%20Key%20Param%22%7D%7D)
13
+
14
+ > Note: You may need to set environment variables in your MCP client.
15
+
16
+ ## Documentation
7
17
  This library provides convenient access to the Sports Game Odds REST API from any Ruby 3.2.0+ application.
8
18
 
9
19
  The REST API documentation can be found on [sportsgameodds.com](https://sportsgameodds.com/docs/). The full API of this library can be found in [api.md](api.md).
@@ -26,7 +36,7 @@ The REST API documentation can be found on [sportsgameodds.com](https://sportsga
26
36
  Add to your application's `Gemfile`:
27
37
 
28
38
  ```ruby
29
- gem "sports-odds-api", "~> 1.2.2"
39
+ gem "sports-odds-api", "~> 1.2.3"
30
40
  ```
31
41
 
32
42
  Or install manually:
@@ -75,7 +75,7 @@ module SportsOddsAPI
75
75
 
76
76
  case body
77
77
  in nil
78
- nil
78
+ req["content-length"] ||= 0 unless req["transfer-encoding"]
79
79
  in String
80
80
  req["content-length"] ||= body.bytesize.to_s unless req["transfer-encoding"]
81
81
  req.body_stream = SportsOddsAPI::Internal::Util::ReadIOAdapter.new(body, &blk)
@@ -153,17 +153,19 @@ module SportsOddsAPI
153
153
  end
154
154
 
155
155
  self.class.calibrate_socket_timeout(conn, deadline)
156
- conn.request(req) do |rsp|
157
- y << [req, rsp]
158
- break if finished
159
-
160
- rsp.read_body do |bytes|
161
- y << bytes.force_encoding(Encoding::BINARY)
162
- break if finished
163
-
164
- self.class.calibrate_socket_timeout(conn, deadline)
156
+ ::Kernel.catch(:jump) do
157
+ conn.request(req) do |rsp|
158
+ y << [req, rsp]
159
+ ::Kernel.throw(:jump) if finished
160
+
161
+ rsp.read_body do |bytes|
162
+ y << bytes.force_encoding(Encoding::BINARY)
163
+ ::Kernel.throw(:jump) if finished
164
+
165
+ self.class.calibrate_socket_timeout(conn, deadline)
166
+ end
167
+ eof = true
165
168
  end
166
- eof = true
167
169
  end
168
170
  end
169
171
  ensure
@@ -485,7 +485,7 @@ module SportsOddsAPI
485
485
  end
486
486
 
487
487
  # @type [Regexp]
488
- JSON_CONTENT = %r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)}
488
+ JSON_CONTENT = %r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)}
489
489
  # @type [Regexp]
490
490
  JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}
491
491
 
@@ -657,7 +657,8 @@ module SportsOddsAPI
657
657
  def decode_content(headers, stream:, suppress_error: false)
658
658
  case (content_type = headers["content-type"])
659
659
  in SportsOddsAPI::Internal::Util::JSON_CONTENT
660
- json = stream.to_a.join
660
+ return nil if (json = stream.to_a.join).empty?
661
+
661
662
  begin
662
663
  JSON.parse(json, symbolize_names: true)
663
664
  rescue JSON::ParserError => e
@@ -667,7 +668,11 @@ module SportsOddsAPI
667
668
  in SportsOddsAPI::Internal::Util::JSONL_CONTENT
668
669
  lines = decode_lines(stream)
669
670
  chain_fused(lines) do |y|
670
- lines.each { y << JSON.parse(_1, symbolize_names: true) }
671
+ lines.each do
672
+ next if _1.empty?
673
+
674
+ y << JSON.parse(_1, symbolize_names: true)
675
+ end
671
676
  end
672
677
  in %r{^text/event-stream}
673
678
  lines = decode_lines(stream)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SportsOddsAPI
4
- VERSION = "1.2.2"
4
+ VERSION = "1.2.3"
5
5
  end
@@ -296,7 +296,7 @@ module SportsOddsAPI
296
296
  end
297
297
 
298
298
  JSON_CONTENT =
299
- T.let(%r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)}, Regexp)
299
+ T.let(%r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)}, Regexp)
300
300
  JSONL_CONTENT =
301
301
  T.let(%r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}, Regexp)
302
302
 
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sports-odds-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sports Game Odds
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-12-16 00:00:00.000000000 Z
11
+ date: 2026-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: cgi
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: connection_pool
15
29
  requirement: !ruby/object:Gem::Requirement