rack-ltsv_logger 0.1.0 → 0.1.1

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: abb79ce504f7948a99b0358ecc7d7a4ea464abc5
4
- data.tar.gz: bf72dd81bfc4395262ad82f6b4ff4b3f48d20a4c
2
+ SHA256:
3
+ metadata.gz: 3a58e6c432c0ef84714600fe7b8f43f118f3f9723a8ce19a617f6c7d20e1cd78
4
+ data.tar.gz: ca82e43f236e1a5f74aa5d5fb6fc6bbda38fc88e120d66184642cc2c59e8d10d
5
5
  SHA512:
6
- metadata.gz: 0be7eaad187f30bac8aa20aed3f5a8365ec4e392c682358636c6a70d33cf8e13a921fd443127ae369f7ed2fa29261e3965f2ada514627d23b92ec26bb6b283b6
7
- data.tar.gz: 75760dc1f2cf6ae4f35c7251492ced1891f5dc14ca06bba9aee4f73f30397dad5591229600406f80385f2be94411d1d6bd6c325584fc07b51f0e12550565c818
6
+ metadata.gz: 92e88510131a16f9a8226ad4ecf0be53d86c6484e1df4bc37abae421484998dbed82181852304fd6e759fb17a160fc114770bac59e5e76f9950ff780fb1df4f7
7
+ data.tar.gz: b01a48fe0fe04ec5d0237498e78392186201b1663bcce41d5daf96291664f24ebc98688f461a8cb80d6caf81ef7555a7e6ccfa02a7fd3e7f76700826fac7cfaa
@@ -1,3 +1,9 @@
1
+ ## 0.1.1 (2019/02/08)
2
+
3
+ Fixes:
4
+
5
+ * Status field includes exactly 3 chracters (thanks to SpringMT)
6
+
1
7
  ## 0.1.0 (2017/11/26)
2
8
 
3
9
  Enhancements:
@@ -43,7 +43,7 @@ module Rack
43
43
  end
44
44
 
45
45
  def self.extract_status(status)
46
- status.nil? ? "500" : status.to_s[0..3]
46
+ status.nil? ? "500" : status.to_s[0..2]
47
47
  end
48
48
 
49
49
  private
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "rack-ltsv_logger"
7
- spec.version = "0.1.0"
7
+ spec.version = "0.1.1"
8
8
  spec.authors = ["Naotoshi Seo"]
9
9
  spec.email = ["sonots@gmail.com"]
10
10
  spec.description = %q{A rack middleware to output access log in ltsv format}
@@ -122,4 +122,20 @@ describe Rack::LtsvLogger do
122
122
  expect(params['status']).to eq('500')
123
123
  end
124
124
  end
125
+
126
+ context 'when app returns invalid http status code' do
127
+ subject do
128
+ @output = StringIO.new
129
+ invalid_status_code_app = lambda do |env|
130
+ [2000, {'Content-Type' => 'text/plain'}, ["Hello, World!"]]
131
+ end
132
+ Rack::Lint.new( Rack::LtsvLogger.new(invalid_status_code_app, @output) )
133
+ end
134
+
135
+ it 'GET /get' do
136
+ Rack::MockRequest.new(subject).get('/get', env)
137
+ params = parse_ltsv(@output.string)
138
+ expect(params['status']).to eq '200'
139
+ end
140
+ end
125
141
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-ltsv_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-25 00:00:00.000000000 Z
11
+ date: 2019-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -150,8 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  - !ruby/object:Gem::Version
151
151
  version: '0'
152
152
  requirements: []
153
- rubyforge_project:
154
- rubygems_version: 2.6.13
153
+ rubygems_version: 3.0.1
155
154
  signing_key:
156
155
  specification_version: 4
157
156
  summary: A rack middleware to output access log in ltsv format.