bugstack 1.0.1 → 1.1.0

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: b715bfa222a5a4dbeca79754a954a2a072d2f8698e5e98c15e6c61292db40961
4
- data.tar.gz: f4f37cb3453daffd0aa2c8b0cbb79b03e53e1a1fc7f88417d4f464ebcffca43d
3
+ metadata.gz: 5b70be0311455f78a16e89c5a96389371ce6a98848844a78c3c91ddc88dd5fca
4
+ data.tar.gz: 67c04ee34fba1e79ecd02d7beaebba098075a43cd18a85793ea8db967d96321c
5
5
  SHA512:
6
- metadata.gz: 17ef64cf12eca75e5965123cbb97acbbaa9fd8244dc632ac5d7ffc4794475880d610621bc322b3f2fa3f5366b7bcee75e0f1ea9fe53e2227471eb1c8a17bde91
7
- data.tar.gz: 1feb6a9a36ba288e5678270359f0b639c5a69c27ab8eba17ddea262f56a13d112739a23bc05e5d6b24290529b6329ae6375cdcf3d35bd51aee17acaa64076a2a
6
+ metadata.gz: 4d3b6391309d364bf46ed54a6fa16a181a45b257a1c7abd95495f89b399c3c2240623f1c1049555142700501dbab87eeaa458464f3b5fad299c231393045b279
7
+ data.tar.gz: 25e6671986a36019653b37f442c3ed4ed61dafa299a7174f81054b74d7986813f64496f57ef9803b7fe7cd6c81e3c2fe010735663d7f588fe435868f7a8d4faf
data/CHANGELOG.md CHANGED
@@ -1,20 +1,31 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- ## [1.0.0] - 2026-02-13
6
-
7
- ### Added
8
-
9
- - Core SDK with `Bugstack.init` and `Bugstack.capture_exception`
10
- - Background thread transport with retry and exponential backoff
11
- - SHA-256 error fingerprinting and client-side deduplication
12
- - `before_send` hook for event inspection/modification/filtering
13
- - `ignored_errors` for skipping specific error types or messages
14
- - `dry_run` mode for transparent debugging
15
- - `enabled` kill switch
16
- - Block-style configuration
17
- - Rails integration via Railtie and Rack middleware
18
- - Sinatra integration via `register`
19
- - Generic integration via `at_exit` hook
20
- - Zero runtime gem dependencies
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [1.1.0] - 2026-10-28
6
+
7
+ ### Fixed
8
+
9
+ - The default endpoint is now `https://dashboard.bugstack.ai/api/ingest/sdk`.
10
+ It was `https://api.bugstack.dev/api/capture`, which is not Bugstack's
11
+ ingest address, so events sent with the default setting did not reach
12
+ Bugstack. Apps that set `config.endpoint` themselves are unaffected.
13
+ - The gem's homepage, documentation link, contact and security addresses
14
+ now point at bugstack.ai.
15
+
16
+ ## [1.0.0] - 2026-02-13
17
+
18
+ ### Added
19
+
20
+ - Core SDK with `Bugstack.init` and `Bugstack.capture_exception`
21
+ - Background thread transport with retry and exponential backoff
22
+ - SHA-256 error fingerprinting and client-side deduplication
23
+ - `before_send` hook for event inspection/modification/filtering
24
+ - `ignored_errors` for skipping specific error types or messages
25
+ - `dry_run` mode for transparent debugging
26
+ - `enabled` kill switch
27
+ - Block-style configuration
28
+ - Rails integration via Railtie and Rack middleware
29
+ - Sinatra integration via `register`
30
+ - Generic integration via `at_exit` hook
31
+ - Zero runtime gem dependencies
data/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 BugStack
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 BugStack
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,174 +1,176 @@
1
- # bugstack-ruby
2
-
3
- Official Ruby SDK for [BugStack](https://bugstack.dev) — capture, report, and auto-fix production errors.
4
-
5
- [![Gem Version](https://badge.fury.io/rb/bugstack.svg)](https://rubygems.org/gems/bugstack)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
7
-
8
- ## Installation
9
-
10
- ```ruby
11
- gem "bugstack"
12
- ```
13
-
14
- Or install directly:
15
-
16
- ```bash
17
- gem install bugstack
18
- ```
19
-
20
- ## Quick Start
21
-
22
- ```ruby
23
- require "bugstack"
24
-
25
- Bugstack.init(api_key: "bs_live_...")
26
-
27
- begin
28
- risky_operation
29
- rescue => e
30
- Bugstack.capture_exception(e)
31
- end
32
- ```
33
-
34
- ## Block Configuration
35
-
36
- ```ruby
37
- Bugstack.init do |config|
38
- config.api_key = "bs_live_..."
39
- config.environment = "production"
40
- config.auto_fix = true
41
- config.debug = true
42
- end
43
- ```
44
-
45
- ## Framework Integrations
46
-
47
- ### Rails
48
-
49
- Add to your Gemfile:
50
-
51
- ```ruby
52
- gem "bugstack"
53
- ```
54
-
55
- Create an initializer:
56
-
57
- ```ruby
58
- # config/initializers/bugstack.rb
59
- Bugstack.init do |config|
60
- config.api_key = Rails.application.credentials.bugstack_api_key
61
- config.environment = Rails.env
62
- config.auto_fix = true
63
- end
64
- ```
65
-
66
- The Railtie automatically inserts Rack middleware for exception capture.
67
-
68
- ### Sinatra
69
-
70
- ```ruby
71
- require "sinatra"
72
- require "bugstack"
73
- require "bugstack/integrations/sinatra"
74
-
75
- Bugstack.init(api_key: "bs_live_...")
76
-
77
- class MyApp < Sinatra::Base
78
- register Bugstack::Integrations::Sinatra
79
-
80
- get "/" do
81
- "Hello!"
82
- end
83
- end
84
- ```
85
-
86
- ### Generic (at_exit hook)
87
-
88
- ```ruby
89
- require "bugstack"
90
- require "bugstack/integrations/generic"
91
-
92
- Bugstack.init(api_key: "bs_live_...")
93
- Bugstack::Integrations::Generic.install!
94
- ```
95
-
96
- ## Configuration
97
-
98
- ```ruby
99
- Bugstack.init do |config|
100
- config.api_key = "bs_live_..." # Required
101
- config.environment = "production" # Default: "production"
102
- config.auto_fix = true # Enable AI-powered auto-fix
103
- config.debug = false # Log SDK activity
104
- config.dry_run = false # Log without sending
105
- config.enabled = true # Kill switch
106
- config.deduplication_window = 300 # Seconds (default: 5 min)
107
- config.timeout = 5.0 # HTTP timeout in seconds
108
- config.max_retries = 3 # Retry attempts
109
- config.ignored_errors = [ # Errors to skip
110
- SystemExit,
111
- SignalException,
112
- "expected error message",
113
- ]
114
- config.before_send = ->(event) { # Inspect/modify/drop events
115
- event # return nil to drop
116
- }
117
- end
118
- ```
119
-
120
- ## Data Transparency
121
-
122
- ### `before_send` Hook
123
-
124
- ```ruby
125
- Bugstack.init do |config|
126
- config.api_key = "bs_live_..."
127
- config.before_send = ->(event) {
128
- # Drop health check errors
129
- return nil if event.request&.dig(:route)&.include?("/health")
130
-
131
- # Redact sensitive data
132
- event.metadata.delete("secret")
133
-
134
- event
135
- }
136
- end
137
- ```
138
-
139
- ### `dry_run` Mode
140
-
141
- ```ruby
142
- Bugstack.init(api_key: "bs_live_...", dry_run: true)
143
- # Prints: [BugStack DryRun] Would send: { ... }
144
- ```
145
-
146
- ## What Gets Sent
147
-
148
- ```json
149
- {
150
- "apiKey": "bs_live_...",
151
- "error": {
152
- "message": "undefined method 'foo' for nil",
153
- "stackTrace": "NoMethodError: undefined method...",
154
- "file": "app/controllers/users_controller.rb",
155
- "function": "show",
156
- "fingerprint": "a1b2c3d4e5f6g7h8"
157
- },
158
- "environment": {
159
- "language": "ruby",
160
- "languageVersion": "3.2.0",
161
- "framework": "rails",
162
- "frameworkVersion": "7.1.0",
163
- "os": "x86_64-linux",
164
- "sdkVersion": "1.0.0"
165
- },
166
- "timestamp": "2026-01-15T08:30:00Z"
167
- }
168
- ```
169
-
170
- Zero runtime gem dependencies. No cookies, IP addresses, or user data.
171
-
172
- ## License
173
-
174
- MIT — see [LICENSE](LICENSE).
1
+ # bugstack-ruby
2
+
3
+ The [Bugstack](https://bugstack.ai) SDK for Ruby: Rails, Sinatra and any Rack app.
4
+
5
+ Bugstack is autonomous software maintenance. It watches your app and your repository, fixes what breaks, and sends every change as a pull request you control. This SDK is how your app tells Bugstack about an uncaught server error.
6
+
7
+ [![Gem Version](https://badge.fury.io/rb/bugstack.svg)](https://rubygems.org/gems/bugstack)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
9
+
10
+ ## Installation
11
+
12
+ ```ruby
13
+ gem "bugstack"
14
+ ```
15
+
16
+ Or install directly:
17
+
18
+ ```bash
19
+ gem install bugstack
20
+ ```
21
+
22
+ ## Quick Start
23
+
24
+ ```ruby
25
+ require "bugstack"
26
+
27
+ Bugstack.init(api_key: "bs_live_...")
28
+
29
+ begin
30
+ risky_operation
31
+ rescue => e
32
+ Bugstack.capture_exception(e)
33
+ end
34
+ ```
35
+
36
+ ## Block Configuration
37
+
38
+ ```ruby
39
+ Bugstack.init do |config|
40
+ config.api_key = "bs_live_..."
41
+ config.environment = "production"
42
+ config.auto_fix = true
43
+ config.debug = true
44
+ end
45
+ ```
46
+
47
+ ## Framework Integrations
48
+
49
+ ### Rails
50
+
51
+ Add to your Gemfile:
52
+
53
+ ```ruby
54
+ gem "bugstack"
55
+ ```
56
+
57
+ Create an initializer:
58
+
59
+ ```ruby
60
+ # config/initializers/bugstack.rb
61
+ Bugstack.init do |config|
62
+ config.api_key = Rails.application.credentials.bugstack_api_key
63
+ config.environment = Rails.env
64
+ config.auto_fix = true
65
+ end
66
+ ```
67
+
68
+ The Railtie automatically inserts Rack middleware for exception capture.
69
+
70
+ ### Sinatra
71
+
72
+ ```ruby
73
+ require "sinatra"
74
+ require "bugstack"
75
+ require "bugstack/integrations/sinatra"
76
+
77
+ Bugstack.init(api_key: "bs_live_...")
78
+
79
+ class MyApp < Sinatra::Base
80
+ register Bugstack::Integrations::Sinatra
81
+
82
+ get "/" do
83
+ "Hello!"
84
+ end
85
+ end
86
+ ```
87
+
88
+ ### Generic (at_exit hook)
89
+
90
+ ```ruby
91
+ require "bugstack"
92
+ require "bugstack/integrations/generic"
93
+
94
+ Bugstack.init(api_key: "bs_live_...")
95
+ Bugstack::Integrations::Generic.install!
96
+ ```
97
+
98
+ ## Configuration
99
+
100
+ ```ruby
101
+ Bugstack.init do |config|
102
+ config.api_key = "bs_live_..." # Required
103
+ config.environment = "production" # Default: "production"
104
+ config.auto_fix = true # Let Bugstack open a fix for errors this SDK reports
105
+ config.debug = false # Log SDK activity
106
+ config.dry_run = false # Log without sending
107
+ config.enabled = true # Kill switch
108
+ config.deduplication_window = 300 # Seconds (default: 5 min)
109
+ config.timeout = 5.0 # HTTP timeout in seconds
110
+ config.max_retries = 3 # Retry attempts
111
+ config.ignored_errors = [ # Errors to skip
112
+ SystemExit,
113
+ SignalException,
114
+ "expected error message",
115
+ ]
116
+ config.before_send = ->(event) { # Inspect/modify/drop events
117
+ event # return nil to drop
118
+ }
119
+ end
120
+ ```
121
+
122
+ ## Data Transparency
123
+
124
+ ### `before_send` Hook
125
+
126
+ ```ruby
127
+ Bugstack.init do |config|
128
+ config.api_key = "bs_live_..."
129
+ config.before_send = ->(event) {
130
+ # Drop health check errors
131
+ return nil if event.request&.dig(:route)&.include?("/health")
132
+
133
+ # Redact sensitive data
134
+ event.metadata.delete("secret")
135
+
136
+ event
137
+ }
138
+ end
139
+ ```
140
+
141
+ ### `dry_run` Mode
142
+
143
+ ```ruby
144
+ Bugstack.init(api_key: "bs_live_...", dry_run: true)
145
+ # Prints: [BugStack DryRun] Would send: { ... }
146
+ ```
147
+
148
+ ## What Gets Sent
149
+
150
+ ```json
151
+ {
152
+ "apiKey": "bs_live_...",
153
+ "error": {
154
+ "message": "undefined method 'foo' for nil",
155
+ "stackTrace": "NoMethodError: undefined method...",
156
+ "file": "app/controllers/users_controller.rb",
157
+ "function": "show",
158
+ "fingerprint": "a1b2c3d4e5f6g7h8"
159
+ },
160
+ "environment": {
161
+ "language": "ruby",
162
+ "languageVersion": "3.2.0",
163
+ "framework": "rails",
164
+ "frameworkVersion": "7.1.0",
165
+ "os": "x86_64-linux",
166
+ "sdkVersion": "1.0.0"
167
+ },
168
+ "timestamp": "2026-01-15T08:30:00Z"
169
+ }
170
+ ```
171
+
172
+ Zero runtime gem dependencies. No cookies, IP addresses, or user data.
173
+
174
+ ## License
175
+
176
+ MIT — see [LICENSE](LICENSE).