logfmt 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logfmt/parser.rb +3 -0
- data/lib/logfmt/version.rb +1 -1
- data/spec/logfmt/parser_spec.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a31f473ee9fde670a1d317e2475c4d2b53f3c4b1
|
4
|
+
data.tar.gz: 07bd647465be8fa975fa9139be574f3ab7210734
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c2a583a06066f3685852a2cc843abef98d6db3006598c40b832e4ddb5a6cc5c4363c83ee69495a55ce78936a51c685f2d9a1fb1f1df78448f5b50ad2b8e4c91
|
7
|
+
data.tar.gz: a80d757664e17b368cdfb25acf45335e46f9aabd55790bb0201f32ea3d56c07e7b5d0f8f0b62bae7aa2f024bc3838302ee4260e73e4c9ff391418202f3eb769f
|
data/lib/logfmt/parser.rb
CHANGED
@@ -27,6 +27,9 @@ module Logfmt
|
|
27
27
|
rule(:pair => { :key => simple(:key), :value => simple(:val) }) {
|
28
28
|
Pair.new(key.to_sym, val.to_s)
|
29
29
|
}
|
30
|
+
rule(:pair => { :key => simple(:key), :value => sequence(:val) }) {
|
31
|
+
Pair.new(key.to_sym, "")
|
32
|
+
}
|
30
33
|
rule(:pair => { :key => simple(:key) }) {
|
31
34
|
Pair.new(key.to_sym, true)
|
32
35
|
}
|
data/lib/logfmt/version.rb
CHANGED
data/spec/logfmt/parser_spec.rb
CHANGED
@@ -66,4 +66,9 @@ describe Logfmt::Parser do
|
|
66
66
|
data = Logfmt.parse('foo=bar a=14 baz="hello kitty" cool%story=bro f %^asdf')
|
67
67
|
expect(data).to eq({:foo => "bar", :a => "14", :baz => "hello kitty", :"cool%story" => "bro", :f => true, :"%^asdf" => true})
|
68
68
|
end
|
69
|
+
|
70
|
+
it 'parse pair with empty quote' do
|
71
|
+
data = Logfmt.parse('key=""')
|
72
|
+
expect(data).to eq({:key => ""})
|
73
|
+
end
|
69
74
|
end
|