httplog 0.0.4 → 0.0.5
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.
- data/lib/httplog/http_log.rb +11 -6
- data/lib/httplog/version.rb +1 -1
- metadata +2 -2
data/lib/httplog/http_log.rb
CHANGED
@@ -27,12 +27,17 @@ module Net
|
|
27
27
|
|
28
28
|
def request(req, body = nil, &block)
|
29
29
|
|
30
|
-
if
|
31
|
-
HttpLog
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
HttpLog
|
30
|
+
if started?
|
31
|
+
if HttpLog.options[:log_request]
|
32
|
+
HttpLog::log("Sending: #{req.method} http://#{@address}:#{@port}#{req.path}")
|
33
|
+
end
|
34
|
+
|
35
|
+
if req.method == "POST" && HttpLog.options[:log_data]
|
36
|
+
# a bit convoluted becase post_form uses form_data= to assign the data, so
|
37
|
+
# in that case req.body will be empty
|
38
|
+
data = req.body.nil? || req.body.size == 0 ? body : req.body
|
39
|
+
HttpLog::log("Data: #{data}")
|
40
|
+
end
|
36
41
|
end
|
37
42
|
|
38
43
|
orig_request(req, body, &block)
|
data/lib/httplog/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: httplog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Thilo Rusche
|
@@ -56,7 +56,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
56
56
|
requirements:
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
hash: -
|
59
|
+
hash: -55724721
|
60
60
|
segments:
|
61
61
|
- 0
|
62
62
|
version: "0"
|