lookout-statsd 2.0.0 → 2.0.2

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: 09edd7854e30fe524a21a82dd325487e96c83a3b
4
- data.tar.gz: f7d047db68333414a84ec0bbdce59f0fcde041b1
3
+ metadata.gz: 2baad881d1608d20884a5a33b855672ae0847d30
4
+ data.tar.gz: 7f3f990fd0e4937862df3a2d5b061f5b6c01e09a
5
5
  SHA512:
6
- metadata.gz: 53190cf6ac482c34bde75b18f727f1b74904a5ef1bb837c3299e487bea532d164114a9625c5185254379c6a97ef8fec794d83e3fab89e0a10d4068e87909f0bd
7
- data.tar.gz: 36d9ce3ed7906da7d80226d9978a03873fe9502744eb234a3a73adbfe81af75ba159694c174566d5b75e3264014161ebbe13d08428dcf9aa1749a7441668bf5a
6
+ metadata.gz: 4b4c0dbf5031e165463694bd94fb11ff6134f6a98648bd0d727764c6ac9f03717af29fdc635f81c77d834f0e48b1a46251898320209fd2c5661a0c6edbeaccb3
7
+ data.tar.gz: 775570d1c333c71c6500d1826d7194e7c28521d92a398d0fe7df7d55b7b3a9c42bcc554693582b025962111d04d31210741164fcd7ea2ed93b19278c6aede06d
data/lib/statsd.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'socket'
2
2
  require 'resolv'
3
+ require 'forwardable'
3
4
 
4
5
  module Statsd
5
6
  # initialize singleton instance in an initializer
@@ -82,6 +83,10 @@ module Statsd
82
83
  })
83
84
  end
84
85
 
86
+ def send_data(*args)
87
+ @send_data.call(*args)
88
+ end
89
+
85
90
  # Creates and yields a Batch that can be used to batch instrument reports into
86
91
  # larger packets. Batches are sent either when the packet is "full" (defined
87
92
  # by batch_size), or when the block completes, whichever is the sooner.
data/spec/statsd_spec.rb CHANGED
@@ -18,10 +18,15 @@ describe Statsd do
18
18
  Statsd.instance.should_not be nil
19
19
  end
20
20
 
21
- it 'should raise if called twice' do
22
- Statsd.create_instance
23
- expect { Statsd.create_instance }.to raise_error
21
+ context 'if an instance has been created' do
22
+ before :each do
23
+ Statsd.create_instance
24
+ end
25
+ it 'should raise if called twice' do
26
+ expect { Statsd.create_instance }.to raise_error
27
+ end
24
28
  end
29
+
25
30
  end
26
31
 
27
32
  describe '#instance' do
data/statsd.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "lookout-statsd"
5
- s.version = "2.0.0"
5
+ s.version = "2.0.2"
6
6
  s.platform = Gem::Platform::RUBY
7
7
 
8
8
  s.authors = ['R. Tyler Croy', 'Andrew Coldham', 'Ben VandenBos']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lookout-statsd
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - R. Tyler Croy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-05-16 00:00:00.000000000 Z
13
+ date: 2016-05-18 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: A simple ruby statsd client.
16
16
  email:
@@ -51,7 +51,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
51
  version: 1.3.6
52
52
  requirements: []
53
53
  rubyforge_project:
54
- rubygems_version: 2.4.6
54
+ rubygems_version: 2.5.1
55
55
  signing_key:
56
56
  specification_version: 4
57
57
  summary: Ruby statsd client.