asana_exception_notifier 1.0.2 → 1.1.0
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 +4 -4
- data/.travis.yml +9 -0
- data/gemfiles/rails_5.0.2.gemfile +8 -0
- data/gemfiles/rails_5.1.0.rc1.gemfile +8 -0
- data/lib/asana_exception_notifier/classes/asana.rb +2 -0
- data/lib/asana_exception_notifier/version.rb +2 -2
- data/lib/asana_exception_notifier.rb +1 -0
- data/spec/subscribers/base.rb +16 -0
- data/spec/subscribers/metrics.rb +14 -0
- data/spec/test_notification.rb +7 -0
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f6ee9a9b16fea7666f912b854ea429b629566dc
|
4
|
+
data.tar.gz: 5a5e67365a9f34b955edc7fe4402755d09764040
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fc8b9b99dccf0cac6b57533b64c365d64d15bec09bc9aaf4e3522745c573014d07b781793c689f4f7268adb39809f25cdaddb41c5985f64ba26788a3861ac85
|
7
|
+
data.tar.gz: 86cd50c4858351b832158b8e7fb4e5c64c84f8339f792e4312867f16ca752670b93a518ae7fdaa19fc3d5d2c0083aaef5be5a63428e4777c2d3a0a75ca29c2ea
|
data/.travis.yml
CHANGED
@@ -23,6 +23,14 @@ gemfile:
|
|
23
23
|
- gemfiles/rails_5.0.0.gemfile
|
24
24
|
- gemfiles/rails_5.0.2.gemfile
|
25
25
|
- gemfiles/rails_5.1.0.rc1.gemfile
|
26
|
+
matrix:
|
27
|
+
exclude:
|
28
|
+
- rvm: 2.4.0
|
29
|
+
gemfile: gemfiles/rails_4.0.0.gemfile
|
30
|
+
- rvm: 2.4.0
|
31
|
+
gemfile: gemfiles/rails_4.1.1.gemfile
|
32
|
+
- rvm: 2.4.0
|
33
|
+
gemfile: gemfiles/rails_4.2.0.gemfile
|
26
34
|
rvm:
|
27
35
|
- 2.2.2
|
28
36
|
- 2.2.5
|
@@ -30,5 +38,6 @@ rvm:
|
|
30
38
|
- 2.3.2
|
31
39
|
- 2.3.3
|
32
40
|
- 2.4.0
|
41
|
+
- 2.4.1
|
33
42
|
notifications:
|
34
43
|
email: false
|
@@ -5,6 +5,7 @@ require 'bundler/setup'
|
|
5
5
|
require 'active_support/core_ext/object/blank'
|
6
6
|
require 'active_support/core_ext/hash/keys'
|
7
7
|
require 'active_support/core_ext/array/extract_options'
|
8
|
+
require 'active_support/notifications'
|
8
9
|
|
9
10
|
require 'exception_notifier'
|
10
11
|
require 'exception_notification/rack'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require_relative './base'
|
2
|
+
module Subscribers
|
3
|
+
class Metrics < Base
|
4
|
+
|
5
|
+
def process
|
6
|
+
payload = event.payload
|
7
|
+
dur = event.duration
|
8
|
+
url = payload[:url]
|
9
|
+
http_method = payload[:method].to_s.upcase
|
10
|
+
$stderr.puts '[%s] %s %s (%.3f s)' % [url.host, http_method, url.request_uri, dur]
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
data/spec/test_notification.rb
CHANGED
@@ -17,4 +17,11 @@ end
|
|
17
17
|
|
18
18
|
require_relative '../lib/generators/asana_exception_notifier/templates/asana_exception_notifier'
|
19
19
|
exception = StandardError.new
|
20
|
+
|
21
|
+
require_relative './subscribers/metrics'
|
22
|
+
|
23
|
+
ActiveSupport::Notifications.subscribe('request.faraday') do |*args|
|
24
|
+
Subscribers::Metrics.new(*args)
|
25
|
+
end
|
26
|
+
|
20
27
|
ExceptionNotifier.notify_exception(exception, notifiers: :asana)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asana_exception_notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bogdanRada
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -412,6 +412,8 @@ files:
|
|
412
412
|
- gemfiles/rails_4.1.1.gemfile
|
413
413
|
- gemfiles/rails_4.2.0.gemfile
|
414
414
|
- gemfiles/rails_5.0.0.gemfile
|
415
|
+
- gemfiles/rails_5.0.2.gemfile
|
416
|
+
- gemfiles/rails_5.1.0.rc1.gemfile
|
415
417
|
- init.rb
|
416
418
|
- lib/asana_exception_notifier.rb
|
417
419
|
- lib/asana_exception_notifier/classes/asana.rb
|
@@ -428,6 +430,8 @@ files:
|
|
428
430
|
- lib/generators/asana_exception_notifier/templates/asana_exception_notifier.rb
|
429
431
|
- spec/lib/asana_exception_notifier/classes/asana_spec.rb
|
430
432
|
- spec/spec_helper.rb
|
433
|
+
- spec/subscribers/base.rb
|
434
|
+
- spec/subscribers/metrics.rb
|
431
435
|
- spec/test_notification.rb
|
432
436
|
homepage: http://github.com/bogdanRada/asana_exception_notifier
|
433
437
|
licenses:
|
@@ -451,7 +455,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
451
455
|
version: '2.4'
|
452
456
|
requirements: []
|
453
457
|
rubyforge_project:
|
454
|
-
rubygems_version: 2.6.
|
458
|
+
rubygems_version: 2.6.11
|
455
459
|
signing_key:
|
456
460
|
specification_version: 4
|
457
461
|
summary: Simple ruby implementation to send notifications to Asana when a exception
|
@@ -460,5 +464,7 @@ summary: Simple ruby implementation to send notifications to Asana when a except
|
|
460
464
|
test_files:
|
461
465
|
- spec/lib/asana_exception_notifier/classes/asana_spec.rb
|
462
466
|
- spec/spec_helper.rb
|
467
|
+
- spec/subscribers/base.rb
|
468
|
+
- spec/subscribers/metrics.rb
|
463
469
|
- spec/test_notification.rb
|
464
470
|
has_rdoc:
|