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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 987baab2c19e3419f7ed92bf39a4eb2c9e9db095
4
- data.tar.gz: 50051eee353e6937fef99e2d449a151078569157
3
+ metadata.gz: d0e2467f89fb940d40b72a4020fc60bc084ae093
4
+ data.tar.gz: 69d59e6bf1673eaf2936f5c60f8c664ea0ec6be3
5
5
  SHA512:
6
- metadata.gz: f9ad1f598fc87e77bde6168f9763579785b7971efa3558057b50fffca9bbfedfc58179f87e24773907048ff22223889cac3086f143392f41918c9aaaa84c9be1
7
- data.tar.gz: 63b519bc7aa8cb4b0ccc6d878e62a556a89db81f3a21b994085614834913c44229fb2f62dfef04cea49e377dbbafe742a54c9b40c8d0c356c392bbb558488142
6
+ metadata.gz: f10493908ac4f93e1c70a49c000eb42a95f70f00eccfba4acb4899c0417c1717cd62a1131931816fafe400f1ab1661f0742ba299a1249823da959b32f8b18bd7
7
+ data.tar.gz: e60b8195018499b88aec8926a258a6502ad2f19463cad4a0a5efe26edac4e1d6dbb60e2e21fb189a45ab02a521b18dc9097fbede27e754832504d67738971e81
@@ -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
- Thread.new do
20
- tail_f event.absolute_name do |lines, queue|
21
- send_msg event.name, lines
22
- queue.stop if lines.include? config[:eof]
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
@@ -7,6 +7,7 @@ module FIR
7
7
  config = {
8
8
  url: "amqp://guest:guest@localhost:5672",
9
9
  queue: "log_line",
10
+ file_filter: ".log",
10
11
  eof: "END"
11
12
  }
12
13
  end
@@ -1,3 +1,3 @@
1
1
  module TailFRabbitmq
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tail_f_rabbitmq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - atpking