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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0d84880517339f8a0d4e92bec5c50a60e1565616
4
- data.tar.gz: f49a8ab504c1c50312d585e3b4f2ed01d70bcf9c
2
+ SHA256:
3
+ metadata.gz: 460da978eb8342c65e74ebbd6cb5f2a37c71efb017c0f1d0a079a32c9e223ff4
4
+ data.tar.gz: 4b3f4e10f500fa728c459e3b99c68089bb4e3ad85d5ec9c4872d55add8772cf0
5
5
  SHA512:
6
- metadata.gz: c7880b117caee1ef7e794c04e59362db10076c58d58a28bbf360d9a71a56cc40cc089e7298f9a7f528a2bf3f304f1a45de68c9a24f2b419ff7afd3c8a4d3130d
7
- data.tar.gz: d4f7b9e924dbeed9ef56c8be8e1e3d3109ea6c8e96d52da77ad06b34c5098639c4e00a8c45a463f442fbc6b56fa4cea9fb8f9d7cc1e2be82a693c9f6ba4a7eee
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
@@ -57,7 +57,8 @@ module Logfmt
57
57
  if integer?(value)
58
58
  value = value.to_i
59
59
  elsif numeric?(value)
60
- value = value.to_f
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
- value = value.to_f
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
- value = value.to_f
84
+ fvalue = value.to_f
85
+ value = fvalue if fvalue.finite?
83
86
  end
84
87
  output[key.strip] = value
85
88
  end
@@ -1,3 +1,3 @@
1
1
  module Logfmt
2
- VERSION = '0.0.8'
2
+ VERSION = '0.0.9'
3
3
  end
@@ -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.8
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: 2016-12-31 00:00:00.000000000 Z
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
- rubyforge_project:
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.
@@ -1,6 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 1.9.3
4
- - 2.0.0
5
- - 2.1.1
6
- script: bundle exec rspec spec