Sha256: 3a64881e58699e1e9fb2ff1879c01aa09d57fef5569306978e32f5c276664fd2

Contents?: true

Size: 750 Bytes

Versions: 2

Compression:

Stored size: 750 Bytes

Contents

module VersionCake
  class VersionChecker
    attr_reader :result
    def initialize(version, resource)
      @version = version
      @resource = resource
    end

    def execute
      @result = if @version.nil?
        :no_version
      elsif !@version.is_a? Integer
        :invalid_format
      elsif @resource.obsolete_versions.include? @version
        :obsolete
      elsif @resource.deprecated_versions.include? @version
        :deprecated
      elsif @resource.supported_versions.include? @version
        :supported
      elsif @version > @resource.supported_versions.last
        :version_too_high
      elsif @version < @resource.supported_versions.first
        :version_too_low
      else
        :unknown
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
versioncake-4.1.1 lib/versioncake/version_checker.rb
versioncake-4.1.0 lib/versioncake/version_checker.rb