ronin 0.2.3 → 0.2.4
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.
- 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
metadata
CHANGED
@@ -1,17 +1,48 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ronin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Postmodern
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
|
-
cert_chain:
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIDQDCCAiigAwIBAgIBADANBgkqhkiG9w0BAQUFADBGMRgwFgYDVQQDDA9wb3N0
|
14
|
+
bW9kZXJuLm1vZDMxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixk
|
15
|
+
ARkWA2NvbTAeFw0wOTA2MDMwNDU5MDNaFw0xMDA2MDMwNDU5MDNaMEYxGDAWBgNV
|
16
|
+
BAMMD3Bvc3Rtb2Rlcm4ubW9kMzEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYK
|
17
|
+
CZImiZPyLGQBGRYDY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
|
18
|
+
1wvANkTDHFgVih5XLjuTwTZjgBq1lBGybXJiH6Id1lY2JOMqM5FB1DDHVvvij94i
|
19
|
+
mJabN0zkzu6VKWC70y0IwOxY7CPokr0eFdK/D0y7mCq1P8QITv76i2YqAl0eYqIt
|
20
|
+
W+IhIkANQ7E6uMZIZcdnfadC6lPAtlKkqtd9crvRbFgr6e3kyflmohbRnTEJHoRd
|
21
|
+
7SHHsybE6DSn7oTDs6XBTNrNIn5VfZA0z01eeos/+zBm1zKJOK2+/7xtLLDuDU9G
|
22
|
+
+Rd+ltUBbvxUrMNZmDG29pnmN2xTRH+Q8HxD2AxlvM5SRpK6OeZaHV7PaCCAVZ4L
|
23
|
+
T9BFl1sfMvRlABeGEkSyuQIDAQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIE
|
24
|
+
sDAdBgNVHQ4EFgQUKwsd+PqEYmBvyaTyoL+uRuk+PhEwDQYJKoZIhvcNAQEFBQAD
|
25
|
+
ggEBAB4TvHsrlbcXcKg6gX5BIb9tI+zGkpzo0Z7jnxMEcNO7NGGwmzafDBI/xZYv
|
26
|
+
xkRH3/HXbGGYDOi6Q6gWt5GujSx0bOImDtYTJTH8jnzN92HzEK5WdScm1QpZKF1e
|
27
|
+
cezArMbxbSPaosxTCtG6LQTkE28lFQsmFZ5xzouugS4h5+LVJiVMmiP+l3EfkjFa
|
28
|
+
GOURU+rNEMPWo8MCWivGW7jes6BMzWHcW7DQ0scNVmIcCIgdyMmpscuAEOSeghy9
|
29
|
+
/fFs57Ey2OXBL55nDOyvN/ZQ2Vab05UH4t+GCxjAPeirzL/29FBtePT6VD44c38j
|
30
|
+
pDj+ws7QjtH/Qcrr1l9jfN0ehDs=
|
31
|
+
-----END CERTIFICATE-----
|
11
32
|
|
12
|
-
date: 2009-
|
33
|
+
date: 2009-07-08 00:00:00 -07:00
|
13
34
|
default_executable:
|
14
35
|
dependencies:
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: hoe
|
38
|
+
type: :runtime
|
39
|
+
version_requirement:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 2.0.0
|
45
|
+
version:
|
15
46
|
- !ruby/object:Gem::Dependency
|
16
47
|
name: nokogiri
|
17
48
|
type: :runtime
|
@@ -23,24 +54,24 @@ dependencies:
|
|
23
54
|
version: 1.2.0
|
24
55
|
version:
|
25
56
|
- !ruby/object:Gem::Dependency
|
26
|
-
name:
|
57
|
+
name: addressable
|
27
58
|
type: :runtime
|
28
59
|
version_requirement:
|
29
60
|
version_requirements: !ruby/object:Gem::Requirement
|
30
61
|
requirements:
|
31
|
-
- - "
|
62
|
+
- - "="
|
32
63
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
64
|
+
version: 2.0.2
|
34
65
|
version:
|
35
66
|
- !ruby/object:Gem::Dependency
|
36
|
-
name:
|
67
|
+
name: extlib
|
37
68
|
type: :runtime
|
38
69
|
version_requirement:
|
39
70
|
version_requirements: !ruby/object:Gem::Requirement
|
40
71
|
requirements:
|
41
72
|
- - ">="
|
42
73
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.9.
|
74
|
+
version: 0.9.12
|
44
75
|
version:
|
45
76
|
- !ruby/object:Gem::Dependency
|
46
77
|
name: data_objects
|
@@ -50,7 +81,7 @@ dependencies:
|
|
50
81
|
requirements:
|
51
82
|
- - ">="
|
52
83
|
- !ruby/object:Gem::Version
|
53
|
-
version: 0.9.
|
84
|
+
version: 0.9.12
|
54
85
|
version:
|
55
86
|
- !ruby/object:Gem::Dependency
|
56
87
|
name: do_sqlite3
|
@@ -60,10 +91,10 @@ dependencies:
|
|
60
91
|
requirements:
|
61
92
|
- - ">="
|
62
93
|
- !ruby/object:Gem::Version
|
63
|
-
version: 0.9.
|
94
|
+
version: 0.9.12
|
64
95
|
version:
|
65
96
|
- !ruby/object:Gem::Dependency
|
66
|
-
name: dm-
|
97
|
+
name: dm-core
|
67
98
|
type: :runtime
|
68
99
|
version_requirement:
|
69
100
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -73,7 +104,7 @@ dependencies:
|
|
73
104
|
version: 0.9.11
|
74
105
|
version:
|
75
106
|
- !ruby/object:Gem::Dependency
|
76
|
-
name: dm-
|
107
|
+
name: dm-types
|
77
108
|
type: :runtime
|
78
109
|
version_requirement:
|
79
110
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -100,7 +131,7 @@ dependencies:
|
|
100
131
|
requirements:
|
101
132
|
- - ">="
|
102
133
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.1.
|
134
|
+
version: 0.1.1
|
104
135
|
version:
|
105
136
|
- !ruby/object:Gem::Dependency
|
106
137
|
name: chars
|
@@ -120,7 +151,7 @@ dependencies:
|
|
120
151
|
requirements:
|
121
152
|
- - ">="
|
122
153
|
- !ruby/object:Gem::Version
|
123
|
-
version: 0.1.
|
154
|
+
version: 0.1.7
|
124
155
|
version:
|
125
156
|
- !ruby/object:Gem::Dependency
|
126
157
|
name: contextify
|
@@ -160,9 +191,12 @@ dependencies:
|
|
160
191
|
requirements:
|
161
192
|
- - ">="
|
162
193
|
- !ruby/object:Gem::Version
|
163
|
-
version:
|
194
|
+
version: 2.3.2
|
164
195
|
version:
|
165
|
-
description:
|
196
|
+
description: |-
|
197
|
+
Ronin is a Ruby platform designed for information security and data
|
198
|
+
exploration tasks. Ronin allows for the rapid development and distribution
|
199
|
+
of code over many of the common Source-Code-Management (SCM) systems.
|
166
200
|
email:
|
167
201
|
- postmodern.mod3@gmail.com
|
168
202
|
executables:
|
@@ -171,8 +205,8 @@ executables:
|
|
171
205
|
- ronin-console
|
172
206
|
- ronin-help
|
173
207
|
- ronin-install
|
174
|
-
- ronin-
|
175
|
-
- ronin-
|
208
|
+
- ronin-list
|
209
|
+
- ronin-remove
|
176
210
|
- ronin-uninstall
|
177
211
|
- ronin-update
|
178
212
|
extensions: []
|
@@ -195,8 +229,8 @@ files:
|
|
195
229
|
- bin/ronin-console
|
196
230
|
- bin/ronin-help
|
197
231
|
- bin/ronin-install
|
198
|
-
- bin/ronin-
|
199
|
-
- bin/ronin-
|
232
|
+
- bin/ronin-list
|
233
|
+
- bin/ronin-remove
|
200
234
|
- bin/ronin-uninstall
|
201
235
|
- bin/ronin-update
|
202
236
|
- lib/ronin.rb
|
@@ -204,6 +238,8 @@ files:
|
|
204
238
|
- lib/ronin/static.rb
|
205
239
|
- lib/ronin/static/static.rb
|
206
240
|
- lib/ronin/static/finders.rb
|
241
|
+
- lib/ronin/templates.rb
|
242
|
+
- lib/ronin/templates/erb.rb
|
207
243
|
- lib/ronin/extensions.rb
|
208
244
|
- lib/ronin/extensions/meta.rb
|
209
245
|
- lib/ronin/extensions/meta/object.rb
|
@@ -227,12 +263,12 @@ files:
|
|
227
263
|
- lib/ronin/formatting/extensions/binary.rb
|
228
264
|
- lib/ronin/formatting/extensions/binary/integer.rb
|
229
265
|
- lib/ronin/formatting/extensions/binary/string.rb
|
266
|
+
- lib/ronin/formatting/extensions/binary/file.rb
|
230
267
|
- lib/ronin/formatting/extensions/text.rb
|
231
268
|
- lib/ronin/formatting/extensions/text/string.rb
|
269
|
+
- lib/ronin/formatting/extensions/text/array.rb
|
232
270
|
- lib/ronin/formatting/extensions/http.rb
|
233
271
|
- lib/ronin/formatting/extensions/http/string.rb
|
234
|
-
- lib/ronin/translators.rb
|
235
|
-
- lib/ronin/translators/translator.rb
|
236
272
|
- lib/ronin/path.rb
|
237
273
|
- lib/ronin/network.rb
|
238
274
|
- lib/ronin/network/extensions.rb
|
@@ -278,6 +314,10 @@ files:
|
|
278
314
|
- lib/ronin/rpc/service.rb
|
279
315
|
- lib/ronin/rpc/console.rb
|
280
316
|
- lib/ronin/rpc/shell.rb
|
317
|
+
- lib/ronin/scanners.rb
|
318
|
+
- lib/ronin/scanners/exceptions.rb
|
319
|
+
- lib/ronin/scanners/exceptions/unknown_category.rb
|
320
|
+
- lib/ronin/scanners/scanner.rb
|
281
321
|
- lib/ronin/sessions.rb
|
282
322
|
- lib/ronin/sessions/exceptions.rb
|
283
323
|
- lib/ronin/sessions/exceptions/variable_missing.rb
|
@@ -295,9 +335,13 @@ files:
|
|
295
335
|
- lib/ronin/database/exceptions/invalid_config.rb
|
296
336
|
- lib/ronin/database/database.rb
|
297
337
|
- lib/ronin/model.rb
|
338
|
+
- lib/ronin/model/model.rb
|
339
|
+
- lib/ronin/model/has_name.rb
|
340
|
+
- lib/ronin/model/has_description.rb
|
341
|
+
- lib/ronin/model/has_version.rb
|
342
|
+
- lib/ronin/model/has_license.rb
|
298
343
|
- lib/ronin/author.rb
|
299
344
|
- lib/ronin/license.rb
|
300
|
-
- lib/ronin/has_license.rb
|
301
345
|
- lib/ronin/arch.rb
|
302
346
|
- lib/ronin/os.rb
|
303
347
|
- lib/ronin/product.rb
|
@@ -335,9 +379,9 @@ files:
|
|
335
379
|
- lib/ronin/ui/command_line/commands/console.rb
|
336
380
|
- lib/ronin/ui/command_line/commands/add.rb
|
337
381
|
- lib/ronin/ui/command_line/commands/install.rb
|
338
|
-
- lib/ronin/ui/command_line/commands/
|
382
|
+
- lib/ronin/ui/command_line/commands/list.rb
|
339
383
|
- lib/ronin/ui/command_line/commands/update.rb
|
340
|
-
- lib/ronin/ui/command_line/commands/
|
384
|
+
- lib/ronin/ui/command_line/commands/remove.rb
|
341
385
|
- lib/ronin/ui/command_line/commands/uninstall.rb
|
342
386
|
- lib/ronin/ui/command_line/commands/help.rb
|
343
387
|
- lib/ronin/ui/command_line/command_line.rb
|
@@ -345,7 +389,6 @@ files:
|
|
345
389
|
- lib/ronin/version.rb
|
346
390
|
- tasks/spec.rb
|
347
391
|
- spec/spec_helper.rb
|
348
|
-
- spec/classes/licensed_model.rb
|
349
392
|
- spec/classes/cacheable_model.rb
|
350
393
|
- spec/helpers/database.rb
|
351
394
|
- spec/helpers/cacheable.rb
|
@@ -357,9 +400,10 @@ files:
|
|
357
400
|
- spec/static/helpers/static.rb
|
358
401
|
- spec/static/finders_spec.rb
|
359
402
|
- spec/static/static_spec.rb
|
403
|
+
- spec/templates/classes/uses_erb.rb
|
404
|
+
- spec/templates/erb_spec.rb
|
360
405
|
- spec/arch_spec.rb
|
361
406
|
- spec/author_spec.rb
|
362
|
-
- spec/translators/translator_spec.rb
|
363
407
|
- spec/extensions/kernel_spec.rb
|
364
408
|
- spec/extensions/array_spec.rb
|
365
409
|
- spec/extensions/hash_spec.rb
|
@@ -393,15 +437,21 @@ files:
|
|
393
437
|
- spec/formatting/digest/string_spec.rb
|
394
438
|
- spec/formatting/http/string_spec.rb
|
395
439
|
- spec/formatting/text/string_spec.rb
|
440
|
+
- spec/formatting/text/array_spec.rb
|
441
|
+
- spec/network/http_spec.rb
|
396
442
|
- spec/code/classes/thing.rb
|
397
443
|
- spec/code/reference_spec.rb
|
398
444
|
- spec/code/symbol_table_spec.rb
|
445
|
+
- spec/model/classes/licensed_model.rb
|
446
|
+
- spec/model/has_license_spec.rb
|
399
447
|
- spec/license_spec.rb
|
400
|
-
- spec/has_license_spec.rb
|
401
448
|
- spec/path_spec.rb
|
402
449
|
- spec/os_spec.rb
|
403
450
|
- spec/product_spec.rb
|
404
451
|
- spec/cacheable_spec.rb
|
452
|
+
- spec/scanners/classes/example_scanner.rb
|
453
|
+
- spec/scanners/classes/another_scanner.rb
|
454
|
+
- spec/scanners/scanner_spec.rb
|
405
455
|
- spec/sessions/classes/test_session.rb
|
406
456
|
- spec/sessions/classes/uses_test_session.rb
|
407
457
|
- spec/sessions/session_spec.rb
|
@@ -418,6 +468,7 @@ files:
|
|
418
468
|
- spec/platform/helpers/overlays/hello/hello/extension.rb
|
419
469
|
- spec/platform/helpers/overlays/random/ronin.xml
|
420
470
|
- spec/platform/helpers/overlays/random/random/extension.rb
|
471
|
+
- spec/platform/maintainer_spec.rb
|
421
472
|
- spec/platform/extension_spec.rb
|
422
473
|
- spec/platform/overlay_spec.rb
|
423
474
|
- spec/platform/overlay_cache_spec.rb
|
@@ -429,6 +480,8 @@ files:
|
|
429
480
|
- static/ronin/platform/overlay.xsl
|
430
481
|
has_rdoc: true
|
431
482
|
homepage: http://ronin.rubyforge.org/
|
483
|
+
licenses: []
|
484
|
+
|
432
485
|
post_install_message:
|
433
486
|
rdoc_options:
|
434
487
|
- --main
|
@@ -450,9 +503,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
450
503
|
requirements: []
|
451
504
|
|
452
505
|
rubyforge_project: ronin
|
453
|
-
rubygems_version: 1.3.
|
506
|
+
rubygems_version: 1.3.4
|
454
507
|
signing_key:
|
455
|
-
specification_version:
|
508
|
+
specification_version: 3
|
456
509
|
summary: Ronin is a Ruby platform designed for information security and data exploration tasks
|
457
510
|
test_files: []
|
458
511
|
|
metadata.gz.sig
ADDED
Binary file
|
@@ -1,75 +0,0 @@
|
|
1
|
-
#
|
2
|
-
#--
|
3
|
-
# Ronin - A Ruby platform designed for information security and data
|
4
|
-
# exploration tasks.
|
5
|
-
#
|
6
|
-
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
|
-
#
|
8
|
-
# This program is free software; you can redistribute it and/or modify
|
9
|
-
# it under the terms of the GNU General Public License as published by
|
10
|
-
# the Free Software Foundation; either version 2 of the License, or
|
11
|
-
# (at your option) any later version.
|
12
|
-
#
|
13
|
-
# This program is distributed in the hope that it will be useful,
|
14
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
-
# GNU General Public License for more details.
|
17
|
-
#
|
18
|
-
# You should have received a copy of the GNU General Public License
|
19
|
-
# along with this program; if not, write to the Free Software
|
20
|
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
21
|
-
#++
|
22
|
-
#
|
23
|
-
|
24
|
-
module Ronin
|
25
|
-
module Translators
|
26
|
-
class Translator
|
27
|
-
|
28
|
-
#
|
29
|
-
# Creates a new Translator object with the given _options_. If a
|
30
|
-
# _block_ is given, it will be passed the newly created Translator
|
31
|
-
# object.
|
32
|
-
#
|
33
|
-
def initialize(options={},&block)
|
34
|
-
block.call(self) if block
|
35
|
-
end
|
36
|
-
|
37
|
-
#
|
38
|
-
# Encodes the specified _data_ with given _options_. If a _block_ is
|
39
|
-
# given it will be passed the encoded data.
|
40
|
-
#
|
41
|
-
def self.encode(data,options={},&block)
|
42
|
-
self.new(options).encode(data,&block)
|
43
|
-
end
|
44
|
-
|
45
|
-
#
|
46
|
-
# Decodes the specified _data_ with given _options_. If a _block_ is
|
47
|
-
# given it will be passed the decoded data.
|
48
|
-
#
|
49
|
-
def self.decode(data,options={},&block)
|
50
|
-
self.new(options).decode(data,&block)
|
51
|
-
end
|
52
|
-
|
53
|
-
#
|
54
|
-
# The default encoding method which simply returns the specified
|
55
|
-
# _data_. If a _block_ is given, it will be passed the
|
56
|
-
# specified _data_.
|
57
|
-
#
|
58
|
-
def encode(data,&block)
|
59
|
-
block.call(data) if block
|
60
|
-
return data
|
61
|
-
end
|
62
|
-
|
63
|
-
#
|
64
|
-
# The default decoding method which simply returns the specified
|
65
|
-
# _data_. If a _block_ is given, it will be passed the
|
66
|
-
# specified _data_.
|
67
|
-
#
|
68
|
-
def decode(data,&block)
|
69
|
-
block.call(data) if block
|
70
|
-
return data
|
71
|
-
end
|
72
|
-
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
@@ -1,61 +0,0 @@
|
|
1
|
-
require 'ronin/translators/translator'
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
describe Translators::Translator do
|
6
|
-
it "should create a new Translator object with options" do
|
7
|
-
Translators::Translator.new(:test => 1).should_not be_nil
|
8
|
-
end
|
9
|
-
|
10
|
-
it "should create a new Translator object with options and a block" do
|
11
|
-
Translators::Translator.new(:test => 2) do |translator|
|
12
|
-
translator.should_not be_nil
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should encode data with given options" do
|
17
|
-
data = 'test'
|
18
|
-
|
19
|
-
Translators::Translator.encode(data,:test => 3).should == data
|
20
|
-
end
|
21
|
-
|
22
|
-
it "should encode data with given options and a block" do
|
23
|
-
data = 'test'
|
24
|
-
|
25
|
-
Translators::Translator.encode(data,:test => 4) do |encoded|
|
26
|
-
encoded.should == data
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should provide a default encode method" do
|
31
|
-
data = 'test'
|
32
|
-
translator = Translators::Translator.new
|
33
|
-
|
34
|
-
translator.encode(data).should == data
|
35
|
-
end
|
36
|
-
|
37
|
-
it "should provide a default encode method which receives a block" do
|
38
|
-
data = 'test'
|
39
|
-
translator = Translators::Translator.new
|
40
|
-
|
41
|
-
translator.encode(data) do |encoded|
|
42
|
-
encoded.should == data
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
it "should provide a default decode method" do
|
47
|
-
data = 'test'
|
48
|
-
translator = Translators::Translator.new
|
49
|
-
|
50
|
-
translator.decode(data).should == data
|
51
|
-
end
|
52
|
-
|
53
|
-
it "should provide a default decode method which receives a block" do
|
54
|
-
data = 'test'
|
55
|
-
translator = Translators::Translator.new
|
56
|
-
|
57
|
-
translator.decode(data) do |decoded|
|
58
|
-
decoded.should == data
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|