redmine_airbrake_backend 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/app/helpers/airbrake_helper.rb +5 -3
- data/lib/redmine_airbrake_backend/version.rb +1 -1
- data/test/test_helper.rb +2 -0
- data/test/unit/airbrake_helper_test.rb +50 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad74c889a328309514b6b3cb0b00fe1ce3082da85407f551d3ab66e63de88d9a
|
4
|
+
data.tar.gz: fc95ca0035740ec48e17aa67704d229b597597594ed570cf44accc5f0658846b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af872b06365c8a32957c40503697a7f98e63e22e0f53f3cc9e9ed7af0d3a268f270fb5589ca6c5f4340648a45c9b49233ef64dd2dc737cdae54c0b02ce487813
|
7
|
+
data.tar.gz: 6db261719fba67208e7de4b7191659b772ee5737100598f913f132948e39e3bc6de16c138c1761d874b3a135d94eef6ca06441c03e35a980c71b3fb6e206ccc9
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [1.4.1] - 2019-08-26
|
10
|
+
### Fixed
|
11
|
+
- Typo in variable name
|
12
|
+
- Description syntax for source links without line number
|
13
|
+
|
9
14
|
## [1.4.0] - 2019-08-26
|
10
15
|
### Fixed
|
11
16
|
- Mapping of backtrace elements to repository entries
|
@@ -67,17 +67,19 @@ module AirbrakeHelper
|
|
67
67
|
file = element.root.undefined? ? element.file : "[#{element.root.upcase}_ROOT]#{element.file}"
|
68
68
|
|
69
69
|
if element.line.blank?
|
70
|
-
"@#{
|
70
|
+
"@#{file}@"
|
71
71
|
else
|
72
72
|
"@#{file}:#{element.line}@"
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
76
|
def airbrake_backtrace_element_markup_with_repository(repository, element)
|
77
|
+
file = element.line.present? ? "#{element.file}#L#{element.line}" : element.file
|
78
|
+
|
77
79
|
if repository.identifier.blank?
|
78
|
-
"source:\"#{
|
80
|
+
"source:\"#{file}\""
|
79
81
|
else
|
80
|
-
"source:\"#{repository.identifier}|#{
|
82
|
+
"source:\"#{repository.identifier}|#{file}\""
|
81
83
|
end
|
82
84
|
end
|
83
85
|
end
|
data/test/test_helper.rb
CHANGED
@@ -0,0 +1,50 @@
|
|
1
|
+
require_relative '../test_helper'
|
2
|
+
|
3
|
+
require 'airbrake_helper'
|
4
|
+
|
5
|
+
class AirbrakeHelperTest < ActiveSupport::TestCase
|
6
|
+
include AirbrakeHelper
|
7
|
+
|
8
|
+
class Repository
|
9
|
+
attr_reader :identifier
|
10
|
+
|
11
|
+
def initialize(options = {})
|
12
|
+
@identifier = options[:identifier]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
test 'airbrake_backtrace_element_markup_without_repository' do
|
17
|
+
be = RedmineAirbrakeBackend::BacktraceElement.new(file: '/PROJECT_ROOT/foo/bar.rb', line: 10)
|
18
|
+
assert_equal('@[PROJECT_ROOT]/foo/bar.rb:10@', airbrake_backtrace_element_markup_without_repository(be))
|
19
|
+
|
20
|
+
be = RedmineAirbrakeBackend::BacktraceElement.new(file: '/GEM_ROOT/foo/bar.rb', line: 10)
|
21
|
+
assert_equal('@[GEM_ROOT]/foo/bar.rb:10@', airbrake_backtrace_element_markup_without_repository(be))
|
22
|
+
|
23
|
+
be = RedmineAirbrakeBackend::BacktraceElement.new(file: '/PROJECT_ROOT/foo/bar.rb', function: 'foo')
|
24
|
+
assert_equal('@[PROJECT_ROOT]/foo/bar.rb@', airbrake_backtrace_element_markup_without_repository(be))
|
25
|
+
|
26
|
+
be = RedmineAirbrakeBackend::BacktraceElement.new(file: '/foo/bar.rb', line: 10)
|
27
|
+
assert_equal('@/foo/bar.rb:10@', airbrake_backtrace_element_markup_without_repository(be))
|
28
|
+
|
29
|
+
be = RedmineAirbrakeBackend::BacktraceElement.new(file: '/foo/bar.rb', function: 'foo')
|
30
|
+
assert_equal('@/foo/bar.rb@', airbrake_backtrace_element_markup_without_repository(be))
|
31
|
+
end
|
32
|
+
|
33
|
+
test 'airbrake_backtrace_element_markup_with_repository' do
|
34
|
+
r = Repository.new(identifier: nil)
|
35
|
+
|
36
|
+
be = RedmineAirbrakeBackend::BacktraceElement.new(file: '/PROJECT_ROOT/foo/bar.rb', line: 10)
|
37
|
+
assert_equal('source:"/foo/bar.rb#L10"', airbrake_backtrace_element_markup_with_repository(r, be))
|
38
|
+
|
39
|
+
be = RedmineAirbrakeBackend::BacktraceElement.new(file: '/PROJECT_ROOT/foo/bar.rb')
|
40
|
+
assert_equal('source:"/foo/bar.rb"', airbrake_backtrace_element_markup_with_repository(r, be))
|
41
|
+
|
42
|
+
r = Repository.new(identifier: 'foo')
|
43
|
+
|
44
|
+
be = RedmineAirbrakeBackend::BacktraceElement.new(file: '/PROJECT_ROOT/foo/bar.rb', line: 10)
|
45
|
+
assert_equal('source:"foo|/foo/bar.rb#L10"', airbrake_backtrace_element_markup_with_repository(r, be))
|
46
|
+
|
47
|
+
be = RedmineAirbrakeBackend::BacktraceElement.new(file: '/PROJECT_ROOT/foo/bar.rb')
|
48
|
+
assert_equal('source:"foo|/foo/bar.rb"', airbrake_backtrace_element_markup_with_repository(r, be))
|
49
|
+
end
|
50
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redmine_airbrake_backend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Schwab
|
@@ -145,6 +145,7 @@ files:
|
|
145
145
|
- lib/tasks/test.rake
|
146
146
|
- redmine_airbrake_backend.gemspec
|
147
147
|
- test/test_helper.rb
|
148
|
+
- test/unit/airbrake_helper_test.rb
|
148
149
|
- test/unit/notice_test.rb
|
149
150
|
homepage: https://gitlab.com/ydkn/redmine_airbrake_backend
|
150
151
|
licenses:
|
@@ -171,4 +172,5 @@ specification_version: 4
|
|
171
172
|
summary: This plugin provides the necessary API to use Redmine as a Airbrake backend
|
172
173
|
test_files:
|
173
174
|
- test/test_helper.rb
|
175
|
+
- test/unit/airbrake_helper_test.rb
|
174
176
|
- test/unit/notice_test.rb
|