ronin 0.2.0 → 0.2.1
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/History.txt +21 -0
- data/Manifest.txt +17 -6
- data/README.txt +3 -2
- data/Rakefile +1 -0
- data/bin/ronin-add +12 -0
- data/bin/ronin-console +12 -0
- data/bin/ronin-ext +12 -0
- data/bin/ronin-help +12 -0
- data/bin/ronin-install +12 -0
- data/bin/ronin-ls +12 -0
- data/bin/ronin-overlay +12 -0
- data/bin/ronin-rm +12 -0
- data/bin/ronin-uninstall +12 -0
- data/bin/ronin-update +12 -0
- data/lib/ronin/extensions/string.rb +5 -3
- data/lib/ronin/platform/extension.rb +8 -2
- data/lib/ronin/platform/overlay.rb +16 -32
- data/lib/ronin/ui.rb +1 -1
- data/lib/ronin/ui/command_line.rb +1 -1
- data/lib/ronin/ui/command_line/command.rb +42 -60
- data/lib/ronin/ui/command_line/command_line.rb +28 -50
- data/lib/ronin/ui/command_line/commands/add.rb +41 -40
- data/lib/ronin/ui/command_line/commands/{default.rb → console.rb} +28 -21
- data/lib/ronin/ui/command_line/commands/{extension.rb → ext.rb} +25 -27
- data/lib/ronin/ui/command_line/commands/help.rb +26 -28
- data/lib/ronin/ui/command_line/commands/install.rb +32 -32
- data/lib/ronin/ui/command_line/commands/ls.rb +123 -0
- data/lib/ronin/ui/command_line/commands/overlay.rb +115 -114
- data/lib/ronin/ui/command_line/commands/{remove.rb → rm.rb} +27 -29
- data/lib/ronin/ui/command_line/commands/uninstall.rb +27 -29
- data/lib/ronin/ui/command_line/commands/update.rb +28 -30
- data/lib/ronin/ui/command_line/options.rb +0 -12
- data/lib/ronin/ui/command_line/param_parser.rb +34 -14
- data/lib/ronin/ui/console.rb +1 -0
- data/lib/ronin/ui/diagnostics.rb +5 -19
- data/lib/ronin/ui/{command_line/commands.rb → verbose.rb} +19 -11
- data/lib/ronin/version.rb +1 -1
- data/spec/arch_spec.rb +24 -24
- data/spec/chars/chars_spec.rb +49 -13
- data/spec/extensions/string_spec.rb +6 -6
- data/spec/spec_helper.rb +1 -1
- data/spec/ui/command_line/helpers/example_command.rb +21 -0
- data/spec/ui/command_line/param_parser_spec.rb +9 -18
- data/spec/ui/verbose_spec.rb +17 -0
- metadata +39 -8
- data/lib/ronin/ui/command_line/commands/list.rb +0 -122
- data/spec/ui/diagnostics_spec.rb +0 -17
@@ -95,15 +95,15 @@ describe String do
|
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
98
|
-
it "should
|
99
|
-
"hello".
|
98
|
+
it "should dump printable strings" do
|
99
|
+
"hello".dump.should == '"hello"'
|
100
100
|
end
|
101
101
|
|
102
|
-
it "should
|
103
|
-
"hello\n\b\a".
|
102
|
+
it "should dump strings containing control characters" do
|
103
|
+
"hello\n\b\a".dump.should == '"hello\n\b\a"'
|
104
104
|
end
|
105
105
|
|
106
|
-
it "should
|
107
|
-
"hello\x90\x05\xef".
|
106
|
+
it "should dump strings containing non-printable characters" do
|
107
|
+
"hello\x90\x05\xef".dump.should == '"hello\x90\x05\xef"'
|
108
108
|
end
|
109
109
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'ronin/ui/command_line/command'
|
2
|
+
|
3
|
+
class ExampleCommand < UI::CommandLine::Command
|
4
|
+
|
5
|
+
include UI::CommandLine::ParamParser
|
6
|
+
|
7
|
+
attr_reader :params
|
8
|
+
|
9
|
+
def initialize(name)
|
10
|
+
@params = {}
|
11
|
+
|
12
|
+
super(name)
|
13
|
+
end
|
14
|
+
|
15
|
+
def param_parser(name_and_value)
|
16
|
+
@params.merge!(parse_param(name_and_value))
|
17
|
+
|
18
|
+
return @params
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -1,58 +1,49 @@
|
|
1
1
|
require 'ronin/ui/command_line/param_parser'
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
+
require 'ui/command_line/helpers/example_command'
|
4
5
|
|
5
6
|
describe UI::CommandLine::ParamParser do
|
6
7
|
before(:all) do
|
7
|
-
|
8
|
-
|
9
|
-
include UI::CommandLine::ParamParser
|
10
|
-
|
11
|
-
end
|
12
|
-
|
13
|
-
@command = ExampleCommand.new
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should provide a params Hash" do
|
17
|
-
@command.params.should_not be_nil
|
8
|
+
@command = ExampleCommand.new('example')
|
18
9
|
end
|
19
10
|
|
20
11
|
it "should parse params of the form 'name'" do
|
21
|
-
@command.
|
12
|
+
@command.param_parser('var')
|
22
13
|
|
23
14
|
@command.params.has_key?(:var).should == true
|
24
15
|
@command.params[:var].should be_nil
|
25
16
|
end
|
26
17
|
|
27
18
|
it "should parse params of the form 'name=value'" do
|
28
|
-
@command.
|
19
|
+
@command.param_parser('var1=test')
|
29
20
|
@command.params[:var1].should == 'test'
|
30
21
|
end
|
31
22
|
|
32
23
|
it "should parse params which have numeric values" do
|
33
|
-
@command.
|
24
|
+
@command.param_parser('var2=100')
|
34
25
|
@command.params[:var2].should == 100
|
35
26
|
end
|
36
27
|
|
37
28
|
it "should parse params with hexadecimal values" do
|
38
|
-
@command.
|
29
|
+
@command.param_parser('var3=0x2a')
|
39
30
|
@command.params[:var3].should == 0x2a
|
40
31
|
end
|
41
32
|
|
42
33
|
it "should parse params with URI values" do
|
43
34
|
url = 'http://example.com/'
|
44
35
|
|
45
|
-
@command.
|
36
|
+
@command.param_parser("var4=#{url}")
|
46
37
|
@command.params[:var4].should == URI(url)
|
47
38
|
end
|
48
39
|
|
49
40
|
it "should parse params with true boolean values" do
|
50
|
-
@command.
|
41
|
+
@command.param_parser('var5=true')
|
51
42
|
@command.params[:var5].should == true
|
52
43
|
end
|
53
44
|
|
54
45
|
it "should parse params with false boolean values" do
|
55
|
-
@command.
|
46
|
+
@command.param_parser('var6=false')
|
56
47
|
@command.params[:var6].should == false
|
57
48
|
end
|
58
49
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'ronin/ui/verbose'
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe UI::Verbose do
|
6
|
+
it "should be disabled by default" do
|
7
|
+
UI::Verbose.should be_disabled
|
8
|
+
end
|
9
|
+
|
10
|
+
it "may be enabled and disabled" do
|
11
|
+
UI::Verbose.enable!
|
12
|
+
UI::Verbose.should be_enabled
|
13
|
+
|
14
|
+
UI::Verbose.disable!
|
15
|
+
UI::Verbose.should be_disabled
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Postmodern
|
@@ -9,9 +9,19 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-02-
|
12
|
+
date: 2009-02-23 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: nokogiri
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.2.0
|
24
|
+
version:
|
15
25
|
- !ruby/object:Gem::Dependency
|
16
26
|
name: dm-core
|
17
27
|
type: :runtime
|
@@ -147,6 +157,16 @@ email:
|
|
147
157
|
- postmodern.mod3@gmail.com
|
148
158
|
executables:
|
149
159
|
- ronin
|
160
|
+
- ronin-add
|
161
|
+
- ronin-console
|
162
|
+
- ronin-ext
|
163
|
+
- ronin-help
|
164
|
+
- ronin-install
|
165
|
+
- ronin-ls
|
166
|
+
- ronin-overlay
|
167
|
+
- ronin-rm
|
168
|
+
- ronin-uninstall
|
169
|
+
- ronin-update
|
150
170
|
extensions: []
|
151
171
|
|
152
172
|
extra_rdoc_files:
|
@@ -163,6 +183,16 @@ files:
|
|
163
183
|
- TODO.txt
|
164
184
|
- Rakefile
|
165
185
|
- bin/ronin
|
186
|
+
- bin/ronin-add
|
187
|
+
- bin/ronin-console
|
188
|
+
- bin/ronin-ext
|
189
|
+
- bin/ronin-help
|
190
|
+
- bin/ronin-install
|
191
|
+
- bin/ronin-ls
|
192
|
+
- bin/ronin-overlay
|
193
|
+
- bin/ronin-rm
|
194
|
+
- bin/ronin-uninstall
|
195
|
+
- bin/ronin-update
|
166
196
|
- lib/ronin.rb
|
167
197
|
- lib/ronin/config.rb
|
168
198
|
- lib/ronin/extensions.rb
|
@@ -282,6 +312,7 @@ files:
|
|
282
312
|
- lib/ronin/platform/platform.rb
|
283
313
|
- lib/ronin/platform/ronin.rb
|
284
314
|
- lib/ronin/ui.rb
|
315
|
+
- lib/ronin/ui/verbose.rb
|
285
316
|
- lib/ronin/ui/diagnostics.rb
|
286
317
|
- lib/ronin/ui/hexdump.rb
|
287
318
|
- lib/ronin/ui/hexdump/hexdump.rb
|
@@ -296,15 +327,14 @@ files:
|
|
296
327
|
- lib/ronin/ui/command_line/command.rb
|
297
328
|
- lib/ronin/ui/command_line/options.rb
|
298
329
|
- lib/ronin/ui/command_line/param_parser.rb
|
299
|
-
- lib/ronin/ui/command_line/commands.rb
|
300
|
-
- lib/ronin/ui/command_line/commands/default.rb
|
330
|
+
- lib/ronin/ui/command_line/commands/console.rb
|
301
331
|
- lib/ronin/ui/command_line/commands/overlay.rb
|
302
|
-
- lib/ronin/ui/command_line/commands/
|
332
|
+
- lib/ronin/ui/command_line/commands/ext.rb
|
303
333
|
- lib/ronin/ui/command_line/commands/add.rb
|
304
334
|
- lib/ronin/ui/command_line/commands/install.rb
|
305
|
-
- lib/ronin/ui/command_line/commands/
|
335
|
+
- lib/ronin/ui/command_line/commands/ls.rb
|
306
336
|
- lib/ronin/ui/command_line/commands/update.rb
|
307
|
-
- lib/ronin/ui/command_line/commands/
|
337
|
+
- lib/ronin/ui/command_line/commands/rm.rb
|
308
338
|
- lib/ronin/ui/command_line/commands/uninstall.rb
|
309
339
|
- lib/ronin/ui/command_line/commands/help.rb
|
310
340
|
- lib/ronin/ui/command_line/command_line.rb
|
@@ -349,7 +379,8 @@ files:
|
|
349
379
|
- spec/platform/extension_cache_spec.rb
|
350
380
|
- spec/platform/platform_spec.rb
|
351
381
|
- spec/platform/ronin_spec.rb
|
352
|
-
- spec/ui/
|
382
|
+
- spec/ui/verbose_spec.rb
|
383
|
+
- spec/ui/command_line/helpers/example_command.rb
|
353
384
|
- spec/ui/command_line/param_parser_spec.rb
|
354
385
|
- spec/ronin_spec.rb
|
355
386
|
- static/overlay.xsl
|
@@ -1,122 +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
|
-
require 'ronin/ui/command_line/command'
|
25
|
-
require 'ronin/platform/overlay'
|
26
|
-
|
27
|
-
module Ronin
|
28
|
-
module UI
|
29
|
-
module CommandLine
|
30
|
-
class ListCommand < Command
|
31
|
-
|
32
|
-
command :list, :ls
|
33
|
-
|
34
|
-
def initialize
|
35
|
-
@cache = nil
|
36
|
-
@verbose = false
|
37
|
-
|
38
|
-
super
|
39
|
-
end
|
40
|
-
|
41
|
-
def define_options(opts)
|
42
|
-
opts.usage = '[NAME ...] [options]'
|
43
|
-
|
44
|
-
opts.options do
|
45
|
-
opts.on('-C','--cache DIR','Specify an alternate overlay cache') do |dir|
|
46
|
-
@cache = dir
|
47
|
-
end
|
48
|
-
|
49
|
-
opts.on('-v','--verbose','Enable verbose output') do
|
50
|
-
@verbose = true
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
opts.arguments(
|
55
|
-
'NAME' => 'Overlay to display'
|
56
|
-
)
|
57
|
-
|
58
|
-
opts.summary('Display all or the specified repositories within the Overlay cache')
|
59
|
-
end
|
60
|
-
|
61
|
-
def arguments(*args)
|
62
|
-
Platform.load_overlays(@cache) if @cache
|
63
|
-
|
64
|
-
if args.empty?
|
65
|
-
# list all overlays by name
|
66
|
-
Platform.overlays.each_overlay do |overlay|
|
67
|
-
puts " #{overlay}"
|
68
|
-
end
|
69
|
-
|
70
|
-
return
|
71
|
-
end
|
72
|
-
|
73
|
-
# list specified overlays
|
74
|
-
args.each do |name|
|
75
|
-
overlay = Platform.overlays.get(name)
|
76
|
-
|
77
|
-
puts "[ #{overlay.name} ]\n\n"
|
78
|
-
|
79
|
-
puts " Path: #{overlay.path}"
|
80
|
-
puts " Media: #{overlay.media}" if overlay.media
|
81
|
-
puts " URI: #{overlay.uri}" if overlay.uri
|
82
|
-
|
83
|
-
if @verbose
|
84
|
-
putc "\n"
|
85
|
-
|
86
|
-
if overlay.title
|
87
|
-
puts " Title: #{overlay.title}"
|
88
|
-
end
|
89
|
-
|
90
|
-
if overlay.source
|
91
|
-
puts " Source URI: #{overlay.source}"
|
92
|
-
end
|
93
|
-
|
94
|
-
if overlay.source_view
|
95
|
-
puts " Source View: #{overlay.source_view}"
|
96
|
-
end
|
97
|
-
|
98
|
-
if overlay.website
|
99
|
-
puts " Website: #{overlay.website}"
|
100
|
-
end
|
101
|
-
|
102
|
-
unless overlay.extensions.empty?
|
103
|
-
puts " Extensions:\n\n"
|
104
|
-
overlay.extensions.each { |ext| puts " #{ext}" }
|
105
|
-
putc "\n"
|
106
|
-
end
|
107
|
-
|
108
|
-
if overlay.description
|
109
|
-
puts " Description:\n\n #{overlay.description}\n\n"
|
110
|
-
else
|
111
|
-
putc "\n"
|
112
|
-
end
|
113
|
-
else
|
114
|
-
putc "\n"
|
115
|
-
end
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
end
|
120
|
-
end
|
121
|
-
end
|
122
|
-
end
|
data/spec/ui/diagnostics_spec.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'ronin/ui/diagnostics'
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
describe UI::Diagnostics do
|
6
|
-
it "should be disabled by default" do
|
7
|
-
UI::Diagnostics.should be_disabled
|
8
|
-
end
|
9
|
-
|
10
|
-
it "may be enabled and disabled" do
|
11
|
-
UI::Diagnostics.enable!
|
12
|
-
UI::Diagnostics.should be_enabled
|
13
|
-
|
14
|
-
UI::Diagnostics.disable!
|
15
|
-
UI::Diagnostics.should be_disabled
|
16
|
-
end
|
17
|
-
end
|