sentry-ruby 4.0.0 → 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 517bd830d9052aef4d3c9011f95e1d95f7740fae3bfdd746ece393766f637d84
4
- data.tar.gz: 0b25ac7ffe3abf0c8b0a153681952bd36315fe406341add2e7e724632ca74d35
3
+ metadata.gz: 732989200a2cbf0a935c386cf84037d655332953ea2fef828099fbf68b756ab9
4
+ data.tar.gz: 4aecc66958496eede273d4cc4b2e3861e0ce7eb3cf769912a4a6675efeba693e
5
5
  SHA512:
6
- metadata.gz: a717d3e5286400706e44f8bf1a17d6901e5fc7149efbff7f2f70758b1ac5c4f0f134f0d875a5543fa95777013aa1b0b0168f7c41fa149316bd9ced3a2f4ed48e
7
- data.tar.gz: ad58cf9e97b482ff9b3107a677d1bc03d3429bba26052f908ce43b25635985f65525b3345afccd1488d5c94eabb0c6565b1ce16d003859da2e359f6ccbdd1eb9
6
+ metadata.gz: 798be41100ec3c8eb09039f9432df02fd0de323427fd0d8bf6d9ced8f7b39d420e972c6006bcb4490002e32f03acfad2311b8ddab826c6927bd53b2a7316c7cb
7
+ data.tar.gz: 78cc7ec6d5c1a7f6603f9f2e4917b26e12ad5b13c0387a00645282acf8c910518c4132c171e2c9a8311f11e82afa3eb0454d2102bf48abd4c44d6625fd4ce4cf
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.1
4
+
5
+ - Add rake integration: [1137](https://github.com/getsentry/sentry-ruby/pull/1137)
6
+ - Make Event's interfaces accessible: [1135](https://github.com/getsentry/sentry-ruby/pull/1135)
7
+ - ActiveSupportLogger should only record events that has a started time: [1132](https://github.com/getsentry/sentry-ruby/pull/1132)
8
+
3
9
  ## 4.0.0
4
10
 
5
11
  - Only documents update for the official release and no API/feature changes.
data/README.md CHANGED
@@ -28,6 +28,10 @@ The official Ruby-language client and integration layer for the [Sentry](https:/
28
28
 
29
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.
30
30
 
31
+ ## Migrate From sentry-raven
32
+
33
+ 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/).
34
+
31
35
  ## Getting Started
32
36
 
33
37
  ### Install
@@ -11,6 +11,15 @@ require "sentry/transaction"
11
11
  require "sentry/hub"
12
12
  require "sentry/rack"
13
13
 
14
+ def safely_require(lib)
15
+ begin
16
+ require lib
17
+ rescue LoadError
18
+ end
19
+ end
20
+
21
+ safely_require "sentry/rake"
22
+
14
23
  module Sentry
15
24
  class Error < StandardError
16
25
  end
@@ -18,7 +18,7 @@ module Sentry
18
18
  )
19
19
 
20
20
  attr_accessor(*ATTRIBUTES)
21
- attr_reader :configuration
21
+ attr_reader :configuration, :request, :exception, :stacktrace
22
22
 
23
23
  def initialize(configuration:, message: nil)
24
24
  # this needs to go first because some setters rely on configuration
@@ -75,7 +75,7 @@ module Sentry
75
75
  end
76
76
 
77
77
  def rack_env=(env)
78
- unless @request || env.empty?
78
+ unless request || env.empty?
79
79
  @request = Sentry::RequestInterface.new.tap do |int|
80
80
  int.from_rack(env)
81
81
  end
@@ -96,9 +96,9 @@ module Sentry
96
96
  def to_hash
97
97
  data = serialize_attributes
98
98
  data[:breadcrumbs] = breadcrumbs.to_hash if breadcrumbs
99
- data[:stacktrace] = @stacktrace.to_hash if @stacktrace
100
- data[:request] = @request.to_hash if @request
101
- data[:exception] = @exception.to_hash if @exception
99
+ data[:stacktrace] = stacktrace.to_hash if stacktrace
100
+ data[:request] = request.to_hash if request
101
+ data[:exception] = exception.to_hash if exception
102
102
 
103
103
  data
104
104
  end
@@ -0,0 +1,17 @@
1
+ require "rake"
2
+ require "rake/task"
3
+
4
+ module Rake
5
+ class Application
6
+ alias orig_display_error_messsage display_error_message
7
+ def display_error_message(ex)
8
+ Sentry.capture_exception(ex) do |scope|
9
+ task_name = top_level_tasks.join(' ')
10
+ scope.set_transaction_name(task_name)
11
+ scope.set_tag("rake_task", task_name)
12
+ end
13
+
14
+ orig_display_error_messsage(ex)
15
+ end
16
+ end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module Sentry
2
- VERSION = "4.0.0"
2
+ VERSION = "4.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentry-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sentry Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-10 00:00:00.000000000 Z
11
+ date: 2020-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -67,6 +67,7 @@ files:
67
67
  - lib/sentry/rack.rb
68
68
  - lib/sentry/rack/capture_exception.rb
69
69
  - lib/sentry/rack/tracing.rb
70
+ - lib/sentry/rake.rb
70
71
  - lib/sentry/scope.rb
71
72
  - lib/sentry/span.rb
72
73
  - lib/sentry/transaction.rb