raw_net_capture 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/raw_net_capture.rb +36 -0
  3. metadata +88 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0fe83e54f2599f248742323990ffd740b0b15fac
4
+ data.tar.gz: 77344bd5dd7970d29db25547e5361981d7ce7efd
5
+ SHA512:
6
+ metadata.gz: b99e22ed15f73f934f0ec092fd4b8e5406902e91a8b86be0f9f73dc48a364c90466ace00c8fc61b6f0b46ba300746dba43ed50f97dfd66e83a6415952ae8b963
7
+ data.tar.gz: d370eb22ef44f240ae6e65dcc9a0cbddb92ddbf52fd64dee1093f15f39b4678967e0efcba294733d8accef72363016a73a89bd59546356fd1bb02cd93f845a5e
@@ -0,0 +1,36 @@
1
+ # encoding: utf-8
2
+
3
+ class RawNetCapture < StringIO
4
+ def raw_received
5
+ @raw_received ||= StringIO.new
6
+ end
7
+
8
+ def raw_sent
9
+ @raw_sent ||= StringIO.new
10
+ end
11
+ end
12
+
13
+ module Net
14
+ class BufferedIO
15
+ private
16
+
17
+ def rbuf_consume(len)
18
+ s = @rbuf.slice!(0, len)
19
+ if @debug_output
20
+ @debug_output << %Q[-> #{s.dump}\n]
21
+ @debug_output.raw_received << s if @debug_output.is_a?(RawNetCapture)
22
+ end
23
+ s
24
+ end
25
+
26
+ def write0(str)
27
+ if @debug_output
28
+ @debug_output << str.dump
29
+ @debug_output.raw_sent << str if @debug_output.is_a?(RawNetCapture)
30
+ end
31
+ len = @io.write(str)
32
+ @written_bytes += len
33
+ len
34
+ end
35
+ end
36
+ end
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: raw_net_capture
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Gary Grossman
8
+ - Victor Kmita
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-12-18 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: appraisal
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rake
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: bundler
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ description: Adds raw capture capability to Ruby's net debug_output
57
+ email:
58
+ - ggrossman@zendesk.com
59
+ executables: []
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - lib/raw_net_capture.rb
64
+ homepage: https://github.com/ggrossman/raw_net_capture
65
+ licenses:
66
+ - Apache License Version 2.0
67
+ metadata: {}
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubyforge_project:
84
+ rubygems_version: 2.2.2
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: Capture raw data in net debug_output
88
+ test_files: []