httplog 1.0.3 → 1.1.0

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: 171da0b013750ec91396725db8f43e91bfaa2044
4
- data.tar.gz: 16903e8cc554aff0a9548ce2ee954a1b0cc7217f
3
+ metadata.gz: a1a6bb62cffc8f365f925d280097d835de32fa39
4
+ data.tar.gz: a53f43593858933638a3bb12de772d4ed839edc6
5
5
  SHA512:
6
- metadata.gz: c68d8a348d96a068fcc72c53d76a7ff270a9fcb53f5bae5502b3f84cded30f3848f4e8a105208b70467c1ea9b50636604b16ca2849f75d3edc460b19f1c2d829
7
- data.tar.gz: 57e537dbd5ae1eb6d0b6fff9ba8e7e8a4c528e20b5b29a7d21157b4a47c3bd94feb7c49bc375ccb79256091704ff7792a0ed40f75378addf8a07b4ddd6e406ce
6
+ metadata.gz: 69ab458de0d89d1e2ee4c8e505adc1e969623455a83b27faeaeed59d194fa6fe09d09ab96fb7187accc4433f16682b4ef0e222080ff0fa5088f46e2bff6c33ae
7
+ data.tar.gz: 9602b2e29793e1d0cb358e59d0a105ed910a6e1de3b2f8f5e1f4aa3fd49cd2fc39fff5b76c521c581482e54aab354c644cd01f53210ed7b96240edc17608bfd4
@@ -1,3 +1,19 @@
1
+ ## 1.1.0 - 2018-06-22
2
+
3
+ * [#59](https://github.com/trusche/httplog/issues/59) Switched colorization library to MIT licensed [rainbow](https://github.com/sickill/rainbow).
4
+ This is not a breaking change, but if you currently use a color name that is not defined by the Rainbow gem, it will
5
+ simply be ignored.
6
+
7
+ ## 1.0.3 - 2018-04-26
8
+
9
+ * [#58](https://github.com/trusche/httplog/issues/58) Fixed decompression error for HTTPClient with `transparent_gzip_decompression` enabled.
10
+ * Rubocop!
11
+
12
+ ## 1.0.2 - 2018-02-26
13
+
14
+ * [#57](https://github.com/trusche/httplog/issues/57) Changed rack dependency to be less strict
15
+ * Updated travis to test against both major rack versions
16
+
1
17
  ## 1.0.1 - 2018-02-18
2
18
 
3
19
  * [#56](https://github.com/trusche/httplog/pull/56) Fixed data logging for httprb v3 ([@tycooon])
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- httplog (1.0.3)
5
- colorize (~> 0.8)
4
+ httplog (1.1.0)
6
5
  rack (>= 1.0)
6
+ rainbow (>= 2.0.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
@@ -11,7 +11,6 @@ GEM
11
11
  addressable (2.5.2)
12
12
  public_suffix (>= 2.0.2, < 4.0)
13
13
  coderay (1.1.2)
14
- colorize (0.8.1)
15
14
  daemons (1.2.6)
16
15
  diff-lcs (1.3)
17
16
  docile (1.1.5)
@@ -70,6 +69,7 @@ GEM
70
69
  method_source (~> 0.9.0)
71
70
  public_suffix (3.0.2)
72
71
  rack (2.0.4)
72
+ rainbow (3.0.0)
73
73
  rake (12.3.0)
74
74
  rb-fsevent (0.10.2)
75
75
  rb-inotify (0.9.10)
data/README.md CHANGED
@@ -94,11 +94,11 @@ You can colorize the output to make it stand out in your logfile:
94
94
 
95
95
  ```ruby
96
96
  HttpLog.configure do |config|
97
- config.color = {color: :black, background: :light_red}
97
+ config.color = {color: :black, background: :yellow}
98
98
  end
99
99
  ```
100
100
 
101
- For more color options [please refer to the colorize documentation](https://github.com/fazibear/colorize/blob/master/README.md)
101
+ For more color options please refer to the [rainbow documentation](https://github.com/sickill/rainbow)
102
102
 
103
103
  ### Compact logging
104
104
 
@@ -37,6 +37,7 @@ Gem::Specification.new do |gem|
37
37
  gem.add_development_dependency 'simplecov', ['~> 0.15']
38
38
  gem.add_development_dependency 'thin', ['~> 1.7']
39
39
 
40
- gem.add_dependency 'colorize', ['~> 0.8']
40
+ # gem.add_dependency 'colorize', ['~> 0.8']
41
+ gem.add_dependency 'rainbow', ['>= 2.0.0']
41
42
  gem.add_dependency 'rack', ['>= 1.0']
42
43
  end
@@ -3,7 +3,7 @@
3
3
  require 'net/http'
4
4
  require 'logger'
5
5
  require 'benchmark'
6
- require 'colorize'
6
+ require 'rainbow'
7
7
  require 'rack'
8
8
 
9
9
  module HttpLog
@@ -119,7 +119,10 @@ module HttpLog
119
119
 
120
120
  def colorize(msg)
121
121
  return msg unless config.color
122
- msg.send(:colorize, config.color)
122
+ Rainbow(msg).send(config.color)
123
+ rescue
124
+ warn "HTTPLOG CONFIGURATION ERROR: #{config.color} is not a valid color"
125
+ msg
123
126
  end
124
127
 
125
128
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HttpLog
4
- VERSION = '1.0.3'.freeze
4
+ VERSION = '1.1.0'.freeze
5
5
  end
@@ -42,7 +42,7 @@ describe HttpLog do
42
42
  expect(log).to include(HttpLog::LOG_PREFIX + 'Benchmark: ')
43
43
  expect(log).to include(HttpLog::LOG_PREFIX + "Response:#{adapter.expected_response_body}")
44
44
 
45
- expect(log.colorized?).to be_falsey
45
+ expect(log).to_not include("\e[0")
46
46
 
47
47
  expect(res).to be_a adapter.response if adapter.respond_to? :response
48
48
  end
@@ -100,7 +100,6 @@ describe HttpLog do
100
100
  expect(log).to include(HttpLog::LOG_PREFIX + 'Status: 200')
101
101
  expect(log).to include(HttpLog::LOG_PREFIX + 'Benchmark: ')
102
102
  expect(log).to include(HttpLog::LOG_PREFIX + "Response:#{adapter.expected_response_body}")
103
- expect(log.colorized?).to be_falsey
104
103
 
105
104
  expect(res).to be_a adapter.response if adapter.respond_to? :response
106
105
  end
@@ -205,7 +204,7 @@ describe HttpLog do
205
204
  it 'should colorized output' do
206
205
  HttpLog.configure { |c| c.color = :red }
207
206
  adapter.send_get_request
208
- expect(log.colorized?).to be_truthy
207
+ expect(log).to include("\e[0")
209
208
  end
210
209
 
211
210
  it 'should log with custom string prefix' do
@@ -259,12 +258,6 @@ describe HttpLog do
259
258
  adapter.send_post_request
260
259
  expect(log).to_not include(HttpLog::LOG_PREFIX + 'Benchmark:')
261
260
  end
262
-
263
- it 'should colorized output' do
264
- HttpLog.configure { |c| c.color = :red }
265
- adapter.send_post_request
266
- expect(log.colorized?).to be_truthy
267
- end
268
261
  end
269
262
  end
270
263
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httplog
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thilo Rusche
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-26 00:00:00.000000000 Z
11
+ date: 2018-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ethon
@@ -193,19 +193,19 @@ dependencies:
193
193
  - !ruby/object:Gem::Version
194
194
  version: '1.7'
195
195
  - !ruby/object:Gem::Dependency
196
- name: colorize
196
+ name: rainbow
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
- - - "~>"
199
+ - - ">="
200
200
  - !ruby/object:Gem::Version
201
- version: '0.8'
201
+ version: 2.0.0
202
202
  type: :runtime
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
- - - "~>"
206
+ - - ">="
207
207
  - !ruby/object:Gem::Version
208
- version: '0.8'
208
+ version: 2.0.0
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: rack
211
211
  requirement: !ruby/object:Gem::Requirement