ducksboard_reporter 0.1.4 → 0.1.5
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 +4 -4
- data/example_config.yml +1 -1
- data/lib/ducksboard_reporter/file_tail.rb +9 -5
- data/lib/ducksboard_reporter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 55064babfaea0c586bfb00ce8e78bf3ea30a66d5
|
|
4
|
+
data.tar.gz: 01d526c95693b104c8ab3e62364e761572e4e45d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6cd9f1809ab873bb55d686d29961d251b9813b753648ba556eb04d144d4a58123e6b5a3f64604ceb2390b573eeec9f7c5f0d95ed5b8808b81d421b533a3d3352
|
|
7
|
+
data.tar.gz: 01eff8227e66cd9539ea8aecf04468975b3b4acb0ffc729b57fe3ec069c5822ff8349b842ab72942c812ee704558df6b27655510d698cddf27ae6af7daad0a29
|
data/example_config.yml
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
module DucksboardReporter
|
|
2
2
|
class FileTail
|
|
3
|
+
include Celluloid::Logger
|
|
3
4
|
|
|
4
5
|
attr_accessor :value, :timestamp, :name, :options
|
|
5
6
|
|
|
@@ -23,10 +24,6 @@ module DucksboardReporter
|
|
|
23
24
|
retry
|
|
24
25
|
end
|
|
25
26
|
|
|
26
|
-
def every_second(&block)
|
|
27
|
-
@every_second_block = block
|
|
28
|
-
end
|
|
29
|
-
|
|
30
27
|
def on_line(&block)
|
|
31
28
|
@line_block = block
|
|
32
29
|
end
|
|
@@ -35,15 +32,22 @@ module DucksboardReporter
|
|
|
35
32
|
|
|
36
33
|
def open_file
|
|
37
34
|
if @file && !@file.closed?
|
|
38
|
-
if File.stat(@path).ino == @file.stat.ino
|
|
35
|
+
if (new_inode = File.stat(@path).ino) == @file.stat.ino
|
|
39
36
|
return
|
|
40
37
|
else
|
|
38
|
+
debug(log_format("Inode changed (#{@file.stat.ino} => #{new_inode}). Reopening file."))
|
|
41
39
|
@file.close
|
|
42
40
|
end
|
|
43
41
|
end
|
|
44
42
|
|
|
45
43
|
@file = File.open(@path, "r")
|
|
46
44
|
@file.seek(0, IO::SEEK_END)
|
|
45
|
+
debug(log_format("Tailing file with inode #{@file.stat.ino}"))
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def log_format(msg)
|
|
49
|
+
@log_prefix ||= "FileTail (#{@path}): "
|
|
50
|
+
@log_prefix + msg
|
|
47
51
|
end
|
|
48
52
|
end
|
|
49
53
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ducksboard_reporter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- unnu
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-10-
|
|
11
|
+
date: 2014-10-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|