Derp, include is a class method

unstable
James Lee 2012-10-09 01:52:19 -05:00
parent 227418bd11
commit b3e27b16d5
1 changed files with 4 additions and 2 deletions

View File

@ -19,7 +19,7 @@ class DBManager
# Mainly, it's Ruby 1.9.1 that cause a lot of problems now, along with Ruby 1.8.6.
# Ruby 1.8.7 actually seems okay, but why tempt fate? Let's say 1.9.3 and beyond.
def self.warn_about_rubies
def warn_about_rubies
if ::RUBY_VERSION =~ /^1\.9\.[012]($|[^\d])/
$stderr.puts "**************************************************************************************"
$stderr.puts "Metasploit requires at least Ruby 1.9.3. For an easy upgrade path, see https://rvm.io/"
@ -118,7 +118,9 @@ class DBManager
# If Mdm::Host is defined, the dynamically created classes
# are already in the object space
begin
include MetasploitDataModels unless defined? Mdm::Host
unless defined? Mdm::Host
self.class.send :include, MetasploitDataModels
end
rescue NameError => e
warn_about_rubies
raise e