yell-adapters-syslog 2.0.0 → 2.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/yell/adapters/syslog.rb +3 -6
- data/spec/yell/adapters/syslog_spec.rb +9 -2
- data/yell-adapters-syslog.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88730ce89b2ddb2da08abc68b9df76876f4080a9
|
4
|
+
data.tar.gz: a47d08ef91a99c79e998f311cf5439a3404ddffe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ac647e566676fc28b5c606b45f1b2c28dff431d50f35afa645311ec3d98d5e5762ddd35b63ceef08f904a535ee52f87c8a0b892fdaaf8e8aa2e02065795fb3f
|
7
|
+
data.tar.gz: 04932c0bf3231e6e620c3d831413f9fe557051bd920bfbcbbd50132a81a700b82d5746fecdebe041c9d270ab6e511cd5a0b9e9a62f1ad3f0c9ab44bd064cce85
|
data/lib/yell/adapters/syslog.rb
CHANGED
@@ -169,13 +169,10 @@ module Yell #:nodoc:
|
|
169
169
|
|
170
170
|
def to_message( m )
|
171
171
|
message = m.to_s
|
172
|
-
message = message.dup if message.frozen?
|
173
172
|
|
174
|
-
message.strip
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
message
|
173
|
+
message.strip.
|
174
|
+
gsub(/%/, '%%'). # syslog(3) freaks on % (printf)
|
175
|
+
gsub(/\e\[[^m]*m/, '') # remove useless ansi color codes
|
179
176
|
end
|
180
177
|
|
181
178
|
end
|
@@ -120,11 +120,18 @@ describe Yell::Adapters::Syslog do
|
|
120
120
|
end
|
121
121
|
|
122
122
|
context :message do
|
123
|
-
|
123
|
+
let(:adapter) { Yell::Adapters::Syslog.new }
|
124
124
|
let(:event) { Yell::Event.new(logger, 1, "Hello World".freeze) }
|
125
125
|
|
126
126
|
it "formats frozen strings" do
|
127
|
-
expect {
|
127
|
+
expect { adapter.write event }.to_not raise_error
|
128
|
+
end
|
129
|
+
|
130
|
+
it "does not modify strings" do
|
131
|
+
event = Yell::Event.new(logger, 1, "%")
|
132
|
+
adapter.write(event)
|
133
|
+
|
134
|
+
event.messages.should == ["%"]
|
128
135
|
end
|
129
136
|
end
|
130
137
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yell-adapters-syslog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rudolf Schmidt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yell
|