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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71bca5314e35a8e30c555b09231fd32ddef95503
4
- data.tar.gz: a1e7abc78f3cb2a97ab3c2278e76b9f88861fdb4
3
+ metadata.gz: a31f473ee9fde670a1d317e2475c4d2b53f3c4b1
4
+ data.tar.gz: 07bd647465be8fa975fa9139be574f3ab7210734
5
5
  SHA512:
6
- metadata.gz: 8890f4c1f6ea9f08c63429c4ca48746a9d56a57d64cecb9181c30795255e27b345a394f21c16bbe37e600692f3a4e49caa46f10f4f05b457d50cd169a9cae4f8
7
- data.tar.gz: f3d70fc871a656525b8d866c02f30140d6550d662c3ad3d009bd180a22846aa1b6c3d3bff63cfbc5a814b5357c9a82a259aa29d792160c74de8216301199b41c
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
  }
@@ -1,3 +1,3 @@
1
1
  module Logfmt
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logfmt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timothée Peignier