riemann-babbler 1.3.0 → 1.3.1

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.
@@ -21,3 +21,21 @@ module Beefcake
21
21
 
22
22
  end
23
23
  end
24
+
25
+ class IO
26
+ TAIL_BUF_LENGTH = 1 << 16
27
+
28
+ def tail(n)
29
+ return [] if n < 1
30
+
31
+ seek -TAIL_BUF_LENGTH, SEEK_END
32
+
33
+ buf = ""
34
+ while buf.count("\n") <= n
35
+ buf = read(TAIL_BUF_LENGTH) + buf
36
+ seek 2 * -TAIL_BUF_LENGTH, SEEK_CUR
37
+ end
38
+
39
+ buf.split("\n")[-n..-1]
40
+ end
41
+ end
@@ -1,5 +1,5 @@
1
1
  module Riemann
2
2
  class Babbler
3
- VERSION = '1.3.0'
3
+ VERSION = '1.3.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riemann-babbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-02 00:00:00.000000000 Z
12
+ date: 2013-09-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: riemann-client