Sha256: 0e119c1b484345488581f67f0e5c4d975d79fd4bc27273bc6dc285deae92abb4

Contents?: true

Size: 581 Bytes

Versions: 1

Compression:

Stored size: 581 Bytes

Contents

# frozen_string_literal: true

require 'gems'

module Headdesk
  #
  # Version information from RubyGems.org
  #
  class Versions
    def self.versions
      Gems.versions('headdesk').collect do |version|
        Gem::Version.new(version['number'])
      rescue StandardError
        nil
      end
          .compact
          .sort
          .reverse
    end

    def self.latest_version
      Gem::Version.new(Gems.latest_version('headdesk')['version'])
    end

    def self.latest_version?(version = VERSION)
      latest_version == Gem::Version.new(version)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
headdesk-0.10.0 lib/headdesk/versions.rb