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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e94a784058235695f5420da63caf59103aadd0e2f9479dc7ad6da0619b296035
4
- data.tar.gz: 8dfb3a85f877301c7507c8066000d0e5677cb8df86d937243c55fce9963ba9d4
3
+ metadata.gz: ad74c889a328309514b6b3cb0b00fe1ce3082da85407f551d3ab66e63de88d9a
4
+ data.tar.gz: fc95ca0035740ec48e17aa67704d229b597597594ed570cf44accc5f0658846b
5
5
  SHA512:
6
- metadata.gz: 56af38387d929c822fe89205f77a05590ebc6e9bd4a7354791548821edff783b252bb0a7f5846b2116163a21c5afd35a98fe251b335d6c700cbaadf97f7b5f84
7
- data.tar.gz: e53f9f81f788630b003c6fa2f1cd4c6cb135c22b2f9578f40a22f3091d97ec595439c003faaf6023aa14a0df1bd1503f5788ce4f23d50a7a1e96c1f76f87c645
6
+ metadata.gz: af872b06365c8a32957c40503697a7f98e63e22e0f53f3cc9e9ed7af0d3a268f270fb5589ca6c5f4340648a45c9b49233ef64dd2dc737cdae54c0b02ce487813
7
+ data.tar.gz: 6db261719fba67208e7de4b7191659b772ee5737100598f913f132948e39e3bc6de16c138c1761d874b3a135d94eef6ca06441c03e35a980c71b3fb6e206ccc9
@@ -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
- "@#{ile}@"
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:\"#{element.file}#L#{element.line}\""
80
+ "source:\"#{file}\""
79
81
  else
80
- "source:\"#{repository.identifier}|#{element.file}#L#{element.line}\""
82
+ "source:\"#{repository.identifier}|#{file}\""
81
83
  end
82
84
  end
83
85
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module RedmineAirbrakeBackend
4
4
  # Version of this gem
5
- VERSION = '1.4.0'
5
+ VERSION = '1.4.1'
6
6
  end
@@ -4,3 +4,5 @@ require 'rails'
4
4
  require 'rails/test_help'
5
5
 
6
6
  Bundler.require(*Rails.groups)
7
+
8
+ $LOAD_PATH.unshift(*Rails::Engine::Configuration.new(File.expand_path('..', __dir__)).eager_load_paths)
@@ -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.0
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