logflume 0.0.5 → 0.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 877e7a5c6750616ecbadd59bb0fd6dcd76fe1c65
4
- data.tar.gz: af5ee0f0243c0b6606c37fff9576dcd20f31d2e6
3
+ metadata.gz: b9da57924e169b16d9a60e2c2bfcb2a064616c20
4
+ data.tar.gz: a30c52e9ab1f24dbb61723f5b5c79f5511298b58
5
5
  SHA512:
6
- metadata.gz: 5b755e2175e2358ff20d19f089c66c891cae52e8b30fb2a433503940b533d9bf0d259d75653b3cc935d1571eb56321fc290f9c35c0c13302a5950b01cb387c0d
7
- data.tar.gz: 1b1205f307321df527de9c98480982fed1c60567e853276112ac88c9daeee8979e6d7d7d7adacf5cd2458e0207402a3cfaec33ff26958517932f6f0f8d20853a
6
+ metadata.gz: 9903e43a942a5e853d8baf4897e522a20657c48dc30e0632076a97c4aa4916e4ea669d0fc677c0a41898dd5de8d9d96b7488a38e29c63af11041011cd53aeb20
7
+ data.tar.gz: d9a62e4417d339397d7fe48cd177a73aa7e890bb36ea5cfc7803387d2eb0a8551173d514ec6e55da79ac9cfd94f907a6d643f88c79781946dc449a22686c86c6
@@ -106,8 +106,8 @@ module Logflume
106
106
  mytime = Time.now
107
107
  #template("$SOURCEIP|$FACILITY|$PRIORITY|$LEVEL|$TAG|$YEAR-$MONTH-$DAY|$HOUR:$MIN:$SEC|$PROGRAM| $MSG\n")
108
108
  #@syslog_priority = @syslog_facility * 8 + @syslog_severity
109
- ymd = a.strftime("%Y-%M-%d")
110
- hms = a.strftime("%H:%m:%S")
109
+ ymd = mytime.strftime("%Y-%M-%d")
110
+ hms = mytime.strftime("%H:%m:%S")
111
111
  @tag = "logflume"
112
112
  return "#{@syslog_sourceip}|#{@syslog_facility}|#{@syslog_priority}|#{@syslog_level}|#{@tag}|#{ymd}|#{hms}|#{@syslog_progname}| "
113
113
  end
@@ -1,3 +1,3 @@
1
1
  module Logflume
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
@@ -12,9 +12,33 @@ describe Logflume do
12
12
  flume.shutdown
13
13
  end
14
14
 
15
+ it 'handles fifo pipes' do
16
+ flume = Logflume::Flume.new
17
+ flume.dir='spec/data/flume'
18
+ flume.glob='*.log'
19
+ flume.pipe="/tmp/tmp.flume.#{$$}.fifo"
20
+ flume.logger = Logger.new('/dev/null')
21
+ expect(flume.start.class.to_s).to eq 'DirectoryWatcher'
22
+ flume.shutdown
23
+ end
24
+
25
+ it 'prepends syslog when instructed when making a pipe' do
26
+ flume = Logflume::Flume.new
27
+ flume.dir='spec/data/flume'
28
+ flume.glob='*.log'
29
+ flume.pipe="/tmp/tmp.flume.#{$$}.fifo"
30
+ flume.logger = Logger.new('/dev/null')
31
+ flume.prefix_syslog=true
32
+ flume.syslog_progname="dpkg"
33
+ #flume.blocking = true
34
+ expect(flume.start.class.to_s).to eq 'DirectoryWatcher'
35
+ sleep(10) ## We need to ba able to catch PROC errors here..
36
+ flume.shutdown
37
+ end
38
+
15
39
  it 'should raise an InvalidDirectory Error' do
16
40
  flume = Logflume::Flume.new
17
- flume.dir='spec/data/flumex'
41
+ flume.dir='spec/data/missingdirectory'
18
42
  flume.glob='*.log'
19
43
  expect{flume.start}.to raise_error(Logflume::InvalidDirectory)
20
44
  end
@@ -27,7 +51,7 @@ describe Logflume do
27
51
  flume.start
28
52
  #FileUtils.touch('spec/data/flume/test.log')
29
53
  expect(flume.shutdown).to eq true
30
-
54
+
31
55
  end
32
56
 
33
- end
57
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logflume
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shadowbq