Declare warn_about_rubies as a class method
Since that's how it's being called. Also, define it before calling it.
This commit is contained in:
parent
3116f66d4d
commit
c3a86eef66
|
@ -20,16 +20,10 @@ module Msf
|
|||
###
|
||||
|
||||
class DBManager
|
||||
begin
|
||||
include MetasploitDataModels
|
||||
rescue NameError => e
|
||||
warn_about_rubies
|
||||
raise e
|
||||
end
|
||||
|
||||
# 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 warn_about_rubies
|
||||
def self.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/"
|
||||
|
@ -37,6 +31,13 @@ class DBManager
|
|||
end
|
||||
end
|
||||
|
||||
begin
|
||||
include MetasploitDataModels
|
||||
rescue NameError => e
|
||||
warn_about_rubies
|
||||
raise e
|
||||
end
|
||||
|
||||
# Provides :framework and other accessors
|
||||
include Framework::Offspring
|
||||
|
||||
|
|
Loading…
Reference in New Issue