ronin 0.1.2 → 0.1.3

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.
Files changed (169) hide show
  1. data/History.txt +58 -25
  2. data/Manifest.txt +15 -16
  3. data/README.txt +16 -11
  4. data/Rakefile +9 -7
  5. data/TODO.txt +6 -1
  6. data/lib/ronin.rb +1 -1
  7. data/lib/ronin/arch.rb +7 -15
  8. data/lib/ronin/author.rb +1 -1
  9. data/lib/ronin/cache.rb +1 -1
  10. data/lib/ronin/cache/cache.rb +1 -1
  11. data/lib/ronin/cache/config.rb +1 -1
  12. data/lib/ronin/cache/exceptions.rb +1 -1
  13. data/lib/ronin/cache/exceptions/extension_not_found.rb +1 -1
  14. data/lib/ronin/cache/exceptions/overlay_cached.rb +1 -1
  15. data/lib/ronin/cache/exceptions/overlay_not_found.rb +1 -1
  16. data/lib/ronin/cache/extension.rb +15 -190
  17. data/lib/ronin/cache/extension_cache.rb +2 -2
  18. data/lib/ronin/cache/maintainer.rb +1 -1
  19. data/lib/ronin/cache/overlay.rb +8 -7
  20. data/lib/ronin/cache/overlay_cache.rb +1 -1
  21. data/lib/ronin/cache/ronin.rb +1 -1
  22. data/lib/ronin/chars.rb +1 -1
  23. data/lib/ronin/chars/char_set.rb +1 -1
  24. data/lib/ronin/chars/chars.rb +1 -1
  25. data/lib/ronin/code/emittable.rb +1 -1
  26. data/lib/ronin/code/reference.rb +1 -1
  27. data/lib/ronin/code/symbol_table.rb +1 -1
  28. data/lib/ronin/code/token.rb +1 -1
  29. data/lib/ronin/config.rb +16 -9
  30. data/lib/ronin/database.rb +2 -113
  31. data/lib/ronin/database/database.rb +124 -0
  32. data/lib/ronin/{exceptions/unknown_context.rb → database/exceptions.rb} +2 -5
  33. data/lib/ronin/{exceptions/context_not_found.rb → database/exceptions/invalid_config.rb} +4 -2
  34. data/lib/ronin/extensions.rb +1 -1
  35. data/lib/ronin/extensions/hash.rb +1 -1
  36. data/lib/ronin/extensions/meta.rb +1 -1
  37. data/lib/ronin/extensions/string.rb +1 -1
  38. data/lib/ronin/extensions/uri.rb +1 -1
  39. data/lib/ronin/extensions/uri/http.rb +1 -1
  40. data/lib/ronin/extensions/uri/query_params.rb +1 -1
  41. data/lib/ronin/formatting.rb +1 -1
  42. data/lib/ronin/formatting/binary.rb +1 -1
  43. data/lib/ronin/formatting/digest.rb +1 -1
  44. data/lib/ronin/formatting/extensions.rb +1 -1
  45. data/lib/ronin/formatting/extensions/binary.rb +1 -1
  46. data/lib/ronin/formatting/extensions/binary/integer.rb +1 -1
  47. data/lib/ronin/formatting/extensions/binary/string.rb +1 -1
  48. data/lib/ronin/formatting/extensions/digest.rb +1 -1
  49. data/lib/ronin/formatting/extensions/digest/string.rb +1 -1
  50. data/lib/ronin/formatting/extensions/html.rb +1 -1
  51. data/lib/ronin/formatting/extensions/html/string.rb +1 -1
  52. data/lib/ronin/formatting/extensions/http.rb +1 -1
  53. data/lib/ronin/formatting/extensions/http/string.rb +1 -1
  54. data/lib/ronin/formatting/extensions/text.rb +1 -1
  55. data/lib/ronin/formatting/extensions/text/string.rb +1 -1
  56. data/lib/ronin/formatting/html.rb +1 -1
  57. data/lib/ronin/formatting/http.rb +1 -1
  58. data/lib/ronin/formatting/text.rb +1 -1
  59. data/lib/ronin/{pending_context.rb → has_license.rb} +21 -22
  60. data/lib/ronin/hexdump.rb +1 -1
  61. data/lib/ronin/hexdump/extensions.rb +1 -1
  62. data/lib/ronin/hexdump/extensions/file.rb +1 -1
  63. data/lib/ronin/hexdump/extensions/kernel.rb +1 -1
  64. data/lib/ronin/hexdump/hexdump.rb +1 -1
  65. data/lib/ronin/license.rb +10 -15
  66. data/lib/ronin/model.rb +14 -12
  67. data/lib/ronin/models.rb +2 -2
  68. data/lib/ronin/network.rb +1 -1
  69. data/lib/ronin/network/esmtp.rb +1 -1
  70. data/lib/ronin/network/extensions.rb +1 -1
  71. data/lib/ronin/network/extensions/esmtp.rb +1 -1
  72. data/lib/ronin/network/extensions/esmtp/net.rb +1 -1
  73. data/lib/ronin/network/extensions/http.rb +1 -1
  74. data/lib/ronin/network/extensions/http/net.rb +1 -1
  75. data/lib/ronin/network/extensions/imap.rb +1 -1
  76. data/lib/ronin/network/extensions/imap/net.rb +1 -1
  77. data/lib/ronin/network/extensions/pop3.rb +1 -1
  78. data/lib/ronin/network/extensions/pop3/net.rb +1 -1
  79. data/lib/ronin/network/extensions/smtp.rb +1 -1
  80. data/lib/ronin/network/extensions/smtp/net.rb +1 -1
  81. data/lib/ronin/network/extensions/tcp.rb +1 -1
  82. data/lib/ronin/network/extensions/tcp/net.rb +17 -1
  83. data/lib/ronin/network/extensions/telnet.rb +1 -1
  84. data/lib/ronin/network/extensions/telnet/net.rb +1 -1
  85. data/lib/ronin/network/extensions/udp.rb +1 -1
  86. data/lib/ronin/network/extensions/udp/net.rb +1 -1
  87. data/lib/ronin/network/http.rb +1 -1
  88. data/lib/ronin/network/http/exceptions.rb +1 -1
  89. data/lib/ronin/network/http/exceptions/unknown_request.rb +1 -1
  90. data/lib/ronin/network/imap.rb +1 -1
  91. data/lib/ronin/network/pop3.rb +1 -1
  92. data/lib/ronin/network/smtp.rb +1 -1
  93. data/lib/ronin/network/smtp/email.rb +1 -1
  94. data/lib/ronin/network/smtp/smtp.rb +1 -1
  95. data/lib/ronin/network/tcp.rb +1 -1
  96. data/lib/ronin/network/telnet.rb +1 -1
  97. data/lib/ronin/network/udp.rb +1 -1
  98. data/lib/ronin/objectify.rb +24 -0
  99. data/lib/ronin/{exceptions/invalid_database_config.rb → objectify/exceptions.rb} +3 -5
  100. data/lib/ronin/{exceptions → objectify/exceptions}/object_context_not_found.rb +1 -1
  101. data/lib/ronin/{exceptions → objectify/exceptions}/unknown_object_context.rb +1 -1
  102. data/lib/ronin/{object_context.rb → objectify/objectify.rb} +54 -45
  103. data/lib/ronin/path.rb +1 -1
  104. data/lib/ronin/platform.rb +3 -1
  105. data/lib/ronin/product.rb +2 -1
  106. data/lib/ronin/ronin.rb +10 -10
  107. data/lib/ronin/rpc.rb +1 -1
  108. data/lib/ronin/rpc/call.rb +1 -1
  109. data/lib/ronin/rpc/client.rb +1 -1
  110. data/lib/ronin/rpc/console.rb +1 -1
  111. data/lib/ronin/rpc/exceptions.rb +1 -1
  112. data/lib/ronin/rpc/exceptions/not_implemented.rb +1 -1
  113. data/lib/ronin/rpc/exceptions/response_missing.rb +1 -1
  114. data/lib/ronin/rpc/response.rb +1 -1
  115. data/lib/ronin/rpc/service.rb +1 -1
  116. data/lib/ronin/rpc/shell.rb +1 -1
  117. data/lib/ronin/sessions.rb +1 -1
  118. data/lib/ronin/sessions/esmtp.rb +6 -8
  119. data/lib/ronin/sessions/http.rb +1 -1
  120. data/lib/ronin/sessions/imap.rb +6 -8
  121. data/lib/ronin/sessions/pop3.rb +6 -8
  122. data/lib/ronin/sessions/session.rb +1 -1
  123. data/lib/ronin/sessions/smtp.rb +6 -8
  124. data/lib/ronin/sessions/tcp.rb +48 -36
  125. data/lib/ronin/sessions/telnet.rb +7 -10
  126. data/lib/ronin/sessions/udp.rb +28 -29
  127. data/lib/ronin/sessions/web.rb +5 -7
  128. data/lib/ronin/target.rb +1 -0
  129. data/lib/ronin/translators/translator.rb +1 -1
  130. data/lib/ronin/ui/command_line.rb +1 -1
  131. data/lib/ronin/ui/command_line/command.rb +1 -1
  132. data/lib/ronin/ui/command_line/command_line.rb +7 -2
  133. data/lib/ronin/ui/command_line/commands.rb +2 -2
  134. data/lib/ronin/ui/command_line/commands/add.rb +8 -8
  135. data/lib/ronin/ui/command_line/commands/default.rb +1 -1
  136. data/lib/ronin/ui/command_line/commands/extension.rb +13 -26
  137. data/lib/ronin/ui/command_line/commands/help.rb +1 -1
  138. data/lib/ronin/ui/command_line/commands/install.rb +7 -7
  139. data/lib/ronin/ui/command_line/commands/list.rb +13 -7
  140. data/lib/ronin/ui/command_line/commands/overlay.rb +1 -1
  141. data/lib/ronin/ui/command_line/commands/remove.rb +4 -4
  142. data/lib/ronin/ui/command_line/commands/uninstall.rb +4 -4
  143. data/lib/ronin/ui/command_line/commands/update.rb +3 -3
  144. data/lib/ronin/ui/command_line/exceptions.rb +1 -1
  145. data/lib/ronin/ui/command_line/exceptions/unknown_command.rb +1 -1
  146. data/lib/ronin/ui/command_line/options.rb +1 -1
  147. data/lib/ronin/ui/command_line/param_parser.rb +73 -0
  148. data/lib/ronin/ui/console.rb +1 -1
  149. data/lib/ronin/ui/shell.rb +1 -1
  150. data/lib/ronin/version.rb +2 -2
  151. data/lib/ronin/web.rb +1 -1
  152. data/lib/ronin/web/web.rb +1 -1
  153. data/spec/chars/char_set_spec.rb +116 -118
  154. data/spec/chars/chars_spec.rb +54 -63
  155. data/spec/formatting/{binary_spec.rb → binary/integer_spec.rb} +0 -19
  156. data/spec/formatting/binary/string_spec.rb +32 -0
  157. data/spec/{object_context/object_context_spec.rb → objectify/objectify_spec.rb} +5 -3
  158. data/spec/path_spec.rb +21 -23
  159. data/spec/translators/translator_spec.rb +38 -40
  160. data/spec/ui/command_line/param_parser_spec.rb +58 -0
  161. data/static/extension.rb +9 -0
  162. metadata +43 -24
  163. data/lib/ronin/context.rb +0 -236
  164. data/spec/context/context_spec.rb +0 -84
  165. data/spec/context/helpers/book_context.rb +0 -15
  166. data/spec/context/helpers/book_review_context.rb +0 -21
  167. data/spec/context/helpers/contexts/neuromancer_review.rb +0 -15
  168. data/spec/context/helpers/contexts/snow_crash.rb +0 -8
  169. data/static/extension.rb.erb +0 -16
@@ -3,7 +3,7 @@
3
3
  # Ronin - A Ruby platform designed for information security and data
4
4
  # exploration tasks.
5
5
  #
6
- # Copyright (c) 2006-2008 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of the GNU General Public License as published by
@@ -3,7 +3,7 @@
3
3
  # Ronin - A Ruby platform designed for information security and data
4
4
  # exploration tasks.
5
5
  #
6
- # Copyright (c) 2006-2008 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of the GNU General Public License as published by
data/lib/ronin/version.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  # Ronin - A Ruby platform designed for information security and data
4
4
  # exploration tasks.
5
5
  #
6
- # Copyright (c) 2006-2008 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of the GNU General Public License as published by
@@ -23,5 +23,5 @@
23
23
 
24
24
  module Ronin
25
25
  # Ronin version
26
- VERSION = '0.1.2'
26
+ VERSION = '0.1.3'
27
27
  end
data/lib/ronin/web.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  # Ronin - A Ruby platform designed for information security and data
4
4
  # exploration tasks.
5
5
  #
6
- # Copyright (c) 2006-2008 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of the GNU General Public License as published by
data/lib/ronin/web/web.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  # Ronin - A Ruby platform designed for information security and data
4
4
  # exploration tasks.
5
5
  #
6
- # Copyright (c) 2006-2008 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of the GNU General Public License as published by
@@ -2,176 +2,174 @@ require 'ronin/chars/chars'
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- describe Ronin do
6
- describe Chars::CharSet do
7
- before(:all) do
8
- @integer_range = (0x41..0x43)
9
- @string_range = ('A'..'C')
10
- @integers = @integer_range.to_a
11
- @strings = @string_range.to_a
12
-
13
- @char_set = Chars::CharSet.new(*@strings)
14
- end
5
+ describe Chars::CharSet do
6
+ before(:all) do
7
+ @integer_range = (0x41..0x43)
8
+ @string_range = ('A'..'C')
9
+ @integers = @integer_range.to_a
10
+ @strings = @string_range.to_a
11
+
12
+ @char_set = Chars::CharSet.new(*@strings)
13
+ end
15
14
 
16
- it "may be created with String arguments" do
17
- @chars = Chars::CharSet.new(*@strings)
15
+ it "may be created with String arguments" do
16
+ @chars = Chars::CharSet.new(*@strings)
18
17
 
19
- @strings.each do |s|
20
- @chars.include_char?(s).should == true
21
- end
18
+ @strings.each do |s|
19
+ @chars.include_char?(s).should == true
22
20
  end
21
+ end
23
22
 
24
- it "may be created with an Array of Strings" do
25
- @chars = Chars::CharSet.new(@strings)
23
+ it "may be created with an Array of Strings" do
24
+ @chars = Chars::CharSet.new(@strings)
26
25
 
27
- @strings.each do |s|
28
- @chars.include_char?(s).should == true
29
- end
26
+ @strings.each do |s|
27
+ @chars.include_char?(s).should == true
30
28
  end
29
+ end
31
30
 
32
- it "may be created with a Range of Strings" do
33
- @chars = Chars::CharSet.new(@string_range)
31
+ it "may be created with a Range of Strings" do
32
+ @chars = Chars::CharSet.new(@string_range)
34
33
 
35
- @strings.each do |s|
36
- @chars.include_char?(s).should == true
37
- end
34
+ @strings.each do |s|
35
+ @chars.include_char?(s).should == true
38
36
  end
37
+ end
39
38
 
40
- it "may be created with Integer arguments" do
41
- @chars = Chars::CharSet.new(*@integers)
39
+ it "may be created with Integer arguments" do
40
+ @chars = Chars::CharSet.new(*@integers)
42
41
 
43
- @integers.each do |i|
44
- @chars.include?(i).should == true
45
- end
42
+ @integers.each do |i|
43
+ @chars.include?(i).should == true
46
44
  end
45
+ end
47
46
 
48
- it "may be created with an Array of Integers" do
49
- @chars = Chars::CharSet.new(@integers)
47
+ it "may be created with an Array of Integers" do
48
+ @chars = Chars::CharSet.new(@integers)
50
49
 
51
- @integers.each do |i|
52
- @chars.include?(i).should == true
53
- end
50
+ @integers.each do |i|
51
+ @chars.include?(i).should == true
54
52
  end
53
+ end
55
54
 
56
- it "may be created with a Range of Integers" do
57
- @chars = Chars::CharSet.new(@integer_range)
55
+ it "may be created with a Range of Integers" do
56
+ @chars = Chars::CharSet.new(@integer_range)
58
57
 
59
- @integers.each do |i|
60
- @chars.include?(i).should == true
61
- end
58
+ @integers.each do |i|
59
+ @chars.include?(i).should == true
62
60
  end
61
+ end
63
62
 
64
- it "should include Strings" do
65
- @char_set.include_char?('A').should == true
66
- end
63
+ it "should include Strings" do
64
+ @char_set.include_char?('A').should == true
65
+ end
67
66
 
68
- it "should include Integers" do
69
- @char_set.include?(0x41).should == true
70
- end
67
+ it "should include Integers" do
68
+ @char_set.include?(0x41).should == true
69
+ end
71
70
 
72
- it "should be able to select bytes" do
73
- @sub_chars = @char_set.select_bytes { |c| c <= 0x42 }
71
+ it "should be able to select bytes" do
72
+ @sub_chars = @char_set.select_bytes { |c| c <= 0x42 }
74
73
 
75
- @sub_chars.should == [0x41, 0x42]
76
- end
74
+ @sub_chars.should == [0x41, 0x42]
75
+ end
77
76
 
78
- it "should be able to select chars" do
79
- @sub_chars = @char_set.select_chars { |c| c <= 'B' }
77
+ it "should be able to select chars" do
78
+ @sub_chars = @char_set.select_chars { |c| c <= 'B' }
80
79
 
81
- @sub_chars.should == ['A', 'B']
82
- end
80
+ @sub_chars.should == ['A', 'B']
81
+ end
83
82
 
84
- it "should return a random byte" do
85
- @char_set.include?(@char_set.random_byte).should == true
86
- end
83
+ it "should return a random byte" do
84
+ @char_set.include?(@char_set.random_byte).should == true
85
+ end
87
86
 
88
- it "should return a random char" do
89
- @char_set.include_char?(@char_set.random_char).should == true
90
- end
87
+ it "should return a random char" do
88
+ @char_set.include_char?(@char_set.random_char).should == true
89
+ end
91
90
 
92
- it "should iterate over n random bytes" do
93
- @char_set.each_random_byte(10) do |b|
94
- @char_set.include?(b).should == true
95
- end
91
+ it "should iterate over n random bytes" do
92
+ @char_set.each_random_byte(10) do |b|
93
+ @char_set.include?(b).should == true
96
94
  end
95
+ end
97
96
 
98
- it "should iterate over n random chars" do
99
- @char_set.each_random_char(10) do |c|
100
- @char_set.include_char?(c).should == true
101
- end
97
+ it "should iterate over n random chars" do
98
+ @char_set.each_random_char(10) do |c|
99
+ @char_set.include_char?(c).should == true
102
100
  end
101
+ end
103
102
 
104
- it "should return a random Array of bytes" do
105
- bytes = @char_set.random_bytes(10)
103
+ it "should return a random Array of bytes" do
104
+ bytes = @char_set.random_bytes(10)
106
105
 
107
- bytes.each do |b|
108
- @char_set.include?(b).should == true
109
- end
106
+ bytes.each do |b|
107
+ @char_set.include?(b).should == true
110
108
  end
109
+ end
111
110
 
112
- it "should return a random Array of chars" do
113
- chars = @char_set.random_chars(10)
111
+ it "should return a random Array of chars" do
112
+ chars = @char_set.random_chars(10)
114
113
 
115
- chars.each do |c|
116
- @char_set.include_char?(c).should == true
117
- end
114
+ chars.each do |c|
115
+ @char_set.include_char?(c).should == true
118
116
  end
117
+ end
119
118
 
120
- it "should return a random Array of bytes with a varying length" do
121
- bytes = @char_set.random_bytes(5..10)
119
+ it "should return a random Array of bytes with a varying length" do
120
+ bytes = @char_set.random_bytes(5..10)
122
121
 
123
- bytes.length.between?(5, 10).should == true
124
- bytes.each do |b|
125
- @char_set.include?(b).should == true
126
- end
122
+ bytes.length.between?(5, 10).should == true
123
+ bytes.each do |b|
124
+ @char_set.include?(b).should == true
127
125
  end
126
+ end
128
127
 
129
- it "should return a random Array of chars with a varying length" do
130
- chars = @char_set.random_chars(5..10)
128
+ it "should return a random Array of chars with a varying length" do
129
+ chars = @char_set.random_chars(5..10)
131
130
 
132
- chars.length.between?(5, 10).should == true
133
- chars.each do |c|
134
- @char_set.include_char?(c).should == true
135
- end
131
+ chars.length.between?(5, 10).should == true
132
+ chars.each do |c|
133
+ @char_set.include_char?(c).should == true
136
134
  end
135
+ end
137
136
 
138
- it "should return a random String of chars" do
139
- @char_set.random_string(10).each_byte do |b|
140
- @char_set.include?(b).should == true
141
- end
137
+ it "should return a random String of chars" do
138
+ @char_set.random_string(10).each_byte do |b|
139
+ @char_set.include?(b).should == true
142
140
  end
141
+ end
143
142
 
144
- it "should return a random String of chars with a varying length" do
145
- string = @char_set.random_string(5..10)
143
+ it "should return a random String of chars with a varying length" do
144
+ string = @char_set.random_string(5..10)
146
145
 
147
- string.length.between?(5, 10)
148
- string.each_byte do |b|
149
- @char_set.include?(b).should == true
150
- end
146
+ string.length.between?(5, 10)
147
+ string.each_byte do |b|
148
+ @char_set.include?(b).should == true
151
149
  end
150
+ end
152
151
 
153
- it "should be able to be compared with another set of chars" do
154
- (@char_set == Chars::CharSet['A', 'B', 'C']).should == true
155
- (@char_set == Chars::CharSet['A', 'C', 'B']).should == true
156
- end
152
+ it "should be able to be compared with another set of chars" do
153
+ (@char_set == Chars::CharSet['A', 'B', 'C']).should == true
154
+ (@char_set == Chars::CharSet['A', 'C', 'B']).should == true
155
+ end
157
156
 
158
- it "should be able to be unioned with another set of chars" do
159
- super_set = (@char_set | Chars::CharSet['D'])
157
+ it "should be able to be unioned with another set of chars" do
158
+ super_set = (@char_set | Chars::CharSet['D'])
160
159
 
161
- super_set.class.should == Chars::CharSet
162
- super_set.should == Chars::CharSet['A', 'B', 'C', 'D']
163
- end
160
+ super_set.class.should == Chars::CharSet
161
+ super_set.should == Chars::CharSet['A', 'B', 'C', 'D']
162
+ end
164
163
 
165
- it "should be able to be removed from another set of chars" do
166
- sub_set = (@char_set - Chars::CharSet['B'])
164
+ it "should be able to be removed from another set of chars" do
165
+ sub_set = (@char_set - Chars::CharSet['B'])
167
166
 
168
- sub_set.class.should == Chars::CharSet
169
- sub_set.subset?(@char_set).should == true
170
- end
167
+ sub_set.class.should == Chars::CharSet
168
+ sub_set.subset?(@char_set).should == true
169
+ end
171
170
 
172
- it "should determine if a String is made up of the characters from the char set" do
173
- (@char_set =~ "AABCBAA").should == true
174
- (@char_set =~ "AADDEE").should_not == true
175
- end
171
+ it "should determine if a String is made up of the characters from the char set" do
172
+ (@char_set =~ "AABCBAA").should == true
173
+ (@char_set =~ "AADDEE").should_not == true
176
174
  end
177
175
  end
@@ -2,81 +2,72 @@ require 'ronin/chars/chars'
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- describe Ronin do
6
- describe Chars do
7
- before(:all) do
8
- @numeric_string = Chars.numeric.random_string(10)
9
- @octal_string = Chars.octal.random_string(10)
10
- @uppercase_hex_string = Chars.uppercase_hexadecimal.random_string(10)
11
- @lowercase_hex_string = Chars.lowercase_hexadecimal.random_string(10)
12
- @hex_string = Chars.hexadecimal.random_string(10)
13
- @uppercase_alpha_string = Chars.uppercase_alpha.random_string(10)
14
- @lowercase_alpha_string = Chars.lowercase_alpha.random_string(10)
15
- @alpha_string = Chars.alpha.random_string(10)
16
- @alpha_numeric = Chars.alpha_numeric.random_string(10)
17
- @space_string = Chars.space.random_string(10)
18
- @punctuation_string = Chars.punctuation.random_string(10)
19
- @symbols_string = Chars.symbols.random_string(10)
20
- @control_string = Chars.control.random_string(10)
21
- @ascii_string = Chars.ascii.random_string(10)
22
- @all_string = Chars.all.random_string(10)
23
- end
24
-
25
- it "should provide a numeric CharSet" do
26
- (@numeric_string =~ /[0-9]{10}/).should_not be_nil
27
- end
28
-
29
- it "should provide an octal CharSet" do
30
- (@octal_string =~ /[0-7]{10}/).should_not be_nil
31
- end
32
-
33
- it "should provide an upper-case hexadecimal CharSet" do
34
- (@uppercase_hex_string =~ /[0-9A-F]{10}/).should_not be_nil
35
- end
5
+ describe Chars do
6
+ before(:all) do
7
+ @numeric_string = Chars.numeric.random_string(10)
8
+ @octal_string = Chars.octal.random_string(10)
9
+ @uppercase_hex_string = Chars.uppercase_hexadecimal.random_string(10)
10
+ @lowercase_hex_string = Chars.lowercase_hexadecimal.random_string(10)
11
+ @hex_string = Chars.hexadecimal.random_string(10)
12
+ @uppercase_alpha_string = Chars.uppercase_alpha.random_string(10)
13
+ @lowercase_alpha_string = Chars.lowercase_alpha.random_string(10)
14
+ @alpha_string = Chars.alpha.random_string(10)
15
+ @alpha_numeric = Chars.alpha_numeric.random_string(10)
16
+ @space_string = Chars.space.random_string(10)
17
+ @punctuation_string = Chars.punctuation.random_string(10)
18
+ @symbols_string = Chars.symbols.random_string(10)
19
+ @control_string = Chars.control.random_string(10)
20
+ @ascii_string = Chars.ascii.random_string(10)
21
+ @all_string = Chars.all.random_string(10)
22
+ end
36
23
 
37
- it "should provide a lower-case hexadecimal CharSet" do
38
- (@lowercase_hex_string =~ /[0-9a-f]{10}/).should_not be_nil
39
- end
24
+ it "should provide a numeric CharSet" do
25
+ (@numeric_string =~ /[0-9]{10}/).should_not be_nil
26
+ end
40
27
 
41
- it "should provide a hexadecimal CharSet" do
42
- (@hex_string =~ /[0-9A-Fa-f]{10}/).should_not be_nil
43
- end
28
+ it "should provide an octal CharSet" do
29
+ (@octal_string =~ /[0-7]{10}/).should_not be_nil
30
+ end
44
31
 
45
- it "should provide an upper-case alpha CharSet" do
46
- (@uppercase_alpha_string =~ /[A-Z]{10}/).should_not be_nil
47
- end
32
+ it "should provide an upper-case hexadecimal CharSet" do
33
+ (@uppercase_hex_string =~ /[0-9A-F]{10}/).should_not be_nil
34
+ end
48
35
 
49
- it "should provide a lower-case alpha CharSet" do
50
- (@lowercase_alpha_string =~ /[a-z]{10}/).should_not be_nil
51
- end
36
+ it "should provide a lower-case hexadecimal CharSet" do
37
+ (@lowercase_hex_string =~ /[0-9a-f]{10}/).should_not be_nil
38
+ end
52
39
 
53
- it "should provide an alpha CharSet" do
54
- (@alpha_string =~ /[A-Za-z]{10}/).should_not be_nil
55
- end
40
+ it "should provide a hexadecimal CharSet" do
41
+ (@hex_string =~ /[0-9A-Fa-f]{10}/).should_not be_nil
42
+ end
56
43
 
57
- it "should provide an alpha-numeric CharSet" do
58
- (@alpha_numeric_string =~ /[A-Za-z0-9]{10}/).should_not be_nil
59
- end
44
+ it "should provide an upper-case alpha CharSet" do
45
+ (@uppercase_alpha_string =~ /[A-Z]{10}/).should_not be_nil
46
+ end
60
47
 
61
- it "should provide a space CharSet" do
62
- (@space_string =~ /[ \f\n\r\t\v]{10}/).should_not be_nil
63
- end
48
+ it "should provide a lower-case alpha CharSet" do
49
+ (@lowercase_alpha_string =~ /[a-z]{10}/).should_not be_nil
50
+ end
64
51
 
65
- it "should provide a punctuation CharSet" do
66
- (@punctuation_string =~ /[ \'\"\`\,\;\:\~\-\(\)\[\]\{\}\.\?\!]{10}/).should_not be_nil
67
- end
52
+ it "should provide an alpha CharSet" do
53
+ (@alpha_string =~ /[A-Za-z]{10}/).should_not be_nil
54
+ end
68
55
 
69
- it "should provide a symbols CharSet" do
70
- #(@symbols_string =~ /[\@\#\$\%\^\&\*\_\+\=\|\\\<\>\/]{10}/).should_not be_nil
71
- end
56
+ it "should provide an alpha-numeric CharSet" do
57
+ (@alpha_numeric_string =~ /[A-Za-z0-9]{10}/).should_not be_nil
58
+ end
72
59
 
73
- it "should provide a control CharSet" do
74
- end
60
+ it "should provide a space CharSet" do
61
+ (@space_string =~ /[ \f\n\r\t\v]{10}/).should_not be_nil
62
+ end
75
63
 
76
- it "should provide an ascii CharSet" do
77
- end
64
+ it "should provide a punctuation CharSet" do
65
+ (@punctuation_string =~ /[ \'\"\`\,\;\:\~\-\(\)\[\]\{\}\.\?\!]{10}/).should_not be_nil
66
+ end
78
67
 
79
- it "should provide an 'all' CharSet" do
68
+ it "should provide a symbols CharSet" do
69
+ pending "need to fix the testing regex" do
70
+ (@symbols_string =~ /[\@\#\$\%\^\&\*\_\+\=\|\\\<\>\/]{10}/).should_not be_nil
80
71
  end
81
72
  end
82
73
  end