exception_notification_server 0.0.4 → 0.0.5

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: 9a1e4fb2704dbd24eea560b43e8c3fe61a5e6f8c
4
- data.tar.gz: 989004c16885cbac6fa0826fa78c767149b47162
3
+ metadata.gz: f18f7c744afb1e81f6c3c60a43eb269be34145bf
4
+ data.tar.gz: c3445a39e93d37fb457a7214717ec883c846e476
5
5
  SHA512:
6
- metadata.gz: f3bf2cdf6da8c1a0c961b935a73c452c3363caaaf4b40d899cd620383dc1fdb946cb4491ab4a631f36fcc83a9be60492c12b4219c1d6e0e03bd647e77e856b7e
7
- data.tar.gz: bedb1fff0a4bea658be946fd1e0c0e7d3fca441dfde14dc9d76b51ce89d8487d5556cdd6134e10b422d984f8d0bfd666741b5da4e477f24c183edecec74ce8e9
6
+ metadata.gz: 491e6f38531f0248871a1ebf5d6b66076ca17d4757ca3d859899538ed8d1334aa249455a5738ff1ccff22d531b1bc637f7d781fbcda60455bed2cb54d0bb2f77
7
+ data.tar.gz: 47bf66be3e68d22d33aa44599a908c856a245fce4268ac7042cc66add62125fe74987a4804399799faa5b2bedddae7ed5444b9a0c884a3c0e95e0c27e34ecbeb
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
@@ -83,7 +83,7 @@ module ExceptionNotificationServer
83
83
  end
84
84
 
85
85
  def gen_exception_hash
86
- Digest::SHA1.hexdigest("#{application}#{exception_class}#{exception_message}#{backtrace.to_s.gsub(rails_root, '')}")
86
+ Digest::SHA1.hexdigest("#{application}#{exception_class}#{exception_message.gsub(/#<([a-zA-z]*):([0-9abcdefx]*)>/, '#<\1>')}#{backtrace.to_s.gsub(rails_root, '')}")
87
87
  end
88
88
 
89
89
  def base_id
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: exception_notification_server 0.0.4 ruby lib
5
+ # stub: exception_notification_server 0.0.5 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = 'exception_notification_server'
9
- s.version = '0.0.4'
9
+ s.version = '0.0.5'
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ['lib']
13
13
  s.authors = ['Anatoliy Varanitsa']
14
- s.date = '2015-10-19'
14
+ s.date = '2015-10-21'
15
15
  s.description = 'Gem that receive errors from exception_notification gem and show it grouped on pages'
16
16
  s.email = 'Prizrack13@mail.ru'
17
17
  s.extra_rdoc_files = [
@@ -1,3 +1,3 @@
1
1
  module ExceptionNotificationServer
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
@@ -1,4 +1,19 @@
1
- # desc "Explaining what the task does"
2
- # task :exception_notification_server do
3
- # # Task goes here
4
- # end
1
+ namespace :exception_notification_server do
2
+ desc 'Regenerate notification HASH'
3
+ task regenerate_hash: :environment do
4
+ notifications = ExceptionNotificationServer::Notification.order(:id).all
5
+ exception_hashes = {}
6
+ notifications.each do|notification|
7
+ exception_hash = notification.send(:gen_exception_hash)
8
+ exception_hashes[exception_hash] ||= []
9
+ exception_hashes[exception_hash] << notification.id
10
+ end
11
+ base_notifications = ExceptionNotificationServer::Notification.where(id: exception_hashes.values.map(&:first))
12
+ exception_hashes.each do |exception_hash, ids|
13
+ base_notification = base_notifications.find { |notification| notification.id == ids.first }
14
+ ExceptionNotificationServer::Notification.where(id: ids).update_all(exception_hash: exception_hash, parent_id: base_notification.id, status: base_notification.status)
15
+ base_notification.remove_data if base_notification.status == 'fixed'
16
+ end
17
+ base_notifications.update_all(parent_id: nil)
18
+ end
19
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exception_notification_server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anatoliy Varanitsa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-19 00:00:00.000000000 Z
11
+ date: 2015-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails