datadog-notifications 0.3.0 → 0.3.1

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: fadcae3b1ef25818ba7aa40d9da48019e1ce3f40
4
- data.tar.gz: b64e1b4672ed2cfaea03590f1ba4fd7e1e6e2d1e
3
+ metadata.gz: b3d668af2da1cc25472d44d939c5da4dfba44d70
4
+ data.tar.gz: 6b7460e6c592e56d9a6e40be585fe906937cd747
5
5
  SHA512:
6
- metadata.gz: b4fb5671f2f94651db09531be28a407eddb4ab75cbcc8ccf36639fd01d40acd4eec2c335d4cd365c5611531c688b742b34871b73014440272c759ce894e4e505
7
- data.tar.gz: a7ae41851bfbbb16463b6f73d92f3e548147d22691819e6afd7416edb33a7669f501dba35ef268c3f7797f199ac41fdcb70fe4faaabbd8487653ab166d7be98d
6
+ metadata.gz: d735a792588b792d58b5b4ce1bae1ccb4dc078b8d309196cdd2e2681436c3f6514989bb2946a124adc8837bc1377de0658c9b1b591dc365798c318d557cf9515
7
+ data.tar.gz: f2682eda37b015a12c8605f1d924a6b1d09e2080201e0eff4f18858b4f1d3ad208f8b4da4649f6fdaff224eb56f58ae8a9be54c63c873f473b261124bdbfcadc
data/README.md CHANGED
@@ -25,6 +25,10 @@ Configure it in an initializer:
25
25
 
26
26
  For full configuration options, please see the [Documentation](http://www.rubydoc.info/gems/datadog-notifications).
27
27
 
28
+ ## Plugins
29
+
30
+ For a list of bundled plugins, please visit the [repository](https://github.com/bsm/datadog-notifications/tree/master/lib/datadog/notifications/plugins) page.
31
+
28
32
  ## Contributing
29
33
 
30
34
  1. Fork it
@@ -1,7 +1,7 @@
1
1
  module Datadog
2
2
  class Notifications
3
3
  class Config
4
- attr_accessor :hostname, :namespace, :tags, :statsd_host, :statsd_port, :reporter
4
+ attr_accessor :hostname, :namespace, :tags, :statsd_host, :statsd_port, :reporter, :plugins
5
5
 
6
6
  def initialize
7
7
  @hostname = ENV['INSTRUMENTATION_HOSTNAME'] || Socket.gethostname
@@ -14,14 +14,10 @@ module Datadog
14
14
 
15
15
  # Use a plugin
16
16
  def use(klass, opts = {})
17
- @plugins.push [klass, opts]
17
+ @plugins.push klass.new(opts)
18
18
  end
19
19
 
20
20
  def connect!
21
- @plugins.each do |klass, opts|
22
- klass.new(opts)
23
- end
24
-
25
21
  env = ENV['RACK_ENV'] || ENV['RAILS_ENV']
26
22
  tags.push("env:#{env}") if env && tags.none? {|t| t =~ /^env\:/ }
27
23
  tags.push("host:#{hostname}") if tags.none? {|t| t =~ /^host\:/ }
@@ -1,5 +1,5 @@
1
1
  module Datadog
2
2
  class Notifications
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
@@ -12,4 +12,10 @@ describe Datadog::Notifications::Config do
12
12
  expect(subject.tags).to eq(["custom:tag", "env:test", "host:test.host"])
13
13
  end
14
14
 
15
+ it 'should instantiate plugins on use' do
16
+ subject.use Datadog::Notifications::Plugins::ActionController
17
+ expect(subject.plugins.size).to eq(1)
18
+ expect(subject.plugins.first).to be_instance_of(Datadog::Notifications::Plugins::ActionController)
19
+ end
20
+
15
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datadog-notifications
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitrij Denissenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-08 00:00:00.000000000 Z
11
+ date: 2015-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport