logfmt 0.0.5 → 0.0.6
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 +6 -2
- data/lib/logfmt/version.rb +1 -1
- data/logfmt.gemspec +2 -3
- data/spec/logfmt/parser_spec.rb +5 -0
- data/spec/spec_helper.rb +0 -1
- metadata +6 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12311fc6d8f64e7c703b4d5ef3494ef51df9ad56
|
4
|
+
data.tar.gz: 8a3aa8fe3253121859df2c19eda8281e6dd2b599
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 845a530e2620fcf4eccabe54f715be1742cbe62996fbdb0ea020634fa9f21533620d44fd726921bc631980b89d28a615d604f647b45c1a770cf440520cea9939
|
7
|
+
data.tar.gz: 44c635fb1d2f7649821ebc15777acfca429246b9fe99c97ae686e3216f77132759e0baba61f9baf7b28d6d42a47ed647d18c5b65680595ccc23c271a1a56a259
|
data/lib/logfmt/parser.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
module Logfmt
|
3
2
|
GARBAGE = 0
|
4
3
|
KEY = 1
|
@@ -57,7 +56,12 @@ module Logfmt
|
|
57
56
|
state = GARBAGE
|
58
57
|
end
|
59
58
|
if i >= line.length
|
60
|
-
|
59
|
+
if integer?(value)
|
60
|
+
value = Integer(value)
|
61
|
+
elsif numeric?(value)
|
62
|
+
value = Float(value)
|
63
|
+
end
|
64
|
+
output[key.strip()] = value || true
|
61
65
|
end
|
62
66
|
next
|
63
67
|
end
|
data/lib/logfmt/version.rb
CHANGED
data/logfmt.gemspec
CHANGED
@@ -17,7 +17,6 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
18
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
19
|
gem.require_paths = ["lib"]
|
20
|
-
gem.
|
21
|
-
gem.add_development_dependency "
|
22
|
-
gem.add_development_dependency "rake", "~> 10.1"
|
20
|
+
gem.add_development_dependency "rspec", "~> 3.0"
|
21
|
+
gem.add_development_dependency "rake", "~> 10.3"
|
23
22
|
end
|
data/spec/logfmt/parser_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
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.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Timothée Peignier
|
@@ -10,48 +10,34 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2014-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: parslet
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.5'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.5'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: rspec
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
17
|
- - "~>"
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
19
|
+
version: '3.0'
|
34
20
|
type: :development
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
24
|
- - "~>"
|
39
25
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
26
|
+
version: '3.0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: rake
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
31
|
- - "~>"
|
46
32
|
- !ruby/object:Gem::Version
|
47
|
-
version: '10.
|
33
|
+
version: '10.3'
|
48
34
|
type: :development
|
49
35
|
prerelease: false
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
38
|
- - "~>"
|
53
39
|
- !ruby/object:Gem::Version
|
54
|
-
version: '10.
|
40
|
+
version: '10.3'
|
55
41
|
description: Parse log lines in the logfmt style.
|
56
42
|
email:
|
57
43
|
- timothee.peignier@tryphon.org
|
@@ -99,3 +85,4 @@ summary: Parse logfmt messages.
|
|
99
85
|
test_files:
|
100
86
|
- spec/logfmt/parser_spec.rb
|
101
87
|
- spec/spec_helper.rb
|
88
|
+
has_rdoc:
|