diff --git a/.ruby-version b/.ruby-version index 0bee604d..197c4d5c 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.3.3 +2.4.0 diff --git a/Dockerfile b/Dockerfile index 80539446..e97eec0e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.3-slim +FROM ruby:2.4-slim MAINTAINER WPScan Team RUN DEBIAN_FRONTEND=noninteractive && \ diff --git a/Gemfile b/Gemfile index 3f6950f1..ed59cabe 100644 --- a/Gemfile +++ b/Gemfile @@ -1,11 +1,12 @@ source 'https://rubygems.org' gem 'typhoeus', '>=1.0.0' -gem 'nokogiri', '>=1.6.7.2' +gem 'nokogiri', '>=1.7.0.1' gem 'addressable' gem 'yajl-ruby' # Better JSON parser regarding memory usage gem 'terminal-table', '>=1.6.0' gem 'ruby-progressbar', '>=1.6.0' +gem 'xmlrpc' group :test do gem 'webmock', '>=1.17.2' diff --git a/lib/common/common_helper.rb b/lib/common/common_helper.rb index ac065696..28d80930 100644 --- a/lib/common/common_helper.rb +++ b/lib/common/common_helper.rb @@ -96,7 +96,9 @@ end def update_required? date = last_update - (true if date.nil?) or (date < 5.days.ago) + day_seconds = 24 * 60 * 60 + five_days_ago = Time.now - (5 * day_seconds) + (true if date.nil?) or (date < five_days_ago) end # Define colors diff --git a/lib/common/hacks.rb b/lib/common/hacks.rb index a68ce576..8b159acb 100644 --- a/lib/common/hacks.rb +++ b/lib/common/hacks.rb @@ -35,16 +35,3 @@ class Numeric s.sub(/\.?0*$/, ' ' + units[e]) end end - -# time calculations -class Fixnum - SECONDS_IN_DAY = 24 * 60 * 60 - - def days - self * SECONDS_IN_DAY - end - - def ago - Time.now - self - end -end