app_monit_rails 0.0.4 → 0.0.5

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: 2e16e8914f679acb64fd2832699c439c6878eb0d
4
- data.tar.gz: e0ed46dbce520e13f945b24fb2426a71845a6580
3
+ metadata.gz: eb1724eff0a8a6db03cde1ea08f481e47cb239bc
4
+ data.tar.gz: 1bd0c496c14de1fcbf1a72e91e7a6977df01ff39
5
5
  SHA512:
6
- metadata.gz: 4a7bfcdbed0582d77d103bb9de8ac428b12bca2f6e93b5d89a22916d294a894c566824d63d8a6f8149070c20795763b2d3ed7d23cc1daa9a814a5edd70a10edb
7
- data.tar.gz: 6e48300dd255c950dc2bef186e86afa67ffbbbdd42c2cff751b42df6492e0b4ff037db7a81bebd1881689057225d1ad85b9178bcaf52bfee8962f72843e78417
6
+ metadata.gz: dc972ac156d93b261f7d64875ad2e24b1e5427f85372fc1b2e239f750c20fa53c668fc5e3cf570fa6e7c0d748c2eb90e2d3f7356eb3bf56f2542cbd7ce02f18f
7
+ data.tar.gz: 3696cb54137a9fab27ba798f7ff13ba6dd1ad6100c54c9605b8dc0f75c31582b40060441306ea88de5c07f2ea51fe4f0a1bf2aeeb5f7045de18fb5d07c736e5f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- app_monit_rails (0.0.3)
4
+ app_monit_rails (0.0.4)
5
5
  app_monit (>= 0.0.7)
6
6
 
7
7
  GEM
@@ -2,7 +2,7 @@ module AppMonit
2
2
  module Rails
3
3
  class Config
4
4
  class << self
5
- attr_writer :enabled
5
+ attr_writer :enabled, :name, :skipped_endpoints
6
6
 
7
7
  def enabled?
8
8
  @enabled.nil? ? ::Rails.env != "test" : @enabled
@@ -11,6 +11,10 @@ module AppMonit
11
11
  def name
12
12
  @name.nil? ? ::Rails.application.class.parent_name : @name
13
13
  end
14
+
15
+ def skipped_endpoints
16
+ @skipped_endpoints ||= []
17
+ end
14
18
  end
15
19
  end
16
20
  end
@@ -13,6 +13,9 @@ module AppMonit
13
13
 
14
14
  payload = event.payload
15
15
  endpoint = "#{payload[:controller]}##{payload[:action]}"
16
+
17
+ return if AppMonit::Rails::Config.skipped_endpoints.include?(endpoint)
18
+
16
19
  minute = event.time.to_i - (event.time.to_i % 60)
17
20
 
18
21
  if payload[:exception]
@@ -1,5 +1,5 @@
1
1
  module AppMonit
2
2
  module Rails
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -50,6 +50,10 @@ class PostsController < ApplicationController
50
50
  raise 'Exception'
51
51
  end
52
52
 
53
+ def skipped
54
+ render text: 'skipped'
55
+ end
56
+
53
57
  private
54
58
  # Use callbacks to share common setup or constraints between actions.
55
59
  def set_post
@@ -1,5 +1,8 @@
1
1
  Dummy::Application.routes.draw do
2
2
  resources :posts do
3
- get :with_exception, on: :collection
3
+ collection do
4
+ get :with_exception
5
+ get :skipped
6
+ end
4
7
  end
5
8
  end
@@ -5,6 +5,7 @@ feature 'Triggered events' do
5
5
  AppMonit::Config.end_point = 'http://test.local'
6
6
  AppMonit::Config.api_key = 'api_key'
7
7
  AppMonit::Config.env = 'test'
8
+ AppMonit::Rails::Config.skipped_endpoints = %w(PostsController#skipped)
8
9
 
9
10
  10.times do
10
11
  visit '/posts/'
@@ -34,6 +35,8 @@ feature 'Triggered events' do
34
35
  visit '/posts/with_exception'
35
36
  }.to raise_error
36
37
 
38
+ visit '/posts/skipped'
39
+
37
40
  @worker = AppMonit::Rails::Worker.instance
38
41
  @worker.push(:flush)
39
42
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_monit_rails
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
  - Redmar Kerkhoff
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-27 00:00:00.000000000 Z
12
+ date: 2014-11-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: app_monit