Sha256: c2674c1c680e22f0dea7f994ad255cacdb3451815214916447754cd354da90ab

Contents?: true

Size: 1.19 KB

Versions: 28

Compression:

Stored size: 1.19 KB

Contents

  module Dawn
    module Kb
      class DeprecationCheck
        include BasicCheck

        DEPRECATION_MATRIX = [
          # {:gem=>"rails", :versions=>['0.x', '1.x', '2.x']},
          # {:gem=>"sinatra", :versions=>['0.x', '1.x', '2.x']},
          # {:gem=>"padrino", :versions=>['0.x', '1.x', '2.x']},
          {:gem=>"ruby", :versions=>['1.1.x', '1.2.x', '1.3.x', '1.4.x', '1.5.x', '1.6.x', '1.7.x', '1.8.7']},
        ]

        attr_accessor :detected
        attr_accessor :enable_warning

        def initialize(options={})
          super(options)
          @enable_warning ||= options[:enable_warning]
          debug_me "DeprecationCheck initialized"
          $logger.warn "MVC deprecation check is disable by now" unless self.enable_warning.nil?
        end

        def vuln?
          debug_me "vuln? @detected is #{@detected}"
          v = Dawn::Kb::VersionCheck.new
          v.debug = self.debug
          v.detected = @detected[:version]

          DEPRECATION_MATRIX.each do |dm|
            v.deprecated = dm[:versions] if dm[:gem] == @detected[:gem]
          end
          return false if v.deprecated.nil?
          return v.is_detected_deprecated?
        end

      end
    end
  end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
dawnscanner-2.2.0 lib/dawn/kb/deprecation_check.rb
dawnscanner-2.1.1 lib/dawn/kb/deprecation_check.rb
dawnscanner-2.1.0 lib/dawn/kb/deprecation_check.rb
dawnscanner-2.0.0 lib/dawn/kb/deprecation_check.rb
dawnscanner-2.0.0.rc5 lib/dawn/kb/deprecation_check.rb
dawnscanner-2.0.0.rc4 lib/dawn/kb/deprecation_check.rb
dawnscanner-2.0.0.rc3 lib/dawn/kb/deprecation_check.rb
dawnscanner-2.0.0.rc2 lib/dawn/kb/deprecation_check.rb
dawnscanner-2.0.0.rc1 lib/dawn/kb/deprecation_check.rb
dawnscanner-1.6.9 lib/dawn/kb/deprecation_check.rb
dawnscanner-1.6.8 lib/dawn/kb/deprecation_check.rb
dawnscanner-1.6.7 lib/dawn/kb/deprecation_check.rb
dawnscanner-1.6.6 lib/dawn/kb/deprecation_check.rb
dawnscanner-1.6.5 lib/dawn/kb/deprecation_check.rb
dawnscanner-1.6.4 lib/dawn/kb/deprecation_check.rb
dawnscanner-1.6.3 lib/dawn/kb/deprecation_check.rb
dawnscanner-1.6.2 lib/dawn/kb/deprecation_check.rb
dawnscanner-1.6.1 lib/dawn/kb/deprecation_check.rb
dawnscanner-1.6.0 lib/dawn/kb/deprecation_check.rb
dawnscanner-1.5.2 lib/dawn/kb/deprecation_check.rb