martinbtt-net-http-spy 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/readme.markdown +2 -1
- metadata +3 -4
- data/spy.rb +0 -68
data/readme.markdown
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: martinbtt-net-http-spy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Sadler
|
@@ -42,9 +42,8 @@ extra_rdoc_files:
|
|
42
42
|
- readme.markdown
|
43
43
|
files:
|
44
44
|
- readme.markdown
|
45
|
-
- spy.rb
|
46
45
|
has_rdoc: false
|
47
|
-
homepage:
|
46
|
+
homepage: http://github.com/martinbtt/net-http-spy
|
48
47
|
post_install_message:
|
49
48
|
rdoc_options:
|
50
49
|
- --main
|
@@ -65,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
64
|
version:
|
66
65
|
requirements: []
|
67
66
|
|
68
|
-
rubyforge_project:
|
67
|
+
rubyforge_project:
|
69
68
|
rubygems_version: 1.2.0
|
70
69
|
signing_key:
|
71
70
|
specification_version: 3
|
data/spy.rb
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
# require 'net/https'
|
2
|
-
# require 'logger'
|
3
|
-
# require 'cgi'
|
4
|
-
#
|
5
|
-
# # HTTP SPY
|
6
|
-
# module Net
|
7
|
-
# class HTTP
|
8
|
-
# alias :old_initialize :initialize
|
9
|
-
# alias :old_post :post
|
10
|
-
# # alias :old_get :get
|
11
|
-
# alias :old_request :request
|
12
|
-
#
|
13
|
-
# class << self
|
14
|
-
# attr_accessor :http_logger
|
15
|
-
# attr_accessor :http_logger_options
|
16
|
-
# end
|
17
|
-
#
|
18
|
-
# def initialize(*args, &block)
|
19
|
-
# @logger_options = self.class.http_logger_options ||= {:hide_body => true}
|
20
|
-
#
|
21
|
-
#
|
22
|
-
# self.class.http_logger.info "CONNECT: #{args.inspect}" if !@logger_options[:verbose]
|
23
|
-
#
|
24
|
-
# old_initialize(*args, &block)
|
25
|
-
# @debug_output = self.class.http_logger if @logger_options[:verbose]
|
26
|
-
#
|
27
|
-
# end
|
28
|
-
#
|
29
|
-
#
|
30
|
-
# # def get(*args, &block)
|
31
|
-
# # self.class.http_logger.info "GET: #{args}"# if self.class.http_logger_only.include?(:get)
|
32
|
-
# # result = old_get(*args, &block)
|
33
|
-
# # self.class.http_logger.info "BODY: #{result.body}" #if self.class.http_logger_only.include?(:body)
|
34
|
-
# # result
|
35
|
-
# # end
|
36
|
-
# #
|
37
|
-
# # def post(*args, &block)
|
38
|
-
# # self.class.http_logger.info "POST: #{args}" #if self.class.http_logger_only.include?(:post)
|
39
|
-
# # result = old_post(*args, &block)
|
40
|
-
# # self.class.http_logger.info "BODY: #{result.body}" #if self.class.http_logger_only.include?(:body)
|
41
|
-
# # result
|
42
|
-
# # end
|
43
|
-
#
|
44
|
-
#
|
45
|
-
# def request(*args, &block)
|
46
|
-
# unless started? || @logger_options[:verbose]
|
47
|
-
# req = args[0].class::METHOD
|
48
|
-
# self.class.http_logger.info "#{req} #{args[0].path}"
|
49
|
-
# self.class.http_logger.info "PARAMS #{CGI.parse(args[0].body).inspect} " if args[0].body && req != 'CONNECT'
|
50
|
-
# self.class.http_logger.info "TRACE: #{caller.reverse}" if @logger_options[:calltrace]
|
51
|
-
# end
|
52
|
-
#
|
53
|
-
# result = old_request(*args, &block)
|
54
|
-
#
|
55
|
-
# unless started? || @logger_options[:verbose]
|
56
|
-
# self.class.http_logger.info "BODY: #{ @logger_options[:hide_body] ? result.class.name : result.body}"
|
57
|
-
# end
|
58
|
-
# result
|
59
|
-
# end
|
60
|
-
#
|
61
|
-
#
|
62
|
-
# end
|
63
|
-
#
|
64
|
-
# end
|
65
|
-
#
|
66
|
-
# # Usage
|
67
|
-
# # Great for testing
|
68
|
-
# Net::HTTP.http_logger = Logger.new(STDOUT)
|