sentry-ruby 0.3.0 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +102 -14
  3. metadata +41 -54
  4. data/.craft.yml +0 -19
  5. data/.gitignore +0 -11
  6. data/.rspec +0 -3
  7. data/.travis.yml +0 -6
  8. data/CHANGELOG.md +0 -31
  9. data/CODE_OF_CONDUCT.md +0 -74
  10. data/Gemfile +0 -16
  11. data/Rakefile +0 -8
  12. data/bin/console +0 -14
  13. data/bin/setup +0 -8
  14. data/lib/sentry/backtrace.rb +0 -128
  15. data/lib/sentry/benchmarks/benchmark_transport.rb +0 -14
  16. data/lib/sentry/breadcrumb/sentry_logger.rb +0 -87
  17. data/lib/sentry/breadcrumb.rb +0 -25
  18. data/lib/sentry/breadcrumb_buffer.rb +0 -47
  19. data/lib/sentry/client.rb +0 -80
  20. data/lib/sentry/configuration.rb +0 -387
  21. data/lib/sentry/core_ext/object/deep_dup.rb +0 -57
  22. data/lib/sentry/core_ext/object/duplicable.rb +0 -153
  23. data/lib/sentry/dsn.rb +0 -48
  24. data/lib/sentry/event.rb +0 -177
  25. data/lib/sentry/hub.rb +0 -137
  26. data/lib/sentry/interface.rb +0 -22
  27. data/lib/sentry/interfaces/exception.rb +0 -11
  28. data/lib/sentry/interfaces/request.rb +0 -95
  29. data/lib/sentry/interfaces/single_exception.rb +0 -14
  30. data/lib/sentry/interfaces/stacktrace.rb +0 -57
  31. data/lib/sentry/linecache.rb +0 -44
  32. data/lib/sentry/logger.rb +0 -20
  33. data/lib/sentry/rack/capture_exception.rb +0 -45
  34. data/lib/sentry/rack/tracing.rb +0 -39
  35. data/lib/sentry/rack.rb +0 -5
  36. data/lib/sentry/scope.rb +0 -214
  37. data/lib/sentry/span.rb +0 -155
  38. data/lib/sentry/transaction.rb +0 -113
  39. data/lib/sentry/transaction_event.rb +0 -29
  40. data/lib/sentry/transport/configuration.rb +0 -21
  41. data/lib/sentry/transport/dummy_transport.rb +0 -14
  42. data/lib/sentry/transport/http_transport.rb +0 -65
  43. data/lib/sentry/transport/state.rb +0 -40
  44. data/lib/sentry/transport.rb +0 -97
  45. data/lib/sentry/utils/exception_cause_chain.rb +0 -20
  46. data/lib/sentry/utils/real_ip.rb +0 -70
  47. data/lib/sentry/utils/request_id.rb +0 -16
  48. data/lib/sentry/version.rb +0 -3
  49. data/lib/sentry-ruby.rb +0 -123
  50. data/sentry-ruby.gemspec +0 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de5539f70eb6f49164765e4e13416bef15f8b697349f2d2e71f63ac57916f325
4
- data.tar.gz: 89121fce3fb31be7fe783599ee204ab86354f70a870ce775c79e4a33f6141e13
3
+ metadata.gz: 4aa9700782e672548a16cd10395610a658bb73d37af363cd657f3f373c7118fe
4
+ data.tar.gz: 1995b50234b20e9a270fe35d7766dc0b816e6473723fe8d421278a04650257a5
5
5
  SHA512:
6
- metadata.gz: ca35ae1d033f68fcebfe2c3e9e4b91fa2784a56261423a1bc5e5c7550b6304eb63963bf4273b22e924db27e1287f256e712b7e74781d866e71bae288308e13ae
7
- data.tar.gz: e5853d409d5bbbb4b60ecee8c1edc3c6de91971b39938c03a19895ce790246cc234e5441d848aaba745ccc90cc4bbd3f1df4eb3108c18ea68736dab41f2ca93f
6
+ metadata.gz: b3856b5f92ba6a00cea9646c7aa18baa9739cd9f6472baef18f8bfae35db0c7047af98f2041e551382e2cff23505a00ba6c0da1cd7354e70b66c0e0d65bdf5e6
7
+ data.tar.gz: 44941a41ca3b8abd09b36a81fb7ebecc37cb4174092ae3bec5de96b2b0cc6e24830417933b374f8c91d4a32faf0838fc887c245a9080960f8c07e45166c976d0
data/README.md CHANGED
@@ -7,6 +7,8 @@
7
7
 
8
8
  # sentry-ruby, the Ruby Client for Sentry
9
9
 
10
+ **The old `sentry-raven` client has entered maintenance mode and was moved to [here](https://github.com/getsentry/sentry-ruby/tree/master/sentry-raven).**
11
+
10
12
  ---
11
13
 
12
14
 
@@ -17,7 +19,7 @@
17
19
  [![SemVer](https://api.dependabot.com/badges/compatibility_score?dependency-name=sentry-ruby&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score.html?dependency-name=sentry-ruby&package-manager=bundler&version-scheme=semver)
18
20
 
19
21
 
20
- [Documentation](https://docs.sentry.io/clients/ruby/) | [Bug Tracker](https://github.com/getsentry/sentry-ruby/issues) | [Forum](https://forum.sentry.io/) | IRC: irc.freenode.net, #sentry
22
+ [Documentation](https://docs.sentry.io/platforms/ruby/) | [Bug Tracker](https://github.com/getsentry/sentry-ruby/issues) | [Forum](https://forum.sentry.io/) | IRC: irc.freenode.net, #sentry
21
23
 
22
24
  The official Ruby-language client and integration layer for the [Sentry](https://github.com/getsentry/sentry) error reporting API.
23
25
 
@@ -26,6 +28,12 @@ The official Ruby-language client and integration layer for the [Sentry](https:/
26
28
 
27
29
  We test on Ruby 2.4, 2.5, 2.6 and 2.7 at the latest patchlevel/teeny version. We also support JRuby 9.0.
28
30
 
31
+ If you use self-hosted Sentry, please also make sure its version is above `20.6.0`.
32
+
33
+ ## Migrate From sentry-raven
34
+
35
+ If you're using `sentry-raven`, we recommend you to migrate to this new SDK. You can find the benefits of migrating and how to do it in our [migration guide](https://docs.sentry.io/platforms/ruby/migration/).
36
+
29
37
  ## Getting Started
30
38
 
31
39
  ### Install
@@ -59,7 +67,7 @@ end
59
67
 
60
68
  ### Sentry doesn't report some kinds of data by default
61
69
 
62
- **Sentry ignores some exceptions by default** - most of these are related to 404s parameter parsing errors. [For a complete list, see the `IGNORE_DEFAULT` constant](https://github.com/getsentry/sentry-ruby/blob/master/sentry-ruby/lib/sentry/configuration.rb#L118) and the integration gems' `IGNORE_DEFAULT`, like [`sentry-rails`'s](https://github.com/getsentry/sentry-ruby/blob/update-readme/sentry-rails/lib/sentry/rails/configuration.rb#L12)
70
+ **Sentry ignores some exceptions by default** - most of these are related to 404s parameter parsing errors. [For a complete list, see the `IGNORE_DEFAULT` constant](https://github.com/getsentry/sentry-ruby/blob/master/sentry-ruby/lib/sentry/configuration.rb#L118) and the integration gems' `IGNORE_DEFAULT`, like [`sentry-rails`'s](https://github.com/getsentry/sentry-ruby/blob/master/sentry-rails/lib/sentry/rails/configuration.rb#L12)
63
71
 
64
72
  Sentry doesn't send personally identifiable information (pii) by default, such as request body, user ip or cookies. If you want those information to be sent, you can use the `send_default_pii` config option:
65
73
 
@@ -70,17 +78,46 @@ Sentry.init do |config|
70
78
  end
71
79
  ```
72
80
 
81
+ ### Performance Monitoring
82
+
83
+ You can activate performance monitoring by enabling traces sampling:
84
+
85
+ ```ruby
86
+ Sentry.init do |config|
87
+ # set a uniform sample rate between 0.0 and 1.0
88
+ config.traces_sample_rate = 0.2
89
+
90
+ # or control sampling dynamically
91
+ config.traces_sampler = lambda do |sampling_context|
92
+ # sampling_context[:transaction_context] contains the information about the transaction
93
+ # sampling_context[:parent_sampled] contains the transaction's parent's sample decision
94
+ true # return value can be a boolean or a float between 0.0 and 1.0
95
+ end
96
+ end
97
+ ```
98
+
99
+ To learn more about performance monitoring, please visit the [official documentation](https://docs.sentry.io/platforms/ruby/performance).
100
+
73
101
  ### Usage
74
102
 
75
103
  `sentry-ruby` has a default integration with `Rack`, so you only need to use the middleware in your application like:
76
104
 
77
- ```
78
- require 'rack'
105
+ ```ruby
79
106
  require 'sentry-ruby'
80
107
 
81
- use Sentry::Rack::CaptureException
108
+ Sentry.init do |config|
109
+ config.dsn = 'https://examplePublicKey@o0.ingest.sentry.io/0'
110
+
111
+ # To activate performance monitoring, set one of these options.
112
+ # We recommend adjusting the value in production:
113
+ config.traces_sample_rate = 0.5
114
+ # or
115
+ config.traces_sampler = lambda do |context|
116
+ true
117
+ end
118
+ end
82
119
 
83
- run theapp
120
+ use Sentry::Rack::CaptureExceptions
84
121
  ```
85
122
 
86
123
  Otherwise, Sentry you can always use the capture helpers manually
@@ -104,13 +141,13 @@ We also provide integrations with popular frameworks/libraries with the related
104
141
 
105
142
  You're all set - but there's a few more settings you may want to know about too!
106
143
 
107
- #### async
144
+ #### Blocking v.s. Non-blocking
108
145
 
109
- When an error or message occurs, the notification is immediately sent to Sentry. Sentry can be configured to send asynchronously:
146
+ **Before version 4.1.0**, `sentry-ruby` sends every event immediately. But it can be configured to send asynchronously:
110
147
 
111
148
  ```ruby
112
- config.async = lambda { |event|
113
- Thread.new { Sentry.send_event(event) }
149
+ config.async = lambda { |event, hint|
150
+ Thread.new { Sentry.send_event(event, hint) }
114
151
  }
115
152
  ```
116
153
 
@@ -119,17 +156,58 @@ Using a thread to send events will be adequate for truly parallel Ruby platforms
119
156
  Note that the naive example implementation has a major drawback - it can create an infinite number of threads. We recommend creating a background job, using your background job processor, that will send Sentry notifications in the background.
120
157
 
121
158
  ```ruby
122
- config.async = lambda { |event| SentryJob.perform_later(event) }
159
+ config.async = lambda { |event, hint| SentryJob.perform_later(event, hint) }
123
160
 
124
161
  class SentryJob < ActiveJob::Base
125
162
  queue_as :default
163
+ discard_on ActiveJob::DeserializationError # this will prevent infinite loop when there's an issue deserializing SentryJob
126
164
 
127
- def perform(event)
128
- Sentry.send_event(event)
165
+ def perform(event, hint)
166
+ Sentry.send_event(event, hint)
129
167
  end
130
168
  end
131
169
  ```
132
170
 
171
+ If you also use `sentry-rails`, you can directly use the job we defined for you:
172
+
173
+ ```ruby
174
+ config.async = lambda { |event, hint| Sentry::SendEventJob.perform_later(event, hint) }
175
+ ```
176
+
177
+ **After version 4.1.0**, `sentry-ruby` sends events asynchronously by default. The functionality works like this:
178
+
179
+ 1. When the SDK is initialized, a `Sentry::BackgroundWorker` will be initialized too.
180
+ 2. When an event is passed to `Client#capture_event`, instead of sending it directly with `Client#send_event`, we'll let the worker do it.
181
+ 3. The worker will have a number of threads. And the one of the idle threads will pick the job and call `Client#send_event`.
182
+ - If all the threads are busy, new jobs will be put into a queue, which has a limit of 30.
183
+ - If the queue size is exceeded, new events will be dropped.
184
+
185
+ However, if you still prefer to use your own async approach, that's totally fine. If you have `config.async` set, the worker won't initialize a thread pool and won't be used either.
186
+
187
+ ##### About `Sentry::BackgroundWorker`
188
+
189
+ - The worker is built on top of the [concurrent-ruby](https://github.com/ruby-concurrency/concurrent-ruby) gem's [ThreadPoolExecutor](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/ThreadPoolExecutor.html), which is also used by Rails ActiveJob's async adapter. This should minimize the risk of messing up client applications with our own thread pool implementaion.
190
+
191
+ This functionality also introduces a new `background_worker_threads` config option. It allows you to decide how many threads should the worker hold. By default, the value will be the number of the processors your machine has. For example, if your machine has 4 processors, the value would be 4.
192
+
193
+ Of course, you can always override the value to fit your use cases, like
194
+
195
+ ```ruby
196
+ config.background_worker_threads = 5 # the worker will have 5 threads for sending events
197
+ ```
198
+
199
+ You can also disable this new non-blocking behaviour by giving a `0` value:
200
+
201
+ ```ruby
202
+ config.background_worker_threads = 0 # all events will be sent synchronously
203
+ ```
204
+
205
+ If you want to send a particular event immediately, you can use event hints to do it:
206
+
207
+ ```ruby
208
+ Sentry.capture_message("send me now!", hint: { background: false })
209
+ ```
210
+
133
211
  #### Contexts
134
212
 
135
213
  In sentry-ruby, every event will inherit their contextual data from the current scope. So you can enrich the event's data by configuring the current scope like:
@@ -148,6 +226,15 @@ end
148
226
  Sentry.capture_exception(exception) # the event will carry all those information now
149
227
  ```
150
228
 
229
+ Or use top-level setters
230
+
231
+
232
+ ```ruby
233
+ Sentry.set_user(id: 1, email: "test@example.com")
234
+ Sentry.set_tags(tag_1: "foo", tag_2: "bar")
235
+ Sentry.set_extras(order_number: 1234, tickets_count: 4)
236
+ ```
237
+
151
238
  Or build up a temporary scope for local information:
152
239
 
153
240
  ```ruby
@@ -172,7 +259,8 @@ Sentry.capture_exception(exception, tags: {foo: "bar"})
172
259
 
173
260
  ## More Information
174
261
 
175
- * [Documentation](https://docs.sentry.io/clients/ruby/)
262
+ * [Documentation](https://docs.sentry.io/platforms/ruby/)
176
263
  * [Bug Tracker](https://github.com/getsentry/sentry-ruby/issues)
177
264
  * [Forum](https://forum.sentry.io/)
178
265
  - [Discord](https://discord.gg/ez5KZN7)
266
+
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentry-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sentry Team
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-04 00:00:00.000000000 Z
11
+ date: 2021-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sentry-ruby-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 4.2.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 4.2.0
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: faraday
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -24,6 +38,26 @@ dependencies:
24
38
  - - ">="
25
39
  - !ruby/object:Gem::Version
26
40
  version: '1.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: concurrent-ruby
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 1.0.2
51
+ type: :runtime
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - "~>"
56
+ - !ruby/object:Gem::Version
57
+ version: '1.0'
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 1.0.2
27
61
  description: A gem that provides a client interface for the Sentry error logger
28
62
  email: accounts@sentry.io
29
63
  executables: []
@@ -32,62 +66,15 @@ extra_rdoc_files:
32
66
  - README.md
33
67
  - LICENSE.txt
34
68
  files:
35
- - ".craft.yml"
36
- - ".gitignore"
37
- - ".rspec"
38
- - ".travis.yml"
39
- - CHANGELOG.md
40
- - CODE_OF_CONDUCT.md
41
- - Gemfile
42
69
  - LICENSE.txt
43
70
  - README.md
44
- - Rakefile
45
- - bin/console
46
- - bin/setup
47
- - lib/sentry-ruby.rb
48
- - lib/sentry/backtrace.rb
49
- - lib/sentry/benchmarks/benchmark_transport.rb
50
- - lib/sentry/breadcrumb.rb
51
- - lib/sentry/breadcrumb/sentry_logger.rb
52
- - lib/sentry/breadcrumb_buffer.rb
53
- - lib/sentry/client.rb
54
- - lib/sentry/configuration.rb
55
- - lib/sentry/core_ext/object/deep_dup.rb
56
- - lib/sentry/core_ext/object/duplicable.rb
57
- - lib/sentry/dsn.rb
58
- - lib/sentry/event.rb
59
- - lib/sentry/hub.rb
60
- - lib/sentry/interface.rb
61
- - lib/sentry/interfaces/exception.rb
62
- - lib/sentry/interfaces/request.rb
63
- - lib/sentry/interfaces/single_exception.rb
64
- - lib/sentry/interfaces/stacktrace.rb
65
- - lib/sentry/linecache.rb
66
- - lib/sentry/logger.rb
67
- - lib/sentry/rack.rb
68
- - lib/sentry/rack/capture_exception.rb
69
- - lib/sentry/rack/tracing.rb
70
- - lib/sentry/scope.rb
71
- - lib/sentry/span.rb
72
- - lib/sentry/transaction.rb
73
- - lib/sentry/transaction_event.rb
74
- - lib/sentry/transport.rb
75
- - lib/sentry/transport/configuration.rb
76
- - lib/sentry/transport/dummy_transport.rb
77
- - lib/sentry/transport/http_transport.rb
78
- - lib/sentry/transport/state.rb
79
- - lib/sentry/utils/exception_cause_chain.rb
80
- - lib/sentry/utils/real_ip.rb
81
- - lib/sentry/utils/request_id.rb
82
- - lib/sentry/version.rb
83
- - sentry-ruby.gemspec
84
- homepage: https://github.com/getsentry/raven-ruby
71
+ homepage: https://github.com/getsentry/sentry-ruby
85
72
  licenses:
86
73
  - Apache-2.0
87
74
  metadata:
88
- homepage_uri: https://github.com/getsentry/raven-ruby
89
- source_code_uri: https://github.com/getsentry/raven-ruby
90
- changelog_uri: https://github.com/getsentry/raven-ruby/blob/master/CHANGELOG.md
75
+ homepage_uri: https://github.com/getsentry/sentry-ruby
76
+ source_code_uri: https://github.com/getsentry/sentry-ruby
77
+ changelog_uri: https://github.com/getsentry/sentry-ruby/blob/master/sentry-ruby/CHANGELOG.md
91
78
  post_install_message:
92
79
  rdoc_options: []
93
80
  require_paths:
data/.craft.yml DELETED
@@ -1,19 +0,0 @@
1
- minVersion: '0.13.2'
2
- github:
3
- owner: getsentry
4
- repo: sentry-ruby
5
- changelogPolicy: simple
6
- preReleaseCommand: ruby ../.scripts/bump-version.rb
7
- releaseBranchPrefix: release-sentry-ruby
8
- statusProvider:
9
- name: github
10
- artifactProvider:
11
- name: github
12
- targets:
13
- - name: gem
14
- - name: github
15
- tagPrefix: sentry-ruby-v
16
- - name: registry
17
- type: sdk
18
- config:
19
- canonical: 'gem:sentry-ruby'
data/.gitignore DELETED
@@ -1,11 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.6.5
6
- before_install: gem install bundler -v 2.1.1
data/CHANGELOG.md DELETED
@@ -1,31 +0,0 @@
1
- # Changelog
2
-
3
- ## 0.3.0
4
-
5
- - Major API changes: [1123](https://github.com/getsentry/sentry-ruby/pull/1123)
6
- - Support event hint: [1122](https://github.com/getsentry/sentry-ruby/pull/1122)
7
- - Add request-id tag to events: [1120](https://github.com/getsentry/sentry-ruby/pull/1120) (by @tvec)
8
-
9
- ## 0.2.0
10
-
11
- - Multiple fixes and refactorings
12
- - Tracing support
13
-
14
- ## 0.1.3
15
-
16
- Fix require reference
17
-
18
- ## 0.1.2
19
-
20
- - Fix: Fix async callback [1098](https://github.com/getsentry/sentry-ruby/pull/1098)
21
- - Refactor: Some code cleanup [1100](https://github.com/getsentry/sentry-ruby/pull/1100)
22
- - Refactor: Remove Event options [1101](https://github.com/getsentry/sentry-ruby/pull/1101)
23
-
24
- ## 0.1.1
25
-
26
- - Feature: Allow passing custom scope to Hub#capture* helpers [1086](https://github.com/getsentry/sentry-ruby/pull/1086)
27
-
28
- ## 0.1.0
29
-
30
- First version
31
-
data/CODE_OF_CONDUCT.md DELETED
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at stan001212@gmail.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [https://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: https://contributor-covenant.org
74
- [version]: https://contributor-covenant.org/version/1/4/
data/Gemfile DELETED
@@ -1,16 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in sentry-ruby.gemspec
4
- gemspec
5
-
6
- gem "rake", "~> 12.0"
7
- gem "rspec", "~> 3.0"
8
- gem "codecov"
9
-
10
- gem "pry"
11
- gem "rack"
12
-
13
- gem "benchmark-ips"
14
- gem "benchmark_driver"
15
- gem "benchmark-ipsa"
16
- gem "benchmark-memory"
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec).tap do |task|
5
- task.rspec_opts = "--order rand"
6
- end
7
-
8
- task :default => :spec
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "sentry/ruby"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,128 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- ## Inspired by Rails' and Airbrake's backtrace parsers.
4
-
5
- module Sentry
6
- # Front end to parsing the backtrace for each notice
7
- class Backtrace
8
- # Handles backtrace parsing line by line
9
- class Line
10
- RB_EXTENSION = ".rb"
11
- # regexp (optional leading X: on windows, or JRuby9000 class-prefix)
12
- RUBY_INPUT_FORMAT = /
13
- ^ \s* (?: [a-zA-Z]: | uri:classloader: )? ([^:]+ | <.*>):
14
- (\d+)
15
- (?: :in \s `([^']+)')?$
16
- /x.freeze
17
-
18
- # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
19
- JAVA_INPUT_FORMAT = /^(.+)\.([^\.]+)\(([^\:]+)\:(\d+)\)$/.freeze
20
-
21
- # The file portion of the line (such as app/models/user.rb)
22
- attr_reader :file
23
-
24
- # The line number portion of the line
25
- attr_reader :number
26
-
27
- # The method of the line (such as index)
28
- attr_reader :method
29
-
30
- # The module name (JRuby)
31
- attr_reader :module_name
32
-
33
- attr_reader :in_app_pattern
34
-
35
- # Parses a single line of a given backtrace
36
- # @param [String] unparsed_line The raw line from +caller+ or some backtrace
37
- # @return [Line] The parsed backtrace line
38
- def self.parse(unparsed_line, in_app_pattern)
39
- ruby_match = unparsed_line.match(RUBY_INPUT_FORMAT)
40
- if ruby_match
41
- _, file, number, method = ruby_match.to_a
42
- file.sub!(/\.class$/, RB_EXTENSION)
43
- module_name = nil
44
- else
45
- java_match = unparsed_line.match(JAVA_INPUT_FORMAT)
46
- _, module_name, method, file, number = java_match.to_a
47
- end
48
- new(file, number, method, module_name, in_app_pattern)
49
- end
50
-
51
- def initialize(file, number, method, module_name, in_app_pattern)
52
- @file = file
53
- @module_name = module_name
54
- @number = number.to_i
55
- @method = method
56
- @in_app_pattern = in_app_pattern
57
- end
58
-
59
- def in_app
60
- if file =~ in_app_pattern
61
- true
62
- else
63
- false
64
- end
65
- end
66
-
67
- # Reconstructs the line in a readable fashion
68
- def to_s
69
- "#{file}:#{number}:in `#{method}'"
70
- end
71
-
72
- def ==(other)
73
- to_s == other.to_s
74
- end
75
-
76
- def inspect
77
- "<Line:#{self}>"
78
- end
79
- end
80
-
81
- APP_DIRS_PATTERN = /(bin|exe|app|config|lib|test)/.freeze
82
-
83
- # holder for an Array of Backtrace::Line instances
84
- attr_reader :lines
85
- attr_reader :configuration
86
-
87
- def self.parse(backtrace, configuration:)
88
- ruby_lines = backtrace.is_a?(Array) ? backtrace : backtrace.split(/\n\s*/)
89
-
90
- ruby_lines = configuration.backtrace_cleanup_callback.call(ruby_lines) if configuration&.backtrace_cleanup_callback
91
-
92
- in_app_pattern ||= begin
93
- project_root = configuration.project_root&.to_s
94
- Regexp.new("^(#{project_root}/)?#{configuration.app_dirs_pattern || APP_DIRS_PATTERN}")
95
- end
96
-
97
- lines = ruby_lines.to_a.map do |unparsed_line|
98
- Line.parse(unparsed_line, in_app_pattern)
99
- end
100
-
101
- new(lines)
102
- end
103
-
104
- def initialize(lines)
105
- @lines = lines
106
- end
107
-
108
- def inspect
109
- "<Backtrace: " + lines.map(&:inspect).join(", ") + ">"
110
- end
111
-
112
- def to_s
113
- content = []
114
- lines.each do |line|
115
- content << line
116
- end
117
- content.join("\n")
118
- end
119
-
120
- def ==(other)
121
- if other.respond_to?(:lines)
122
- lines == other.lines
123
- else
124
- false
125
- end
126
- end
127
- end
128
- end
@@ -1,14 +0,0 @@
1
- module Sentry
2
- class BenchmarkTransport < Transport
3
- attr_accessor :events
4
-
5
- def initialize(*)
6
- super
7
- @events = []
8
- end
9
-
10
- def send_event(event)
11
- @events << encode(event.to_hash)
12
- end
13
- end
14
- end