redmine_airbrake_backend 0.5.1 → 0.5.2

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
  SHA1:
3
- metadata.gz: 1f445f8d89f994076e4210d533b0e5a2f2aea273
4
- data.tar.gz: 76c0ae29f9bf68a5cd06b2e4aa1c1cebb3552190
3
+ metadata.gz: 8974f2cd1f4c0d9f29192f69d4393a610c32b10d
4
+ data.tar.gz: f70c683add7289460a912899397467c56b189d0d
5
5
  SHA512:
6
- metadata.gz: 22cfe4c7e701be52c670d8443456af0a89c5d89c2f9de3c260d5dbc43c6049335864e9b963c0d6361faa49fed39911d5bbaa76a89eed0d48f5d6c28c84ed5ac9
7
- data.tar.gz: 6dedc83522e2c0230332fb81c49efc832a4d83864c053506006f8527fd2021a34a1546a1c40cfd3d74a5d9b88376576d90a1262851abe1b8503d5eb4a78e1f47
6
+ metadata.gz: 6f4fd01f0a25c111af8a8f966213fcc9ba5f06de0ee272b5bcc5e56158461f0c88a687ff40d3ab79b050f995cc5788c2a298a0cc3a84f11bc6ef89e419d980da
7
+ data.tar.gz: 79f7a059da64164cd17bee49e1d902d48a47d875831f77092f297cfb28ff727d12c5643ecb3f70889bb3548ef1a9a6671de1266467bed815c16e2a876065bb39
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- redmine_airbrake_backend (0.5.1)
4
+ redmine_airbrake_backend (0.5.2)
5
5
  hpricot
6
6
  htmlentities
7
7
  rails
@@ -1,6 +1,13 @@
1
1
  <% if error.present? %>
2
2
  h1. <%= error.message %>
3
3
 
4
+ <% if error.application.present? %>
5
+ h2. Application:
6
+
7
+ <%=format_list_item('Name', error.application[:name]) %>
8
+ <%=format_list_item('Version', error.application[:version]) %>
9
+ <% end %>
10
+
4
11
  <% if error.backtrace.present? %>
5
12
  h2. Stacktrace:
6
13
 
@@ -5,7 +5,7 @@ module RedmineAirbrakeBackend
5
5
  class Error
6
6
  attr_accessor :request
7
7
  attr_reader :type, :message, :backtrace
8
- attr_reader :airbrake_hash, :subject, :attachments
8
+ attr_reader :application, :airbrake_hash, :subject, :attachments
9
9
 
10
10
  def initialize(error_data)
11
11
  # Data
@@ -20,6 +20,9 @@ module RedmineAirbrakeBackend
20
20
  # Backtrace
21
21
  @backtrace = @data[:backtrace]
22
22
 
23
+ # Application
24
+ @application = @data[:application]
25
+
23
26
  # Attachments
24
27
  @attachments = @data[:attachments]
25
28
 
@@ -7,7 +7,8 @@ module RedmineAirbrakeBackend
7
7
  def self.parse(data)
8
8
  error = {
9
9
  backtrace: [],
10
- attachments: []
10
+ attachments: [],
11
+ application: {}
11
12
  }
12
13
 
13
14
  header_finished = false
@@ -19,14 +20,22 @@ module RedmineAirbrakeBackend
19
20
  header_finished = true if line =~ /^(Application Specific Information|Last Exception Backtrace|Thread \d+( Crashed)?):$/
20
21
 
21
22
  unless header_finished
22
- key, value = line.split(':', 2)
23
+ key, value = line.split(':', 2).map { |s| s.strip }
23
24
 
24
25
  next if key.blank? || value.blank?
25
26
 
26
- error[:type] = value.strip if key.strip == 'Exception Type'
27
- error[:message] = value.strip if key.strip == 'Exception Codes'
28
-
29
- indicent_identifier = value.strip if key.strip == 'Incident Identifier'
27
+ case key
28
+ when 'Exception Type'
29
+ error[:type] = value
30
+ when 'Exception Codes'
31
+ error[:message] = value
32
+ when 'Incident Identifier'
33
+ indicent_identifier = value
34
+ when 'Identifier'
35
+ error[:application][:name] = value
36
+ when 'Version'
37
+ error[:application][:version] = value
38
+ end
30
39
  end
31
40
 
32
41
  if next_line_is_message
@@ -24,6 +24,7 @@ module RedmineAirbrakeBackend
24
24
  # Project
25
25
  @project = Project.where(identifier: @config[:project]).first
26
26
  raise Invalid.new('No or invalid project') if @project.blank?
27
+ raise Invalid.new('Airbrake not enabled for project') if @project.enabled_modules.where(name: :airbrake).empty?
27
28
 
28
29
  # Check configuration
29
30
  raise Invalid.new('Custom field for notice hash is not configured!') if notice_hash_field.blank?
@@ -1,4 +1,4 @@
1
1
  module RedmineAirbrakeBackend
2
2
  # Version of this gem
3
- VERSION = '0.5.1'
3
+ VERSION = '0.5.2'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine_airbrake_backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Schwab
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-16 00:00:00.000000000 Z
11
+ date: 2014-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails