tail_f_rabbitmq 0.1.0 → 0.1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tail_f_rabbitmq/util.rb +7 -4
- data/lib/tail_f_rabbitmq/util/config.rb +1 -0
- data/lib/tail_f_rabbitmq/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0e2467f89fb940d40b72a4020fc60bc084ae093
|
4
|
+
data.tar.gz: 69d59e6bf1673eaf2936f5c60f8c664ea0ec6be3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f10493908ac4f93e1c70a49c000eb42a95f70f00eccfba4acb4899c0417c1717cd62a1131931816fafe400f1ab1661f0742ba299a1249823da959b32f8b18bd7
|
7
|
+
data.tar.gz: e60b8195018499b88aec8926a258a6502ad2f19463cad4a0a5efe26edac4e1d6dbb60e2e21fb189a45ab02a521b18dc9097fbede27e754832504d67738971e81
|
data/lib/tail_f_rabbitmq/util.rb
CHANGED
@@ -15,11 +15,14 @@ module FIR
|
|
15
15
|
@q = @ch.queue(config[:queue], :auto_delete => true)
|
16
16
|
@x = @ch.default_exchange
|
17
17
|
notifier = INotify::Notifier.new
|
18
|
+
file_filter = config[:file_filter]
|
18
19
|
notifier.watch file_path, :create, :recursive do |event|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
if file_filter.nil? or event.name.end_with? file_filter
|
21
|
+
Thread.new do
|
22
|
+
tail_f event.absolute_name do |lines, queue|
|
23
|
+
send_msg event.name, lines
|
24
|
+
queue.stop if lines.include? config[:eof]
|
25
|
+
end
|
23
26
|
end
|
24
27
|
end
|
25
28
|
end
|