ronin-support 0.1.0.pre2 → 0.1.0.pre3
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING.txt +158 -497
- data/ChangeLog.md +1 -0
- data/Gemfile +3 -9
- data/README.md +11 -14
- data/gemspec.yml +1 -1
- data/lib/ronin/extensions.rb +11 -13
- data/lib/ronin/extensions/file.rb +11 -13
- data/lib/ronin/extensions/ip_addr.rb +11 -13
- data/lib/ronin/extensions/kernel.rb +11 -13
- data/lib/ronin/extensions/meta.rb +11 -13
- data/lib/ronin/extensions/string.rb +11 -13
- data/lib/ronin/formatting.rb +11 -13
- data/lib/ronin/formatting/binary.rb +11 -13
- data/lib/ronin/formatting/digest.rb +11 -13
- data/lib/ronin/formatting/extensions.rb +11 -13
- data/lib/ronin/formatting/extensions/binary.rb +11 -13
- data/lib/ronin/formatting/extensions/binary/file.rb +11 -13
- data/lib/ronin/formatting/extensions/binary/integer.rb +11 -13
- data/lib/ronin/formatting/extensions/binary/string.rb +11 -13
- data/lib/ronin/formatting/extensions/digest.rb +11 -13
- data/lib/ronin/formatting/extensions/digest/file.rb +11 -13
- data/lib/ronin/formatting/extensions/digest/string.rb +11 -13
- data/lib/ronin/formatting/extensions/http.rb +11 -13
- data/lib/ronin/formatting/extensions/http/integer.rb +11 -13
- data/lib/ronin/formatting/extensions/http/string.rb +11 -13
- data/lib/ronin/formatting/extensions/text.rb +11 -13
- data/lib/ronin/formatting/extensions/text/array.rb +11 -13
- data/lib/ronin/formatting/extensions/text/string.rb +11 -13
- data/lib/ronin/formatting/http.rb +11 -13
- data/lib/ronin/formatting/text.rb +11 -13
- data/lib/ronin/network.rb +11 -13
- data/lib/ronin/network/esmtp.rb +11 -13
- data/lib/ronin/network/extensions.rb +11 -13
- data/lib/ronin/network/extensions/esmtp.rb +11 -13
- data/lib/ronin/network/extensions/esmtp/net.rb +11 -13
- data/lib/ronin/network/extensions/http.rb +11 -13
- data/lib/ronin/network/extensions/http/net.rb +11 -13
- data/lib/ronin/network/extensions/imap.rb +11 -13
- data/lib/ronin/network/extensions/imap/net.rb +11 -13
- data/lib/ronin/network/extensions/pop3.rb +11 -13
- data/lib/ronin/network/extensions/pop3/net.rb +11 -13
- data/lib/ronin/network/extensions/smtp.rb +11 -13
- data/lib/ronin/network/extensions/smtp/net.rb +11 -13
- data/lib/ronin/network/extensions/ssl.rb +11 -13
- data/lib/ronin/network/extensions/ssl/net.rb +11 -13
- data/lib/ronin/network/extensions/tcp.rb +11 -13
- data/lib/ronin/network/extensions/tcp/net.rb +11 -13
- data/lib/ronin/network/extensions/telnet.rb +11 -13
- data/lib/ronin/network/extensions/telnet/net.rb +11 -13
- data/lib/ronin/network/extensions/udp.rb +11 -13
- data/lib/ronin/network/extensions/udp/net.rb +11 -13
- data/lib/ronin/network/http.rb +11 -13
- data/lib/ronin/network/http/exceptions.rb +11 -13
- data/lib/ronin/network/http/exceptions/unknown_request.rb +11 -13
- data/lib/ronin/network/http/http.rb +11 -13
- data/lib/ronin/network/http/proxy.rb +11 -13
- data/lib/ronin/network/imap.rb +11 -13
- data/lib/ronin/network/network.rb +11 -13
- data/lib/ronin/network/pop3.rb +11 -13
- data/lib/ronin/network/smtp.rb +11 -13
- data/lib/ronin/network/smtp/email.rb +11 -13
- data/lib/ronin/network/smtp/smtp.rb +11 -13
- data/lib/ronin/network/ssl.rb +11 -13
- data/lib/ronin/network/tcp.rb +11 -13
- data/lib/ronin/network/telnet.rb +11 -13
- data/lib/ronin/network/udp.rb +11 -13
- data/lib/ronin/path.rb +11 -13
- data/lib/ronin/support.rb +11 -13
- data/lib/ronin/support/inflector.rb +9 -10
- data/lib/ronin/support/version.rb +12 -14
- data/lib/ronin/templates.rb +11 -13
- data/lib/ronin/templates/erb.rb +11 -13
- data/lib/ronin/templates/template.rb +11 -13
- data/spec/extensions/ip_addr_spec.rb +5 -5
- data/spec/extensions/kernel_spec.rb +1 -1
- data/spec/extensions/string_spec.rb +6 -6
- data/spec/formatting/binary/integer_spec.rb +3 -3
- data/spec/formatting/binary/string_spec.rb +11 -11
- data/spec/formatting/digest/string_spec.rb +5 -5
- data/spec/formatting/http/integer_spec.rb +3 -3
- data/spec/formatting/http/string_spec.rb +5 -5
- data/spec/formatting/text/array_spec.rb +5 -5
- data/spec/formatting/text/string_spec.rb +5 -5
- data/spec/network/http/proxy_spec.rb +0 -2
- data/spec/path_spec.rb +9 -7
- metadata +4 -4
@@ -24,7 +24,7 @@ describe String do
|
|
24
24
|
should respond_to(:format_http)
|
25
25
|
end
|
26
26
|
|
27
|
-
describe "uri_encode" do
|
27
|
+
describe "#uri_encode" do
|
28
28
|
subject { "mod % 3" }
|
29
29
|
|
30
30
|
let(:uri_encoded) { "mod%20%25%203" }
|
@@ -34,7 +34,7 @@ describe String do
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
describe "uri_decode" do
|
37
|
+
describe "#uri_decode" do
|
38
38
|
subject { "mod%20%25%203" }
|
39
39
|
|
40
40
|
let(:uri_decoded) { "mod % 3" }
|
@@ -44,7 +44,7 @@ describe String do
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
describe "uri_escape" do
|
47
|
+
describe "#uri_escape" do
|
48
48
|
subject { "x + y" }
|
49
49
|
|
50
50
|
let(:uri_escaped) { "x+%2B+y" }
|
@@ -54,7 +54,7 @@ describe String do
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
describe "uri_unescape" do
|
57
|
+
describe "#uri_unescape" do
|
58
58
|
subject { "x+%2B+y" }
|
59
59
|
|
60
60
|
let(:uri_unescaped) { "x + y" }
|
@@ -64,7 +64,7 @@ describe String do
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
-
describe "format_http" do
|
67
|
+
describe "#format_http" do
|
68
68
|
subject { "mod % 3" }
|
69
69
|
|
70
70
|
let(:http_formatted) { "%6d%6f%64%20%25%20%33" }
|
@@ -29,7 +29,7 @@ describe Array do
|
|
29
29
|
should respond_to(:hex_integers)
|
30
30
|
end
|
31
31
|
|
32
|
-
describe "bytes" do
|
32
|
+
describe "#bytes" do
|
33
33
|
it "should convert an Array of bytes to an Array of bytes" do
|
34
34
|
byte_array.bytes.should == byte_array
|
35
35
|
end
|
@@ -43,7 +43,7 @@ describe Array do
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
describe "chars" do
|
46
|
+
describe "#chars" do
|
47
47
|
it "should convert an Array of bytes to an Array of chars" do
|
48
48
|
byte_array.chars.should == char_array
|
49
49
|
end
|
@@ -57,7 +57,7 @@ describe Array do
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
describe "char_string" do
|
60
|
+
describe "#char_string" do
|
61
61
|
it "should convert an Array of bytes to a String" do
|
62
62
|
byte_array.char_string.should == string
|
63
63
|
end
|
@@ -71,7 +71,7 @@ describe Array do
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
-
describe "hex_chars" do
|
74
|
+
describe "#hex_chars" do
|
75
75
|
let(:hex_chars) { ['\x41', '\x41', '\x20'] }
|
76
76
|
|
77
77
|
it "should convert an Array of bytes into hexadecimal chars" do
|
@@ -87,7 +87,7 @@ describe Array do
|
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
90
|
-
describe "hex_integers" do
|
90
|
+
describe "#hex_integers" do
|
91
91
|
let(:hex_integers) { ['0x41', '0x41', '0x20'] }
|
92
92
|
|
93
93
|
it "should convert an Array of bytes into hexadecimal integers" do
|
@@ -24,7 +24,7 @@ describe String do
|
|
24
24
|
should respond_to(:insert_after)
|
25
25
|
end
|
26
26
|
|
27
|
-
describe "format_chars" do
|
27
|
+
describe "#format_chars" do
|
28
28
|
it "should format each character in the String" do
|
29
29
|
subject.format_chars { |c|
|
30
30
|
"_#{c}"
|
@@ -80,7 +80,7 @@ describe String do
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
describe "format_bytes" do
|
83
|
+
describe "#format_bytes" do
|
84
84
|
it "should format each byte in the String" do
|
85
85
|
subject.format_bytes { |b|
|
86
86
|
sprintf("%%%x",b)
|
@@ -136,7 +136,7 @@ describe String do
|
|
136
136
|
end
|
137
137
|
end
|
138
138
|
|
139
|
-
describe "random_case" do
|
139
|
+
describe "#random_case" do
|
140
140
|
it "should capitalize each character when :probability is 1.0" do
|
141
141
|
new_string = subject.random_case(:probability => 1.0)
|
142
142
|
|
@@ -150,7 +150,7 @@ describe String do
|
|
150
150
|
end
|
151
151
|
end
|
152
152
|
|
153
|
-
describe "insert_before" do
|
153
|
+
describe "#insert_before" do
|
154
154
|
it "should inject data before a matched String" do
|
155
155
|
subject.insert_before('ll','x').should == "hexllo"
|
156
156
|
end
|
@@ -164,7 +164,7 @@ describe String do
|
|
164
164
|
end
|
165
165
|
end
|
166
166
|
|
167
|
-
describe "insert_after" do
|
167
|
+
describe "#insert_after" do
|
168
168
|
it "should inject data after a matched String" do
|
169
169
|
subject.insert_after('ll','x').should == "hellxo"
|
170
170
|
end
|
data/spec/path_spec.rb
CHANGED
@@ -16,38 +16,40 @@ describe Path do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
describe "up" do
|
19
|
+
subject { Path }
|
20
|
+
|
19
21
|
it "should be able to traverse up 0 directories" do
|
20
|
-
|
22
|
+
subject.up(0).should == File::SEPARATOR
|
21
23
|
end
|
22
24
|
|
23
25
|
it "should raise an ArgumentError when not passed an Integer or Enumerable" do
|
24
26
|
lambda {
|
25
|
-
|
27
|
+
subject.up(1.5)
|
26
28
|
}.should raise_error(ArgumentError)
|
27
29
|
end
|
28
30
|
|
29
31
|
it "should raise an ArgumentError on negative number of directories" do
|
30
32
|
lambda {
|
31
|
-
|
33
|
+
subject.up(-1)
|
32
34
|
}.should raise_error(ArgumentError)
|
33
35
|
end
|
34
36
|
|
35
37
|
it "should create directory-escaping paths" do
|
36
|
-
|
38
|
+
subject.up(n).to_s.should == (['..'] * n).join(File::SEPARATOR)
|
37
39
|
end
|
38
40
|
|
39
41
|
it "should create a range of directory-escaping paths" do
|
40
42
|
range = 7..10
|
41
43
|
|
42
|
-
|
44
|
+
subject.up(range).should == range.map { |i| Path.up(i) }
|
43
45
|
end
|
44
46
|
|
45
47
|
it "should allow using custom path separators" do
|
46
|
-
|
48
|
+
subject.up(n,'\\').to_s.should == (['..'] * n).join("\\")
|
47
49
|
end
|
48
50
|
end
|
49
51
|
|
50
|
-
describe "join" do
|
52
|
+
describe "#join" do
|
51
53
|
let(:base_path) { Path.new('base') }
|
52
54
|
|
53
55
|
it "should join with sub-paths" do
|
metadata
CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
|
|
6
6
|
- 0
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.1.0.
|
9
|
+
- pre3
|
10
|
+
version: 0.1.0.pre3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Postmodern
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-01-07 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -233,7 +233,7 @@ files:
|
|
233
233
|
has_rdoc: yard
|
234
234
|
homepage: http://github.com/ronin-ruby/ronin-support
|
235
235
|
licenses:
|
236
|
-
- LGPL-
|
236
|
+
- LGPL-3
|
237
237
|
post_install_message:
|
238
238
|
rdoc_options: []
|
239
239
|
|