Sha256: 4be70595c75672a81a073d1d6ba89176f8b34276f627c7e79c2da941c3f47e79

Contents?: true

Size: 643 Bytes

Versions: 6

Compression:

Stored size: 643 Bytes

Contents

# frozen_string_literal: true

require 'gems'

module Headdesk
  #
  # Version information from RubyGems.org
  #
  class Versions
    def self.version
      Gem::Version.new(VERSION)
    end

    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

6 entries across 6 versions & 1 rubygems

Version Path
headdesk-0.13.0 lib/headdesk/versions.rb
headdesk-0.12.0 lib/headdesk/versions.rb
headdesk-0.11.3 lib/headdesk/versions.rb
headdesk-0.11.2 lib/headdesk/versions.rb
headdesk-0.11.1 lib/headdesk/versions.rb
headdesk-0.11.0 lib/headdesk/versions.rb