syslog_protocol 0.9.1 → 0.9.2

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.
@@ -4,5 +4,5 @@ require 'syslog_protocol/logger'
4
4
  require 'syslog_protocol/parser'
5
5
 
6
6
  module SyslogProtocol
7
- VERSION = '0.9.1'
7
+ VERSION = '0.9.2'
8
8
  end
@@ -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) > 1024
17
- data = data.slice(0, 1024)
18
- while string_bytesize(data) > 1024
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
@@ -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.1'
16
+ s.version = '0.9.2'
17
17
  s.date = "2009-08-01"
18
18
  # s.rubyforge_project = 'syslog_protocol'
19
19
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 1
9
- version: 0.9.1
8
+ - 2
9
+ version: 0.9.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jake Douglas