Update minimum supported Ruby version to 2.2

This commit is contained in:
Brendan Coles
2017-04-10 18:43:16 +00:00
parent a03164f212
commit d7fd3acf23
4 changed files with 8 additions and 8 deletions

6
beef
View File

@@ -9,10 +9,10 @@
# stop deprecation warning from being displayed
$VERBOSE = nil
# @note Version check to ensure BeEF is running Ruby 2.1+
if RUBY_VERSION < '2.1'
# @note Version check to ensure BeEF is running Ruby 2.2+
if RUBY_VERSION < '2.2'
puts "\n"
puts "Ruby version #{RUBY_VERSION} is no longer supported. Please upgrade to Ruby version 2.1 or later."
puts "Ruby version #{RUBY_VERSION} is no longer supported. Please upgrade to Ruby version 2.2 or later."
puts "\n"
exit 1
end

View File

@@ -146,7 +146,7 @@ module Filters
def self.is_valid_browser_plugins?(str)
return true unless is_non_empty_string?(str)
return false if str.length > 1000
if RUBY_VERSION >= "1.9" && str.encoding === Encoding.find('UTF-8')
if str.encoding === Encoding.find('UTF-8')
return (str =~ /[^\w\d\s()-.,';_!\302\256]/u).nil?
else
return (str =~ /[^\w\d\s()-.,';_!\302\256]/n).nil?

View File

@@ -8,9 +8,9 @@
puts "\nWelcome to the BeEF installer!"
if RUBY_VERSION < '2.0'
if RUBY_VERSION < '2.2'
puts "\n"
puts "Ruby version #{RUBY_VERSION} is no longer supported. Please upgrade to Ruby version 2.0 or later."
puts "Ruby version #{RUBY_VERSION} is no longer supported. Please upgrade to Ruby version 2.2 or later."
puts "\n"
exit 1
end

View File

@@ -5,9 +5,9 @@
#
# @note Version check to ensure BeEF is running Ruby 2.0+
if RUBY_VERSION < '2.0'
if RUBY_VERSION < '2.2'
puts "\n"
puts "Ruby version #{RUBY_VERSION} is no longer supported. Please upgrade to Ruby version 2.0 or later."
puts "Ruby version #{RUBY_VERSION} is no longer supported. Please upgrade to Ruby version 2.2 or later."
puts "\n"
exit 1
end