http_logger 0.7.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -8
- data/Gemfile.lock +46 -18
- data/Readme.md +25 -8
- data/http_logger.gemspec +6 -24
- data/lib/http_logger.rb +40 -40
- data/spec/http_logger_spec.rb +25 -23
- data/spec/spec_helper.rb +1 -1
- metadata +18 -5
- data/VERSION +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e5e25ba1ebb81a4e187ff3a60481249bd5b9d2795c02ff5470bd635f6b0e4f79
|
|
4
|
+
data.tar.gz: 99d08eec0c1be45a9db701d2190c7274dbae4ed998d757c7fa83949975d33dcd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c5adf4d6151c4b382ab63010be5468638ac4697eacec5ba2872676dca44e1dc6218b4683db11d734e0e5a46e480d78293f7079307bd4e0a26a9f21a38702dd58
|
|
7
|
+
data.tar.gz: 8437f529565c4e73969dc1ba17f7808b3ccaa03319064057a7254f0d8489cd99e718d832e87e37ca0d2a3052907730bf2a7309bfb2aba3d32be1c65909b9da49
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,40 +1,68 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
http_logger (1.0.0)
|
|
5
|
+
|
|
1
6
|
GEM
|
|
2
7
|
remote: http://rubygems.org/
|
|
3
8
|
specs:
|
|
4
|
-
addressable (2.
|
|
9
|
+
addressable (2.8.0)
|
|
10
|
+
public_suffix (>= 2.0.2, < 5.0)
|
|
5
11
|
bump (0.10.0)
|
|
6
|
-
byebug (11.1.3)
|
|
7
12
|
crack (0.4.5)
|
|
8
13
|
rexml
|
|
9
|
-
|
|
14
|
+
date (3.4.1)
|
|
15
|
+
debug (1.10.0)
|
|
16
|
+
irb (~> 1.10)
|
|
17
|
+
reline (>= 0.3.8)
|
|
18
|
+
diff-lcs (1.6.0)
|
|
10
19
|
hashdiff (1.0.1)
|
|
20
|
+
io-console (0.8.0)
|
|
21
|
+
irb (1.15.1)
|
|
22
|
+
pp (>= 0.6.0)
|
|
23
|
+
rdoc (>= 4.0.0)
|
|
24
|
+
reline (>= 0.4.2)
|
|
25
|
+
pp (0.6.2)
|
|
26
|
+
prettyprint
|
|
27
|
+
prettyprint (0.2.0)
|
|
28
|
+
psych (5.2.3)
|
|
29
|
+
date
|
|
30
|
+
stringio
|
|
31
|
+
public_suffix (4.0.6)
|
|
11
32
|
rake (13.0.6)
|
|
33
|
+
rdoc (6.12.0)
|
|
34
|
+
psych (>= 4.0.0)
|
|
35
|
+
reline (0.6.0)
|
|
36
|
+
io-console (~> 0.5)
|
|
12
37
|
rexml (3.2.5)
|
|
13
|
-
rspec (3.
|
|
14
|
-
rspec-core (~> 3.
|
|
15
|
-
rspec-expectations (~> 3.
|
|
16
|
-
rspec-mocks (~> 3.
|
|
17
|
-
rspec-core (3.
|
|
18
|
-
rspec-support (~> 3.
|
|
19
|
-
rspec-expectations (3.
|
|
38
|
+
rspec (3.13.0)
|
|
39
|
+
rspec-core (~> 3.13.0)
|
|
40
|
+
rspec-expectations (~> 3.13.0)
|
|
41
|
+
rspec-mocks (~> 3.13.0)
|
|
42
|
+
rspec-core (3.13.3)
|
|
43
|
+
rspec-support (~> 3.13.0)
|
|
44
|
+
rspec-expectations (3.13.3)
|
|
20
45
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
21
|
-
rspec-support (~> 3.
|
|
22
|
-
rspec-mocks (3.
|
|
46
|
+
rspec-support (~> 3.13.0)
|
|
47
|
+
rspec-mocks (3.13.2)
|
|
23
48
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
24
|
-
rspec-support (~> 3.
|
|
25
|
-
rspec-support (3.
|
|
26
|
-
|
|
27
|
-
|
|
49
|
+
rspec-support (~> 3.13.0)
|
|
50
|
+
rspec-support (3.13.2)
|
|
51
|
+
stringio (3.1.4)
|
|
52
|
+
webmock (3.14.0)
|
|
53
|
+
addressable (>= 2.8.0)
|
|
28
54
|
crack (>= 0.3.2)
|
|
29
55
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
30
56
|
|
|
31
57
|
PLATFORMS
|
|
58
|
+
arm64-darwin-23
|
|
32
59
|
x86_64-darwin-19
|
|
33
60
|
|
|
34
61
|
DEPENDENCIES
|
|
35
|
-
bump
|
|
62
|
+
bump
|
|
36
63
|
bundler
|
|
37
|
-
|
|
64
|
+
debug
|
|
65
|
+
http_logger!
|
|
38
66
|
rake
|
|
39
67
|
rspec
|
|
40
68
|
webmock
|
data/Readme.md
CHANGED
|
@@ -20,14 +20,31 @@ gem install http_logger
|
|
|
20
20
|
``` ruby
|
|
21
21
|
require 'http_logger'
|
|
22
22
|
|
|
23
|
-
HttpLogger.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
HttpLogger.configure do |c|
|
|
24
|
+
# defaults to Rails.logger if Rails is defined
|
|
25
|
+
c.logger = Logger.new(LOGFILE)
|
|
26
|
+
|
|
27
|
+
# Default: true
|
|
28
|
+
c.colorize = true
|
|
29
|
+
|
|
30
|
+
# Ignore patterns (e.g., URLs to ignore)
|
|
31
|
+
c.ignore = [/newrelic\.com/]
|
|
32
|
+
|
|
33
|
+
# Default: false
|
|
34
|
+
c.log_headers = false
|
|
35
|
+
|
|
36
|
+
# Default: true
|
|
37
|
+
c.log_request_body = false
|
|
38
|
+
|
|
39
|
+
# Default: true
|
|
40
|
+
c.log_response_body = false
|
|
41
|
+
|
|
42
|
+
# Desired log level as a symbol. Default: :debug
|
|
43
|
+
c.level = :info
|
|
44
|
+
|
|
45
|
+
# Change default truncate limit. Default: 5000
|
|
46
|
+
c.collapse_body_limit = 5000
|
|
47
|
+
end
|
|
31
48
|
```
|
|
32
49
|
|
|
33
50
|
## Alternative
|
data/http_logger.gemspec
CHANGED
|
@@ -25,7 +25,6 @@ Gem::Specification.new do |s|
|
|
|
25
25
|
"LICENSE.txt",
|
|
26
26
|
"Rakefile",
|
|
27
27
|
"Readme.md",
|
|
28
|
-
"VERSION",
|
|
29
28
|
"http_logger.gemspec",
|
|
30
29
|
"lib/http_logger.rb",
|
|
31
30
|
"screenshots/hoptoad.png",
|
|
@@ -39,28 +38,11 @@ Gem::Specification.new do |s|
|
|
|
39
38
|
s.rubygems_version = "2.7.8".freeze
|
|
40
39
|
s.summary = "Log your http api calls just like SQL queries".freeze
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
s.add_development_dependency(%q<rspec>.freeze, [">= 0"])
|
|
49
|
-
s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
|
|
50
|
-
s.add_development_dependency(%q<jeweler>.freeze, [">= 0"])
|
|
51
|
-
else
|
|
52
|
-
s.add_dependency(%q<byebug>.freeze, [">= 0"])
|
|
53
|
-
s.add_dependency(%q<webmock>.freeze, [">= 0"])
|
|
54
|
-
s.add_dependency(%q<rspec>.freeze, [">= 0"])
|
|
55
|
-
s.add_dependency(%q<bundler>.freeze, [">= 0"])
|
|
56
|
-
s.add_dependency(%q<jeweler>.freeze, [">= 0"])
|
|
57
|
-
end
|
|
58
|
-
else
|
|
59
|
-
s.add_dependency(%q<byebug>.freeze, [">= 0"])
|
|
60
|
-
s.add_dependency(%q<webmock>.freeze, [">= 0"])
|
|
61
|
-
s.add_dependency(%q<rspec>.freeze, [">= 0"])
|
|
62
|
-
s.add_dependency(%q<bundler>.freeze, [">= 0"])
|
|
63
|
-
s.add_dependency(%q<jeweler>.freeze, [">= 0"])
|
|
64
|
-
end
|
|
41
|
+
s.add_development_dependency(%q<debug>.freeze, [">= 0"])
|
|
42
|
+
s.add_development_dependency(%q<webmock>.freeze, [">= 0"])
|
|
43
|
+
s.add_development_dependency(%q<rspec>.freeze, [">= 0"])
|
|
44
|
+
s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
|
|
45
|
+
s.add_development_dependency(%q<bump>.freeze, [">= 0"])
|
|
46
|
+
s.add_development_dependency(%q<rake>.freeze, [">= 0"])
|
|
65
47
|
end
|
|
66
48
|
|
data/lib/http_logger.rb
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
require 'net/http'
|
|
2
2
|
require 'uri'
|
|
3
3
|
require 'set'
|
|
4
|
+
require 'http_logger/configuration'
|
|
4
5
|
|
|
5
6
|
# Usage:
|
|
6
7
|
#
|
|
@@ -8,8 +9,8 @@ require 'set'
|
|
|
8
9
|
#
|
|
9
10
|
# == Setup logger
|
|
10
11
|
#
|
|
11
|
-
# HttpLogger.logger = Logger.new('/tmp/all.log')
|
|
12
|
-
# HttpLogger.log_headers = true
|
|
12
|
+
# HttpLogger.configuration.logger = Logger.new('/tmp/all.log')
|
|
13
|
+
# HttpLogger.configuration.log_headers = true
|
|
13
14
|
#
|
|
14
15
|
# == Do request
|
|
15
16
|
#
|
|
@@ -24,24 +25,14 @@ require 'set'
|
|
|
24
25
|
class HttpLogger
|
|
25
26
|
AUTHORIZATION_HEADER = 'Authorization'
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
attr_accessor :level
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
self.log_headers = false
|
|
39
|
-
self.log_request_body = true
|
|
40
|
-
self.log_response_body = true
|
|
41
|
-
self.colorize = true
|
|
42
|
-
self.collapse_body_limit = 5000
|
|
43
|
-
self.ignore = []
|
|
44
|
-
self.level = :debug
|
|
28
|
+
def self.configuration
|
|
29
|
+
@configuration ||= Configuration.new
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def self.configure(&block)
|
|
33
|
+
block.call(configuration)
|
|
34
|
+
end
|
|
35
|
+
|
|
45
36
|
|
|
46
37
|
def self.perform(*args, &block)
|
|
47
38
|
instance.perform(*args, &block)
|
|
@@ -51,10 +42,6 @@ class HttpLogger
|
|
|
51
42
|
@instance ||= HttpLogger.new
|
|
52
43
|
end
|
|
53
44
|
|
|
54
|
-
def self.deprecate_config(option)
|
|
55
|
-
warn "Net::HTTP.#{option} is deprecated. Use HttpLogger.#{option} instead."
|
|
56
|
-
end
|
|
57
|
-
|
|
58
45
|
def perform(http, request, request_body)
|
|
59
46
|
start_time = Time.now
|
|
60
47
|
response = yield
|
|
@@ -66,13 +53,21 @@ class HttpLogger
|
|
|
66
53
|
if defined?(response) && response
|
|
67
54
|
log_response_code(response)
|
|
68
55
|
log_response_headers(response)
|
|
69
|
-
log_response_body(response.body)
|
|
56
|
+
log_response_body(response.body, binary_response?(response))
|
|
70
57
|
end
|
|
71
58
|
end
|
|
72
59
|
end
|
|
73
60
|
|
|
74
61
|
protected
|
|
75
62
|
|
|
63
|
+
def binary_response?(response)
|
|
64
|
+
content_type = response['Content-Type']
|
|
65
|
+
return false if content_type.nil?
|
|
66
|
+
|
|
67
|
+
!content_type.start_with?('text/', 'application/json', 'application/xml', 'application/javascript', 'application/x-www-form-urlencoded', 'application/xhtml+xml', 'application/rss+xml', 'application/atom+xml', 'application/svg+xml', 'application/yaml')
|
|
68
|
+
|
|
69
|
+
end
|
|
70
|
+
|
|
76
71
|
def log_request_url(http, request, start_time)
|
|
77
72
|
ofset = Time.now - start_time
|
|
78
73
|
log("HTTP #{request.method} (%0.2fms)" % (ofset * 1000), request_url(http, request))
|
|
@@ -83,7 +78,7 @@ class HttpLogger
|
|
|
83
78
|
end
|
|
84
79
|
|
|
85
80
|
def log_request_headers(request)
|
|
86
|
-
if
|
|
81
|
+
if configuration.log_headers
|
|
87
82
|
request.each_capitalized do |k,v|
|
|
88
83
|
log_header(:request, k, v)
|
|
89
84
|
end
|
|
@@ -98,7 +93,7 @@ class HttpLogger
|
|
|
98
93
|
HTTP_METHODS_WITH_BODY = Set.new(%w(POST PUT GET PATCH))
|
|
99
94
|
|
|
100
95
|
def log_request_body(request)
|
|
101
|
-
if
|
|
96
|
+
if configuration.log_request_body
|
|
102
97
|
if HTTP_METHODS_WITH_BODY.include?(request.method)
|
|
103
98
|
if (body = request.body) && !body.empty?
|
|
104
99
|
log("Request body", truncate_body(body))
|
|
@@ -112,33 +107,34 @@ class HttpLogger
|
|
|
112
107
|
end
|
|
113
108
|
|
|
114
109
|
def log_response_headers(response)
|
|
115
|
-
if
|
|
110
|
+
if configuration.log_headers
|
|
116
111
|
response.each_capitalized do |k,v|
|
|
117
112
|
log_header(:response, k, v)
|
|
118
113
|
end
|
|
119
114
|
end
|
|
120
115
|
end
|
|
121
116
|
|
|
122
|
-
def log_response_body(body)
|
|
123
|
-
if
|
|
117
|
+
def log_response_body(body, binary)
|
|
118
|
+
if configuration.log_response_body
|
|
124
119
|
if body.is_a?(Net::ReadAdapter)
|
|
125
120
|
log("Response body", "<impossible to log>")
|
|
126
121
|
else
|
|
127
122
|
if body && !body.empty?
|
|
128
|
-
log(
|
|
123
|
+
log(
|
|
124
|
+
"Response body",
|
|
125
|
+
binary ? "<binary #{body.length} bytes>" : truncate_body(body),)
|
|
129
126
|
end
|
|
130
127
|
end
|
|
131
128
|
end
|
|
132
129
|
end
|
|
133
130
|
|
|
134
131
|
def require_logging?(http, request)
|
|
135
|
-
|
|
136
132
|
self.logger && !ignored?(http, request) && (http.started? || webmock?(http, request))
|
|
137
133
|
end
|
|
138
134
|
|
|
139
135
|
def ignored?(http, request)
|
|
140
136
|
url = request_url(http, request)
|
|
141
|
-
|
|
137
|
+
configuration.ignore.any? do |pattern|
|
|
142
138
|
url =~ pattern
|
|
143
139
|
end
|
|
144
140
|
end
|
|
@@ -179,11 +175,11 @@ class HttpLogger
|
|
|
179
175
|
end
|
|
180
176
|
|
|
181
177
|
def log(message, dump)
|
|
182
|
-
self.logger.send(
|
|
178
|
+
self.logger.send(configuration.level, format_log_entry(message, dump))
|
|
183
179
|
end
|
|
184
180
|
|
|
185
181
|
def format_log_entry(message, dump = nil)
|
|
186
|
-
if
|
|
182
|
+
if configuration.colorize
|
|
187
183
|
message_color, dump_color = "4;32;1", "0;1"
|
|
188
184
|
log_entry = " \e[#{message_color}m#{message}\e[0m "
|
|
189
185
|
log_entry << "\e[#{dump_color}m%#{String === dump ? 's' : 'p'}\e[0m" % dump if dump
|
|
@@ -194,16 +190,19 @@ class HttpLogger
|
|
|
194
190
|
end
|
|
195
191
|
|
|
196
192
|
def logger
|
|
197
|
-
|
|
193
|
+
configuration.logger
|
|
198
194
|
end
|
|
199
195
|
|
|
200
196
|
def collapse_body_limit
|
|
201
|
-
|
|
197
|
+
configuration.collapse_body_limit
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
def configuration
|
|
201
|
+
self.class.configuration
|
|
202
202
|
end
|
|
203
203
|
end
|
|
204
204
|
|
|
205
205
|
block = lambda do |a|
|
|
206
|
-
# raise instance_methods.inspect
|
|
207
206
|
alias request_without_net_http_logger request
|
|
208
207
|
def request(request, body = nil, &block)
|
|
209
208
|
HttpLogger.perform(self, request, body) do
|
|
@@ -215,7 +214,6 @@ end
|
|
|
215
214
|
|
|
216
215
|
if defined?(::WebMock)
|
|
217
216
|
klass = WebMock::HttpLibAdapters::NetHttpAdapter.instance_variable_get("@webMockNetHTTP")
|
|
218
|
-
# raise klass.instance_methods.inspect
|
|
219
217
|
klass.class_eval(&block)
|
|
220
218
|
end
|
|
221
219
|
|
|
@@ -226,7 +224,9 @@ if defined?(Rails)
|
|
|
226
224
|
if defined?(ActiveSupport) && ActiveSupport.respond_to?(:on_load)
|
|
227
225
|
# Rails3
|
|
228
226
|
ActiveSupport.on_load(:after_initialize) do
|
|
229
|
-
|
|
227
|
+
unless HttpLogger.configuration.logger
|
|
228
|
+
HttpLogger.configuration.logger = Rails.logger
|
|
229
|
+
end
|
|
230
230
|
end
|
|
231
231
|
end
|
|
232
232
|
end
|
data/spec/http_logger_spec.rb
CHANGED
|
@@ -8,6 +8,7 @@ describe HttpLogger do
|
|
|
8
8
|
# flush log
|
|
9
9
|
f = File.open(LOGFILE, "w")
|
|
10
10
|
f.close
|
|
11
|
+
|
|
11
12
|
stub_request(:any, url).to_return(
|
|
12
13
|
body: response_body,
|
|
13
14
|
headers: {"X-Http-logger" => true, **response_headers},
|
|
@@ -48,7 +49,7 @@ describe HttpLogger do
|
|
|
48
49
|
context "when headers logging is on" do
|
|
49
50
|
|
|
50
51
|
before(:each) do
|
|
51
|
-
HttpLogger.log_headers = true
|
|
52
|
+
HttpLogger.configuration.log_headers = true
|
|
52
53
|
end
|
|
53
54
|
|
|
54
55
|
it { should include("HTTP response header") }
|
|
@@ -62,11 +63,6 @@ describe HttpLogger do
|
|
|
62
63
|
end
|
|
63
64
|
it { should include("Authorization: <filtered>") }
|
|
64
65
|
end
|
|
65
|
-
|
|
66
|
-
after(:each) do
|
|
67
|
-
HttpLogger.log_headers = false
|
|
68
|
-
end
|
|
69
|
-
|
|
70
66
|
end
|
|
71
67
|
|
|
72
68
|
describe "post request" do
|
|
@@ -116,7 +112,7 @@ describe HttpLogger do
|
|
|
116
112
|
context "when request body logging is off" do
|
|
117
113
|
|
|
118
114
|
before(:each) do
|
|
119
|
-
HttpLogger.log_request_body = false
|
|
115
|
+
HttpLogger.configuration.log_request_body = false
|
|
120
116
|
end
|
|
121
117
|
|
|
122
118
|
let(:request) do
|
|
@@ -125,9 +121,6 @@ describe HttpLogger do
|
|
|
125
121
|
|
|
126
122
|
it { should_not include("Request body") }
|
|
127
123
|
|
|
128
|
-
after(:each) do
|
|
129
|
-
HttpLogger.log_request_body = true
|
|
130
|
-
end
|
|
131
124
|
end
|
|
132
125
|
|
|
133
126
|
context "with long response body" do
|
|
@@ -147,7 +140,7 @@ describe HttpLogger do
|
|
|
147
140
|
context "when response body logging is off" do
|
|
148
141
|
|
|
149
142
|
before(:each) do
|
|
150
|
-
HttpLogger.log_response_body = false
|
|
143
|
+
HttpLogger.configuration.log_response_body = false
|
|
151
144
|
end
|
|
152
145
|
|
|
153
146
|
let(:response_body) { long_body }
|
|
@@ -156,10 +149,6 @@ describe HttpLogger do
|
|
|
156
149
|
end
|
|
157
150
|
|
|
158
151
|
it { should_not include("Response body") }
|
|
159
|
-
|
|
160
|
-
after(:each) do
|
|
161
|
-
HttpLogger.log_response_body = true
|
|
162
|
-
end
|
|
163
152
|
end
|
|
164
153
|
|
|
165
154
|
context "ignore option is set" do
|
|
@@ -169,14 +158,10 @@ describe HttpLogger do
|
|
|
169
158
|
end
|
|
170
159
|
|
|
171
160
|
before(:each) do
|
|
172
|
-
HttpLogger.ignore = [/rpm\.newrelic\.com/]
|
|
161
|
+
HttpLogger.configuration.ignore = [/rpm\.newrelic\.com/]
|
|
173
162
|
end
|
|
174
163
|
|
|
175
164
|
it { should be_empty}
|
|
176
|
-
|
|
177
|
-
after(:each) do
|
|
178
|
-
HttpLogger.ignore = []
|
|
179
|
-
end
|
|
180
165
|
end
|
|
181
166
|
|
|
182
167
|
context "when level is set" do
|
|
@@ -187,13 +172,30 @@ describe HttpLogger do
|
|
|
187
172
|
end
|
|
188
173
|
|
|
189
174
|
before(:each) do
|
|
190
|
-
HttpLogger.level = :info
|
|
175
|
+
HttpLogger.configuration.level = :info
|
|
191
176
|
end
|
|
192
177
|
|
|
193
178
|
it { should_not be_empty }
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
context "when binary response" do
|
|
182
|
+
let(:response_headers) do
|
|
183
|
+
{
|
|
184
|
+
'Content-Type' => 'image/webp'
|
|
185
|
+
}
|
|
186
|
+
end
|
|
187
|
+
let(:url) do
|
|
188
|
+
"http://example.com/image.webp"
|
|
189
|
+
end
|
|
194
190
|
|
|
195
|
-
|
|
196
|
-
|
|
191
|
+
let(:response_body) do
|
|
192
|
+
File.read("#{File.dirname(__FILE__)}/image.webp")
|
|
197
193
|
end
|
|
194
|
+
|
|
195
|
+
it { should include("<binary 41887 bytes>") }
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
after(:each) do
|
|
199
|
+
HttpLogger.configuration.reset
|
|
198
200
|
end
|
|
199
201
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: http_logger
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bogdan Gusiev
|
|
@@ -11,7 +11,7 @@ cert_chain: []
|
|
|
11
11
|
date: 2020-01-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
14
|
+
name: debug
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
@@ -67,7 +67,21 @@ dependencies:
|
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '0'
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
|
-
name:
|
|
70
|
+
name: bump
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '0'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ">="
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '0'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: rake
|
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
|
72
86
|
requirements:
|
|
73
87
|
- - ">="
|
|
@@ -95,7 +109,6 @@ files:
|
|
|
95
109
|
- LICENSE.txt
|
|
96
110
|
- Rakefile
|
|
97
111
|
- Readme.md
|
|
98
|
-
- VERSION
|
|
99
112
|
- http_logger.gemspec
|
|
100
113
|
- lib/http_logger.rb
|
|
101
114
|
- screenshots/hoptoad.png
|
|
@@ -122,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
122
135
|
- !ruby/object:Gem::Version
|
|
123
136
|
version: '0'
|
|
124
137
|
requirements: []
|
|
125
|
-
rubygems_version: 3.
|
|
138
|
+
rubygems_version: 3.5.11
|
|
126
139
|
signing_key:
|
|
127
140
|
specification_version: 4
|
|
128
141
|
summary: Log your http api calls just like SQL queries
|
data/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.7.0
|