ronin 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +2 -0
- data/History.txt +43 -0
- data/Manifest.txt +27 -10
- data/README.txt +2 -1
- data/Rakefile +12 -11
- data/TODO.txt +8 -0
- data/bin/{ronin-ls → ronin-list} +2 -2
- data/bin/{ronin-rm → ronin-remove} +2 -2
- data/lib/ronin/cacheable.rb +25 -4
- data/lib/ronin/code/reference.rb +0 -9
- data/lib/ronin/code/symbol_table.rb +5 -5
- data/lib/ronin/code/token.rb +1 -1
- data/lib/ronin/database/database.rb +3 -1
- data/lib/ronin/extensions/kernel.rb +25 -3
- data/lib/ronin/formatting/extensions/binary/file.rb +60 -0
- data/lib/ronin/formatting/extensions/text.rb +1 -0
- data/lib/ronin/formatting/extensions/text/array.rb +67 -0
- data/lib/ronin/model.rb +1 -40
- data/lib/ronin/{has_license.rb → model/has_description.rb} +16 -18
- data/lib/ronin/model/has_license.rb +53 -0
- data/lib/ronin/model/has_name.rb +49 -0
- data/lib/ronin/model/has_version.rb +46 -0
- data/lib/ronin/model/model.rb +64 -0
- data/lib/ronin/network/extensions/http/net.rb +580 -99
- data/lib/ronin/network/http.rb +54 -6
- data/lib/ronin/os.rb +7 -7
- data/lib/ronin/platform/extension.rb +4 -6
- data/lib/ronin/platform/maintainer.rb +1 -1
- data/lib/ronin/platform/object_cache.rb +10 -2
- data/lib/ronin/platform/overlay_cache.rb +1 -1
- data/lib/ronin/platform/platform.rb +5 -3
- data/lib/ronin/platform/ronin.rb +3 -3
- data/lib/ronin/scanners.rb +25 -0
- data/lib/ronin/scanners/exceptions.rb +24 -0
- data/lib/ronin/scanners/exceptions/unknown_category.rb +29 -0
- data/lib/ronin/scanners/scanner.rb +239 -0
- data/lib/ronin/sessions/http.rb +548 -7
- data/lib/ronin/{translators.rb → templates.rb} +1 -1
- data/lib/ronin/templates/erb.rb +56 -0
- data/lib/ronin/ui/command_line/command_line.rb +10 -1
- data/lib/ronin/ui/command_line/commands/{ls.rb → list.rb} +1 -1
- data/lib/ronin/ui/command_line/commands/{rm.rb → remove.rb} +1 -1
- data/lib/ronin/ui/command_line/commands/uninstall.rb +2 -2
- data/lib/ronin/ui/console.rb +66 -17
- data/lib/ronin/ui/shell.rb +16 -36
- data/lib/ronin/version.rb +1 -1
- data/spec/cacheable_spec.rb +1 -1
- data/spec/code/classes/thing.rb +4 -0
- data/spec/code/reference_spec.rb +4 -0
- data/spec/code/symbol_table_spec.rb +5 -1
- data/spec/extensions/kernel_spec.rb +45 -5
- data/spec/extensions/string_spec.rb +4 -0
- data/spec/formatting/binary/integer_spec.rb +3 -3
- data/spec/formatting/binary/string_spec.rb +5 -5
- data/spec/formatting/digest/string_spec.rb +5 -9
- data/spec/formatting/http/string_spec.rb +5 -9
- data/spec/formatting/text/array_spec.rb +64 -0
- data/spec/formatting/text/string_spec.rb +3 -3
- data/spec/model/classes/licensed_model.rb +12 -0
- data/spec/{has_license_spec.rb → model/has_license_spec.rb} +5 -5
- data/spec/network/http_spec.rb +197 -0
- data/spec/os_spec.rb +2 -5
- data/spec/platform/maintainer_spec.rb +30 -0
- data/spec/platform/ronin_spec.rb +2 -2
- data/spec/scanners/classes/another_scanner.rb +16 -0
- data/spec/scanners/classes/example_scanner.rb +22 -0
- data/spec/scanners/scanner_spec.rb +148 -0
- data/spec/spec_helper.rb +1 -1
- data/spec/templates/classes/uses_erb.rb +11 -0
- data/spec/templates/erb_spec.rb +20 -0
- data/static/ronin/platform/overlay.xsl +128 -49
- metadata +83 -30
- metadata.gz.sig +0 -0
- data/lib/ronin/translators/translator.rb +0 -75
- data/spec/classes/licensed_model.rb +0 -12
- data/spec/translators/translator_spec.rb +0 -61
data.tar.gz.sig
ADDED
data/History.txt
CHANGED
@@ -1,3 +1,45 @@
|
|
1
|
+
=== 0.2.4 / 2009-07-02
|
2
|
+
|
3
|
+
* Require Hoe >= 2.0.0
|
4
|
+
* Require Parameters >= 0.1.6.
|
5
|
+
* Dropped dependency for dm-serializer.
|
6
|
+
* Added Kernel#catch_all.
|
7
|
+
* Added Array#bytes.
|
8
|
+
* Added Array#chars.
|
9
|
+
* Added Array#char_string.
|
10
|
+
* Added File.unhexdump.
|
11
|
+
* Added Ronin::Templates::Erb.
|
12
|
+
* Added Ronin::Model::HasName.
|
13
|
+
* Added Ronin::Model::HasDescription.
|
14
|
+
* Added Ronin::Model::HasVersion.
|
15
|
+
* Added Cacheable#prepared_for_cache?.
|
16
|
+
* Added Cacheable#original_loaded?.
|
17
|
+
* Added Network::HTTP.expand_options.
|
18
|
+
* Added Net.http_request.
|
19
|
+
* Added Sessions::HTTP#http_request.
|
20
|
+
* Added Ronin::Scanners::Scanner.
|
21
|
+
* Added Ronin::UI::Console.backtrace_depth.
|
22
|
+
* Added Ronin::UI::Console.backtrace_depth=.
|
23
|
+
* Moved Ronin::HasLicense into Ronin::Model.
|
24
|
+
* Renamed Kernel#try to Kernel#attempt.
|
25
|
+
* Renamed Ronin.method_missing to Ronin#method_missing.
|
26
|
+
* Renamed Ronin::UI::CommandLine::Commands::Ls to
|
27
|
+
Ronin::UI::CommandLine::Commands::List.
|
28
|
+
* Renamed Ronin::UI::CommandLine::Commands::Rm to
|
29
|
+
Ronin::UI::CommandLine::Commands::Remove.
|
30
|
+
* Refactored OS.define.
|
31
|
+
* Refactored Ronin::Shell as a module.
|
32
|
+
* Removed Ronin::Translators.
|
33
|
+
* Fixed a bug where if an object failed to be cached,
|
34
|
+
it would prevent an Overlay from being added to the
|
35
|
+
OverlayCache.
|
36
|
+
* Fixed a bug where Gem::LoadError was being rescued,
|
37
|
+
when only ::LoadError should be rescued.
|
38
|
+
* Fixed a typo in Maintainer#inspect.
|
39
|
+
* Updated the Overlay XSL file.
|
40
|
+
* Cleaned up CSS.
|
41
|
+
* Removed the jQuery expander plugin.
|
42
|
+
|
1
43
|
=== 0.2.3 / 2009-05-06
|
2
44
|
|
3
45
|
* Require extlib >= 0.9.12.
|
@@ -49,6 +91,7 @@
|
|
49
91
|
Ronin::UI::CommandLine::Commands::Rm.
|
50
92
|
* Moved Ronin::UI::CommandLine::ParamParser into the Parameters library.
|
51
93
|
* Refactored specs to run on Ruby 1.9.1-p0.
|
94
|
+
* Added more specs.
|
52
95
|
* All specs now pass on Ruby 1.9.1-p0.
|
53
96
|
|
54
97
|
=== 0.2.2 / 2009-03-26
|
data/Manifest.txt
CHANGED
@@ -9,8 +9,8 @@ bin/ronin-add
|
|
9
9
|
bin/ronin-console
|
10
10
|
bin/ronin-help
|
11
11
|
bin/ronin-install
|
12
|
-
bin/ronin-
|
13
|
-
bin/ronin-
|
12
|
+
bin/ronin-list
|
13
|
+
bin/ronin-remove
|
14
14
|
bin/ronin-uninstall
|
15
15
|
bin/ronin-update
|
16
16
|
lib/ronin.rb
|
@@ -18,6 +18,8 @@ lib/ronin/config.rb
|
|
18
18
|
lib/ronin/static.rb
|
19
19
|
lib/ronin/static/static.rb
|
20
20
|
lib/ronin/static/finders.rb
|
21
|
+
lib/ronin/templates.rb
|
22
|
+
lib/ronin/templates/erb.rb
|
21
23
|
lib/ronin/extensions.rb
|
22
24
|
lib/ronin/extensions/meta.rb
|
23
25
|
lib/ronin/extensions/meta/object.rb
|
@@ -41,12 +43,12 @@ lib/ronin/formatting/extensions/digest/string.rb
|
|
41
43
|
lib/ronin/formatting/extensions/binary.rb
|
42
44
|
lib/ronin/formatting/extensions/binary/integer.rb
|
43
45
|
lib/ronin/formatting/extensions/binary/string.rb
|
46
|
+
lib/ronin/formatting/extensions/binary/file.rb
|
44
47
|
lib/ronin/formatting/extensions/text.rb
|
45
48
|
lib/ronin/formatting/extensions/text/string.rb
|
49
|
+
lib/ronin/formatting/extensions/text/array.rb
|
46
50
|
lib/ronin/formatting/extensions/http.rb
|
47
51
|
lib/ronin/formatting/extensions/http/string.rb
|
48
|
-
lib/ronin/translators.rb
|
49
|
-
lib/ronin/translators/translator.rb
|
50
52
|
lib/ronin/path.rb
|
51
53
|
lib/ronin/network.rb
|
52
54
|
lib/ronin/network/extensions.rb
|
@@ -92,6 +94,10 @@ lib/ronin/rpc/client.rb
|
|
92
94
|
lib/ronin/rpc/service.rb
|
93
95
|
lib/ronin/rpc/console.rb
|
94
96
|
lib/ronin/rpc/shell.rb
|
97
|
+
lib/ronin/scanners.rb
|
98
|
+
lib/ronin/scanners/exceptions.rb
|
99
|
+
lib/ronin/scanners/exceptions/unknown_category.rb
|
100
|
+
lib/ronin/scanners/scanner.rb
|
95
101
|
lib/ronin/sessions.rb
|
96
102
|
lib/ronin/sessions/exceptions.rb
|
97
103
|
lib/ronin/sessions/exceptions/variable_missing.rb
|
@@ -109,9 +115,13 @@ lib/ronin/database/exceptions.rb
|
|
109
115
|
lib/ronin/database/exceptions/invalid_config.rb
|
110
116
|
lib/ronin/database/database.rb
|
111
117
|
lib/ronin/model.rb
|
118
|
+
lib/ronin/model/model.rb
|
119
|
+
lib/ronin/model/has_name.rb
|
120
|
+
lib/ronin/model/has_description.rb
|
121
|
+
lib/ronin/model/has_version.rb
|
122
|
+
lib/ronin/model/has_license.rb
|
112
123
|
lib/ronin/author.rb
|
113
124
|
lib/ronin/license.rb
|
114
|
-
lib/ronin/has_license.rb
|
115
125
|
lib/ronin/arch.rb
|
116
126
|
lib/ronin/os.rb
|
117
127
|
lib/ronin/product.rb
|
@@ -149,9 +159,9 @@ lib/ronin/ui/command_line/options.rb
|
|
149
159
|
lib/ronin/ui/command_line/commands/console.rb
|
150
160
|
lib/ronin/ui/command_line/commands/add.rb
|
151
161
|
lib/ronin/ui/command_line/commands/install.rb
|
152
|
-
lib/ronin/ui/command_line/commands/
|
162
|
+
lib/ronin/ui/command_line/commands/list.rb
|
153
163
|
lib/ronin/ui/command_line/commands/update.rb
|
154
|
-
lib/ronin/ui/command_line/commands/
|
164
|
+
lib/ronin/ui/command_line/commands/remove.rb
|
155
165
|
lib/ronin/ui/command_line/commands/uninstall.rb
|
156
166
|
lib/ronin/ui/command_line/commands/help.rb
|
157
167
|
lib/ronin/ui/command_line/command_line.rb
|
@@ -159,7 +169,6 @@ lib/ronin/ronin.rb
|
|
159
169
|
lib/ronin/version.rb
|
160
170
|
tasks/spec.rb
|
161
171
|
spec/spec_helper.rb
|
162
|
-
spec/classes/licensed_model.rb
|
163
172
|
spec/classes/cacheable_model.rb
|
164
173
|
spec/helpers/database.rb
|
165
174
|
spec/helpers/cacheable.rb
|
@@ -171,9 +180,10 @@ spec/static/helpers/static2/dir/two.txt
|
|
171
180
|
spec/static/helpers/static.rb
|
172
181
|
spec/static/finders_spec.rb
|
173
182
|
spec/static/static_spec.rb
|
183
|
+
spec/templates/classes/uses_erb.rb
|
184
|
+
spec/templates/erb_spec.rb
|
174
185
|
spec/arch_spec.rb
|
175
186
|
spec/author_spec.rb
|
176
|
-
spec/translators/translator_spec.rb
|
177
187
|
spec/extensions/kernel_spec.rb
|
178
188
|
spec/extensions/array_spec.rb
|
179
189
|
spec/extensions/hash_spec.rb
|
@@ -207,15 +217,21 @@ spec/formatting/binary/string_spec.rb
|
|
207
217
|
spec/formatting/digest/string_spec.rb
|
208
218
|
spec/formatting/http/string_spec.rb
|
209
219
|
spec/formatting/text/string_spec.rb
|
220
|
+
spec/formatting/text/array_spec.rb
|
221
|
+
spec/network/http_spec.rb
|
210
222
|
spec/code/classes/thing.rb
|
211
223
|
spec/code/reference_spec.rb
|
212
224
|
spec/code/symbol_table_spec.rb
|
225
|
+
spec/model/classes/licensed_model.rb
|
226
|
+
spec/model/has_license_spec.rb
|
213
227
|
spec/license_spec.rb
|
214
|
-
spec/has_license_spec.rb
|
215
228
|
spec/path_spec.rb
|
216
229
|
spec/os_spec.rb
|
217
230
|
spec/product_spec.rb
|
218
231
|
spec/cacheable_spec.rb
|
232
|
+
spec/scanners/classes/example_scanner.rb
|
233
|
+
spec/scanners/classes/another_scanner.rb
|
234
|
+
spec/scanners/scanner_spec.rb
|
219
235
|
spec/sessions/classes/test_session.rb
|
220
236
|
spec/sessions/classes/uses_test_session.rb
|
221
237
|
spec/sessions/session_spec.rb
|
@@ -232,6 +248,7 @@ spec/platform/helpers/overlays/hello/lib/stuff/another_test.rb
|
|
232
248
|
spec/platform/helpers/overlays/hello/hello/extension.rb
|
233
249
|
spec/platform/helpers/overlays/random/ronin.xml
|
234
250
|
spec/platform/helpers/overlays/random/random/extension.rb
|
251
|
+
spec/platform/maintainer_spec.rb
|
235
252
|
spec/platform/extension_spec.rb
|
236
253
|
spec/platform/overlay_spec.rb
|
237
254
|
spec/platform/overlay_cache_spec.rb
|
data/README.txt
CHANGED
@@ -67,6 +67,7 @@ of Ronin.
|
|
67
67
|
|
68
68
|
== REQUIREMENTS:
|
69
69
|
|
70
|
+
* {libxml2}[http://xmlsoft.org/]
|
70
71
|
* {libsqlite3}[http://sqlite.org/]
|
71
72
|
* {nokogiri}[http://nokogiri.rubyforge.org/] >= 1.2.0
|
72
73
|
* {DataMapper}[http://datamapper.org/]:
|
@@ -95,7 +96,7 @@ of Ronin.
|
|
95
96
|
|
96
97
|
* List installed Overlays:
|
97
98
|
|
98
|
-
$ ronin
|
99
|
+
$ ronin list
|
99
100
|
|
100
101
|
* Update all installed Overlays:
|
101
102
|
|
data/Rakefile
CHANGED
@@ -2,25 +2,26 @@
|
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'hoe'
|
5
|
+
require 'hoe/signing'
|
5
6
|
require './tasks/spec.rb'
|
6
|
-
require './lib/ronin/version.rb'
|
7
7
|
|
8
|
-
Hoe.
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
Hoe.spec('ronin') do
|
9
|
+
self.rubyforge_name = 'ronin'
|
10
|
+
self.developer('Postmodern','postmodern.mod3@gmail.com')
|
11
|
+
self.remote_rdoc_dir = 'docs/ronin'
|
12
|
+
self.extra_deps = [
|
13
|
+
['hoe', '>=2.0.0'],
|
13
14
|
['nokogiri', '>=1.2.0'],
|
15
|
+
['addressable', '=2.0.2'],
|
14
16
|
['extlib', '>=0.9.12'],
|
17
|
+
['data_objects', '>=0.9.12'],
|
18
|
+
['do_sqlite3', '>=0.9.12'],
|
15
19
|
['dm-core', '>=0.9.11'],
|
16
|
-
['data_objects', '>=0.9.11'],
|
17
|
-
['do_sqlite3', '>=0.9.11'],
|
18
20
|
['dm-types', '>=0.9.11'],
|
19
|
-
['dm-serializer', '>=0.9.11'],
|
20
21
|
['dm-validations', '>=0.9.11'],
|
21
|
-
['dm-predefined', '>=0.1.
|
22
|
+
['dm-predefined', '>=0.1.1'],
|
22
23
|
['chars', '>=0.1.1'],
|
23
|
-
['parameters', '>=0.1.
|
24
|
+
['parameters', '>=0.1.7'],
|
24
25
|
['contextify', '>=0.1.2'],
|
25
26
|
['reverse-require', '>=0.3.1'],
|
26
27
|
['repertoire', '>=0.2.1']
|
data/TODO.txt
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
== TODO:
|
2
2
|
|
3
|
+
=== Ronin 0.2.5:
|
4
|
+
|
5
|
+
* Move Ronin::RPC code into ronin-exploits.
|
6
|
+
|
7
|
+
=== Longterm:
|
8
|
+
|
9
|
+
* Move to YARD for API documentation.
|
10
|
+
* Develop a custom YARD Template for Ronin libraries.
|
3
11
|
* Look into using Ronin over Tor/i2p.
|
4
12
|
* Discuss ideas for a Web UI:
|
5
13
|
* Configurable menu-bar / side-bar.
|
data/bin/{ronin-ls → ronin-list}
RENAMED
@@ -7,6 +7,6 @@ unless $LOAD_PATH.include?(lib_dir)
|
|
7
7
|
$LOAD_PATH << lib_dir
|
8
8
|
end
|
9
9
|
|
10
|
-
require 'ronin/ui/command_line/commands/
|
10
|
+
require 'ronin/ui/command_line/commands/list'
|
11
11
|
|
12
|
-
Ronin::UI::CommandLine::Commands::
|
12
|
+
Ronin::UI::CommandLine::Commands::List.run(*ARGV)
|
@@ -7,6 +7,6 @@ unless $LOAD_PATH.include?(lib_dir)
|
|
7
7
|
$LOAD_PATH << lib_dir
|
8
8
|
end
|
9
9
|
|
10
|
-
require 'ronin/ui/command_line/commands/
|
10
|
+
require 'ronin/ui/command_line/commands/remove'
|
11
11
|
|
12
|
-
Ronin::UI::CommandLine::Commands::
|
12
|
+
Ronin::UI::CommandLine::Commands::Remove.run(*ARGV)
|
data/lib/ronin/cacheable.rb
CHANGED
@@ -98,14 +98,18 @@ module Ronin
|
|
98
98
|
# Loads all objects with the matching _attributes_.
|
99
99
|
#
|
100
100
|
def self.load_all(attributes={})
|
101
|
-
self.all(attributes).map { |obj| obj.load_original }
|
101
|
+
self.all(attributes).map { |obj| obj.load_original! }
|
102
102
|
end
|
103
103
|
|
104
104
|
#
|
105
105
|
# Loads the first object with the matching _attributes_.
|
106
106
|
#
|
107
107
|
def self.load_first(attributes={})
|
108
|
-
self.first(attributes)
|
108
|
+
if (obj = self.first(attributes))
|
109
|
+
obj.load_original!
|
110
|
+
end
|
111
|
+
|
112
|
+
return obj
|
109
113
|
end
|
110
114
|
end
|
111
115
|
|
@@ -154,6 +158,14 @@ module Ronin
|
|
154
158
|
end
|
155
159
|
end
|
156
160
|
|
161
|
+
#
|
162
|
+
# Returns +true+ if the original code has been loaded, returns +false+
|
163
|
+
# otherwise.
|
164
|
+
#
|
165
|
+
def original_loaded?
|
166
|
+
@original_loaded == true
|
167
|
+
end
|
168
|
+
|
157
169
|
#
|
158
170
|
# Load the code from the cached file for the object.
|
159
171
|
#
|
@@ -179,7 +191,7 @@ module Ronin
|
|
179
191
|
self.class.all(:cached_path => self.cached_path).destroy!
|
180
192
|
|
181
193
|
self.cached_timestamp = File.mtime(self.cached_path)
|
182
|
-
return save
|
194
|
+
return save
|
183
195
|
end
|
184
196
|
|
185
197
|
return false
|
@@ -211,6 +223,14 @@ module Ronin
|
|
211
223
|
return false
|
212
224
|
end
|
213
225
|
|
226
|
+
#
|
227
|
+
# Returns +true+ if the object has been prepared to be cached,
|
228
|
+
# returns +false+ otherwise.
|
229
|
+
#
|
230
|
+
def prepared_for_cache?
|
231
|
+
@cache_prepared == true
|
232
|
+
end
|
233
|
+
|
214
234
|
#
|
215
235
|
# Prepares the object for caching.
|
216
236
|
#
|
@@ -235,8 +255,9 @@ module Ronin
|
|
235
255
|
# method again.
|
236
256
|
#
|
237
257
|
def method_missing(name,*arguments,&block)
|
238
|
-
|
258
|
+
if (self.cached_path && !(@original_loaded))
|
239
259
|
load_original!
|
260
|
+
|
240
261
|
return self.send(name,*arguments,&block)
|
241
262
|
else
|
242
263
|
return super(name,*arguments,&block)
|
data/lib/ronin/code/reference.rb
CHANGED
@@ -83,15 +83,6 @@ module Ronin
|
|
83
83
|
return self
|
84
84
|
end
|
85
85
|
|
86
|
-
#
|
87
|
-
# Evaluates the given _code_ within the referenced object. If a
|
88
|
-
# _block_ is given, it will be evaluated within the referenced
|
89
|
-
# object.
|
90
|
-
#
|
91
|
-
def eval(code,&block)
|
92
|
-
@value.eval(code,&block)
|
93
|
-
end
|
94
|
-
|
95
86
|
#
|
96
87
|
# Evaluates the given _block_ within the referenced object.
|
97
88
|
#
|
@@ -42,14 +42,14 @@ module Ronin
|
|
42
42
|
# _name_, returns +false+ otherwise.
|
43
43
|
#
|
44
44
|
def has_symbol?(name)
|
45
|
-
@table.has_key?(name.
|
45
|
+
@table.has_key?(name.to_sym)
|
46
46
|
end
|
47
47
|
|
48
48
|
#
|
49
49
|
# Returns the symbol with the specified _name_.
|
50
50
|
#
|
51
51
|
def symbol(name)
|
52
|
-
@table[name.
|
52
|
+
@table[name.to_sym]
|
53
53
|
end
|
54
54
|
|
55
55
|
#
|
@@ -71,7 +71,7 @@ module Ronin
|
|
71
71
|
#
|
72
72
|
def symbols=(hash)
|
73
73
|
hash.each do |name,value|
|
74
|
-
self[name] = value
|
74
|
+
self[name.to_sym] = value
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
@@ -79,14 +79,14 @@ module Ronin
|
|
79
79
|
# Returns the value of the symbol with the specified _name_.
|
80
80
|
#
|
81
81
|
def [](name)
|
82
|
-
@table[name.
|
82
|
+
@table[name.to_sym].value
|
83
83
|
end
|
84
84
|
|
85
85
|
#
|
86
86
|
# Sets the _value_ of the symbol with the specified _name_.
|
87
87
|
#
|
88
88
|
def []=(name,value)
|
89
|
-
@table[name.
|
89
|
+
@table[name.to_sym].value = value
|
90
90
|
end
|
91
91
|
|
92
92
|
#
|
data/lib/ronin/code/token.rb
CHANGED
@@ -21,6 +21,8 @@
|
|
21
21
|
#++
|
22
22
|
#
|
23
23
|
|
24
|
+
gem 'addressable', '2.0.2'
|
25
|
+
|
24
26
|
require 'ronin/database/exceptions/invalid_config'
|
25
27
|
require 'ronin/model'
|
26
28
|
require 'ronin/arch'
|
@@ -46,7 +48,7 @@ module Ronin
|
|
46
48
|
|
47
49
|
# Default configuration of the database
|
48
50
|
DEFAULT_CONFIG = {
|
49
|
-
:adapter =>
|
51
|
+
:adapter => 'sqlite3',
|
50
52
|
:database => File.join(Config::PATH,'database.sqlite3')
|
51
53
|
}
|
52
54
|
|
@@ -26,14 +26,36 @@ module Kernel
|
|
26
26
|
# Calls the given _block_ and ignores any raised exceptions.
|
27
27
|
# If an exception is raised, +nil+ will be returned.
|
28
28
|
#
|
29
|
-
#
|
29
|
+
# attempt do
|
30
30
|
# Resolv.getaddress('might.not.exist.com')
|
31
31
|
# end
|
32
32
|
#
|
33
|
-
def
|
33
|
+
def attempt(&block)
|
34
34
|
begin
|
35
35
|
block.call if block
|
36
|
-
rescue
|
36
|
+
rescue Exception
|
37
|
+
return nil
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
#
|
42
|
+
# Attempts to run the given _block_ and catches any SyntaxError,
|
43
|
+
# RuntimeError or StandardError exceptions. If any exceptions are
|
44
|
+
# caught, they will be printed out and +nil+ will be returned.
|
45
|
+
#
|
46
|
+
# catch_all do
|
47
|
+
# load 'suspicious.rb'
|
48
|
+
# end
|
49
|
+
#
|
50
|
+
def catch_all(verbose=true,&block)
|
51
|
+
begin
|
52
|
+
block.call if block
|
53
|
+
rescue Exception => e
|
54
|
+
if verbose
|
55
|
+
STDERR.puts "#{e.class}: #{e}"
|
56
|
+
e.backtrace[0,5].each { |trace| STDERR.puts "\t#{trace}" }
|
57
|
+
end
|
58
|
+
|
37
59
|
return nil
|
38
60
|
end
|
39
61
|
end
|