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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 989b23b96e1eab01153b6d7e359077e7a3e3ed80
4
- data.tar.gz: 19895de16def64d43cb1ead66bee725fcd74253e
3
+ metadata.gz: 8f6ee9a9b16fea7666f912b854ea429b629566dc
4
+ data.tar.gz: 5a5e67365a9f34b955edc7fe4402755d09764040
5
5
  SHA512:
6
- metadata.gz: c3fb87ce8805a0dc8af5bfa579b413e88440bdd3d7595f4eb331543befd04d708cbe86fcdb07b4bbd46ff2a104d3950a724fdc89859ef3ebb481cf527e6c07d8
7
- data.tar.gz: e3b434a2244c4e5375edbdb5ce0595d53b75746f38d1abeace9482446c9d49664559f688c0474631f2c6da0041ef9f53086e97b92705b7dcb28fd9300e2b881f
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
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "rails", "5.0.2"
6
+ gem "rails-controller-testing"
7
+
8
+ gemspec :path => "../"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "rails", "5.1.0.rc1"
6
+ gem "rails-controller-testing"
7
+
8
+ gemspec :path => "../"
@@ -79,7 +79,9 @@ module ExceptionNotifier
79
79
  def faraday_configuration(config)
80
80
  config.configure_faraday do |conn|
81
81
  conn.request :url_encoded
82
+ conn.use :instrumentation
82
83
  conn.response :logger
84
+ conn.response :follow_redirects
83
85
  end
84
86
  end
85
87
 
@@ -16,9 +16,9 @@ module AsanaExceptionNotifier
16
16
  # major release version
17
17
  MAJOR = 1
18
18
  # minor release version
19
- MINOR = 0
19
+ MINOR = 1
20
20
  # tiny release version
21
- TINY = 2
21
+ TINY = 0
22
22
  # prelease version ( set this only if it is a prelease)
23
23
  PRE = nil
24
24
 
@@ -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,16 @@
1
+ module Subscribers
2
+ class Base
3
+
4
+ attr_reader :event
5
+
6
+ def initialize(*args)
7
+ @event = ActiveSupport::Notifications::Event.new(*args)
8
+ process
9
+ end
10
+
11
+ def process
12
+ raise NotImplementedError
13
+ end
14
+
15
+ end
16
+ end
@@ -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
@@ -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.2
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-03-21 00:00:00.000000000 Z
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.8
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: