Skip to content

Commit 7da1f7b

Browse files
committed
Merge limhoff's import shuffle and YARD fixes
Cuts an importer out of db.rb, includes a ton of specs to ensure that nothing is broke along the way. [Closes rapid7#1693]
2 parents ce88d84 + 809969b commit 7da1f7b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2206
-490
lines changed

Gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,19 @@ group :development do
2727
end
2828

2929
group :development, :test do
30+
# supplies factories for producing model instance for specs
31+
# Version 4.1.0 or newer is needed to support generate calls without the
32+
# 'FactoryGirl.' in factory definitions syntax.
33+
gem 'factory_girl', '>= 4.1.0'
3034
# running documentation generation tasks and rspec tasks
3135
gem 'rake'
3236
end
3337

3438
group :test do
39+
# Removes records from database created during tests. Can't use rspec-rails'
40+
# transactional fixtures because multiple connections are in use so
41+
# transactions won't work.
42+
gem 'database_cleaner'
3543
# testing framework
3644
gem 'rspec', '>= 2.12'
3745
# code coverage for tests

Gemfile.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ GEM
2626
arel (3.0.2)
2727
builder (3.0.4)
2828
coderay (1.0.9)
29+
database_cleaner (0.9.1)
2930
diff-lcs (1.1.3)
31+
factory_girl (4.2.0)
32+
activesupport (>= 3.0.0)
3033
i18n (0.6.1)
3134
json (1.7.7)
3235
method_source (0.8.1)
@@ -64,6 +67,8 @@ PLATFORMS
6467
DEPENDENCIES
6568
activerecord
6669
activesupport (>= 3.0.0)
70+
database_cleaner
71+
factory_girl (>= 4.1.0)
6772
json
6873
metasploit_data_models!
6974
msgpack

lib/metasploit/framework/database.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require 'metasploit/framework'
2+
3+
module Metasploit
4+
module Framework
5+
module Database
6+
def self.configurations
7+
YAML.load_file(configurations_pathname)
8+
end
9+
10+
def self.configurations_pathname
11+
Metasploit::Framework.root.join('config', 'database.yml')
12+
end
13+
end
14+
end
15+
end

lib/msf/base.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: binary -*-
2-
###
32
#
43
# framework-base
54
# --------------
@@ -13,8 +12,6 @@
1312
# Beyond providing the default sessions, framework-base also provides
1413
# a wrapper interface to framework-core that makes some of the tasks,
1514
# such as exploitation, into easier to manage functions.
16-
#
17-
###
1815

1916
# framework-base depends on framework-core
2017
require 'msf/core'

lib/msf/base/sessions/meterpreter.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: binary -*-
2-
##
32
# $Id$
4-
##
53

64
require 'msf/base'
75
require 'msf/base/sessions/scriptable'

lib/msf/base/sessions/meterpreter_java.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: binary -*-
2-
##
32
# $Id$
4-
##
53

64
require 'msf/base/sessions/meterpreter'
75

lib/msf/base/sessions/meterpreter_options.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: binary -*-
2-
##
32
# $Id$
4-
##
53

64
require 'shellwords'
75

lib/msf/base/sessions/meterpreter_php.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: binary -*-
2-
##
32
# $Id$
4-
##
53

64
require 'msf/base/sessions/meterpreter'
75

lib/msf/base/sessions/meterpreter_x64_win.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
# -*- coding: binary -*-
2-
##
3-
# $Id: meterpreter_options.rb 10595 2010-10-08 04:11:47Z hdm $
4-
##
52

63
require 'msf/base/sessions/meterpreter'
74
require 'msf/windows_error'

lib/msf/base/sessions/meterpreter_x86_bsd.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: binary -*-
2-
##
32
# $Id$
4-
##
53

64
require 'msf/base/sessions/meterpreter'
75

0 commit comments

Comments
 (0)