airbrake-ruby 3.2.3-java → 3.2.4-java
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24bab865b5db1b667a166cc1bd41b5708152de65
|
4
|
+
data.tar.gz: b13483675acade75535356f679099873ed234888
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0eeb206a23d7068c1d4b812adb5a048f154c3ae7eef70803556ce550550d3c792b67cdd95a7561b270dd621ba378fc879c38f8a0a622d7c5aecae346260bc3cb
|
7
|
+
data.tar.gz: 39a05948f1e8176e7862cda8a02d669a9f2f46e078f1aca1901167814192e1ea1ad62f6b0b81df802f8a2b5686fc6ac6f0295b52daa2a121ddaf8d48eb79fc42
|
data/lib/airbrake-ruby/config.rb
CHANGED
@@ -206,7 +206,7 @@ module Airbrake
|
|
206
206
|
def route_stats=(value)
|
207
207
|
logger.warn(
|
208
208
|
"#{LOG_LABEL} the 'route_stats' option is deprecated. " \
|
209
|
-
"Use '
|
209
|
+
"Use 'performance_stats' instead"
|
210
210
|
)
|
211
211
|
@performance_stats = value
|
212
212
|
end
|
@@ -11,20 +11,24 @@ module Airbrake
|
|
11
11
|
def initialize(root_directory)
|
12
12
|
@git_path = File.join(root_directory, '.git')
|
13
13
|
@repository = nil
|
14
|
-
@git_version =
|
14
|
+
@git_version = detect_git_version
|
15
15
|
@weight = 116
|
16
16
|
end
|
17
17
|
|
18
18
|
# @macro call_filter
|
19
19
|
def call(notice)
|
20
20
|
return if notice[:context].key?(:repository)
|
21
|
+
attach_repository(notice)
|
22
|
+
end
|
21
23
|
|
24
|
+
def attach_repository(notice)
|
22
25
|
if @repository
|
23
26
|
notice[:context][:repository] = @repository
|
24
27
|
return
|
25
28
|
end
|
26
29
|
|
27
30
|
return unless File.exist?(@git_path)
|
31
|
+
return unless @git_version
|
28
32
|
|
29
33
|
@repository =
|
30
34
|
if @git_version >= Gem::Version.new('2.7.0')
|
@@ -37,6 +41,24 @@ module Airbrake
|
|
37
41
|
return unless @repository
|
38
42
|
notice[:context][:repository] = @repository
|
39
43
|
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def detect_git_version
|
48
|
+
return unless which('git')
|
49
|
+
Gem::Version.new(`git --version`.split[2])
|
50
|
+
end
|
51
|
+
|
52
|
+
# Cross-platform way to tell if an executable is accessible.
|
53
|
+
def which(cmd)
|
54
|
+
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
|
55
|
+
ENV['PATH'].split(File::PATH_SEPARATOR).find do |path|
|
56
|
+
exts.find do |ext|
|
57
|
+
exe = File.join(path, "#{cmd}#{ext}")
|
58
|
+
File.executable?(exe) && !File.directory?(exe)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
40
62
|
end
|
41
63
|
end
|
42
64
|
end
|
@@ -50,4 +50,12 @@ RSpec.describe Airbrake::Filters::GitRepositoryFilter do
|
|
50
50
|
)
|
51
51
|
end
|
52
52
|
end
|
53
|
+
|
54
|
+
context "when git is not in PATH" do
|
55
|
+
it "does not attach context/repository" do
|
56
|
+
ENV['PATH'] = ''
|
57
|
+
subject.call(notice)
|
58
|
+
expect(notice[:context][:repository]).to be_nil
|
59
|
+
end
|
60
|
+
end
|
53
61
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: airbrake-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.4
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Airbrake Technologies, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbtree-jruby
|