syslog_protocol 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/syslog_protocol.rb +1 -1
- data/lib/syslog_protocol/packet.rb +4 -4
- data/syslog_protocol.gemspec +1 -1
- metadata +2 -2
data/lib/syslog_protocol.rb
CHANGED
@@ -7,15 +7,15 @@ module SyslogProtocol
|
|
7
7
|
assemble
|
8
8
|
end
|
9
9
|
|
10
|
-
def assemble
|
10
|
+
def assemble(max_size = 1024)
|
11
11
|
unless @hostname and @facility and @severity and @tag
|
12
12
|
raise "Could not assemble packet without hostname, tag, facility, and severity"
|
13
13
|
end
|
14
14
|
data = "<#{pri}>#{generate_timestamp} #{@hostname} #{@tag}: #{@content}"
|
15
15
|
|
16
|
-
if string_bytesize(data) >
|
17
|
-
data = data.slice(0,
|
18
|
-
while string_bytesize(data) >
|
16
|
+
if string_bytesize(data) > max_size
|
17
|
+
data = data.slice(0, max_size)
|
18
|
+
while string_bytesize(data) > max_size
|
19
19
|
data = data.slice(0, data.length - 1)
|
20
20
|
end
|
21
21
|
end
|
data/syslog_protocol.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
14
14
|
## the sub! line in the Rakefile
|
15
15
|
s.name = 'syslog_protocol'
|
16
|
-
s.version = '0.9.
|
16
|
+
s.version = '0.9.2'
|
17
17
|
s.date = "2009-08-01"
|
18
18
|
# s.rubyforge_project = 'syslog_protocol'
|
19
19
|
|