kubelink 1.0.0.beta.1 → 1.0.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kubelink/sentry.rb +8 -5
- data/lib/kubelink/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5764723a19e9bfa5f2285ddd5c417a6f8b23b75b14a034aa02ad8bf41b4b1d3
|
4
|
+
data.tar.gz: f1eaf5d1b8ebb87253eb22fc855e0975b7ba0fd0665a124be6cefe7746cca2e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cbdb14e5deacc3185c3a8b1315b0a723b160b6f0190737d91c7365d10fb5ef5043dad74ef339c6329e9e2e086d70ee59983cd1011736f6fcecfac736e33fe10
|
7
|
+
data.tar.gz: 22603f690209fa013fd2c0b46d826ee1400e72b56ce1841d28cafddccfdd3d4c2335c765c4ea08169e2a0b795509fd57e69a10dd6d745b80b3416594dfcb3de1
|
data/lib/kubelink/sentry.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Kubelink
|
4
|
-
class
|
4
|
+
class Sentrylink < Rails::Railtie
|
5
5
|
def self.sentry_dsn
|
6
6
|
@dsn ||= begin
|
7
7
|
u = URI.parse(ENV['SENTRY_DSN'])
|
@@ -17,10 +17,13 @@ module Kubelink
|
|
17
17
|
include Helpers
|
18
18
|
end
|
19
19
|
|
20
|
-
if
|
20
|
+
if Sentrylink.sentry_dsn.present?
|
21
|
+
require 'sentry-ruby'
|
22
|
+
require 'sentry-rails'
|
23
|
+
|
21
24
|
Sentry.init do |config|
|
22
25
|
config.breadcrumbs_logger = [:active_support_logger]
|
23
|
-
config.dsn =
|
26
|
+
config.dsn = Sentrylink.sentry_dsn
|
24
27
|
config.release = ENV['RAILS_COMMIT'] if ENV.key?('RAILS_COMMIT')
|
25
28
|
config.send_default_pii = true
|
26
29
|
config.traces_sample_rate = 1.0
|
@@ -36,13 +39,13 @@ module Kubelink
|
|
36
39
|
|
37
40
|
module Helpers
|
38
41
|
def sentry_include_tag
|
39
|
-
return unless
|
42
|
+
return unless Sentrylink.sentry_dsn.present?
|
40
43
|
|
41
44
|
script = 'https://browser.sentry-cdn.com/5.11.0/bundle.min.js'
|
42
45
|
|
43
46
|
[javascript_include_tag(script, crossorigin: :anonymous),
|
44
47
|
javascript_tag(nonce: true) do
|
45
|
-
%{Sentry.init({ dsn: "#{
|
48
|
+
%{Sentry.init({ dsn: "#{Sentrylink.sentry_dsn}" });}.html_safe
|
46
49
|
end].join("\n").html_safe
|
47
50
|
end
|
48
51
|
end
|
data/lib/kubelink/version.rb
CHANGED