logfmt 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/gempush.yml +24 -0
- data/.github/workflows/ruby.yml +19 -0
- data/lib/logfmt/parser.rb +6 -3
- data/lib/logfmt/version.rb +1 -1
- data/spec/logfmt/parser_spec.rb +5 -0
- metadata +5 -5
- data/.travis-ci.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 460da978eb8342c65e74ebbd6cb5f2a37c71efb017c0f1d0a079a32c9e223ff4
|
4
|
+
data.tar.gz: 4b3f4e10f500fa728c459e3b99c68089bb4e3ad85d5ec9c4872d55add8772cf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b21d607d999d3275e2f3aedaf0bc11d1f4daa7a51141f2df90367f225c113162f255c457ee854ac78f11fd43a7a9e33e24ef65b72d734bf31c8270dd6e9d3709
|
7
|
+
data.tar.gz: 5535f4b5ce7180c1e0c6263149da57ec8811b14146b92733f4b3f217f41f1fec5eb81bb49b26f62608471f9a9dcad86a0159ca78eec43886570e41b3e18999e8
|
@@ -0,0 +1,24 @@
|
|
1
|
+
name: Publish
|
2
|
+
on:
|
3
|
+
release:
|
4
|
+
types: [created]
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
name: Build + Publish
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
steps:
|
10
|
+
- uses: actions/checkout@master
|
11
|
+
- name: Set up Ruby 2.6
|
12
|
+
uses: actions/setup-ruby@v1
|
13
|
+
with:
|
14
|
+
version: 2.6.x
|
15
|
+
- name: Publish to RubyGems
|
16
|
+
run: |
|
17
|
+
mkdir -p $HOME/.gem
|
18
|
+
touch $HOME/.gem/credentials
|
19
|
+
chmod 0600 $HOME/.gem/credentials
|
20
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
21
|
+
gem build *.gemspec
|
22
|
+
gem push *.gem
|
23
|
+
env:
|
24
|
+
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
name: CI
|
2
|
+
on: [push]
|
3
|
+
jobs:
|
4
|
+
build:
|
5
|
+
runs-on: ubuntu-latest
|
6
|
+
strategy:
|
7
|
+
matrix:
|
8
|
+
ruby: [ '2.4', '2.5', '2.6' ]
|
9
|
+
steps:
|
10
|
+
- uses: actions/checkout@v1
|
11
|
+
- name: Set up Ruby
|
12
|
+
uses: actions/setup-ruby@v1
|
13
|
+
with:
|
14
|
+
ruby-version: ${{ matrix.ruby }}
|
15
|
+
- name: Run tests
|
16
|
+
run: |
|
17
|
+
gem install bundler
|
18
|
+
bundle install --jobs 4 --retry 3
|
19
|
+
bundle exec rspec spec
|
data/lib/logfmt/parser.rb
CHANGED
@@ -57,7 +57,8 @@ module Logfmt
|
|
57
57
|
if integer?(value)
|
58
58
|
value = value.to_i
|
59
59
|
elsif numeric?(value)
|
60
|
-
|
60
|
+
fvalue = value.to_f
|
61
|
+
value = fvalue if fvalue.finite?
|
61
62
|
end
|
62
63
|
output[key.strip] = value || true
|
63
64
|
end
|
@@ -68,7 +69,8 @@ module Logfmt
|
|
68
69
|
if integer?(value)
|
69
70
|
value = value.to_i
|
70
71
|
elsif numeric?(value)
|
71
|
-
|
72
|
+
fvalue = value.to_f
|
73
|
+
value = fvalue if fvalue.finite?
|
72
74
|
end
|
73
75
|
output[key.strip] = value
|
74
76
|
state = GARBAGE
|
@@ -79,7 +81,8 @@ module Logfmt
|
|
79
81
|
if integer?(value)
|
80
82
|
value = value.to_i
|
81
83
|
elsif numeric?(value)
|
82
|
-
|
84
|
+
fvalue = value.to_f
|
85
|
+
value = fvalue if fvalue.finite?
|
83
86
|
end
|
84
87
|
output[key.strip] = value
|
85
88
|
end
|
data/lib/logfmt/version.rb
CHANGED
data/spec/logfmt/parser_spec.rb
CHANGED
@@ -111,6 +111,11 @@ describe Logfmt do
|
|
111
111
|
expect(data['key'].class).to eq(Float)
|
112
112
|
end
|
113
113
|
|
114
|
+
it 'parse long digit string with embedded e as string' do
|
115
|
+
data = Logfmt.parse('key=2342342342342344e1818')
|
116
|
+
expect(data['key'].class).to eq(String)
|
117
|
+
end
|
118
|
+
|
114
119
|
it 'parse quoted integer as string type' do
|
115
120
|
data = Logfmt.parse('key="234"')
|
116
121
|
expect(data['key'].class).to eq(String)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Timothée Peignier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -45,9 +45,10 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
+
- ".github/workflows/gempush.yml"
|
49
|
+
- ".github/workflows/ruby.yml"
|
48
50
|
- ".gitignore"
|
49
51
|
- ".rspec"
|
50
|
-
- ".travis-ci.yml"
|
51
52
|
- Gemfile
|
52
53
|
- README.md
|
53
54
|
- Rakefile
|
@@ -77,8 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
78
|
- !ruby/object:Gem::Version
|
78
79
|
version: '0'
|
79
80
|
requirements: []
|
80
|
-
|
81
|
-
rubygems_version: 2.6.8
|
81
|
+
rubygems_version: 3.0.3
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
84
|
summary: Parse logfmt messages.
|