Class: Headdesk::Versions

Inherits:
Object
  • Object
show all
Defined in:
lib/headdesk/versions.rb

Overview

Version information from RubyGems.org

Class Method Summary collapse

Class Method Details

.latest_versionObject



27
28
29
# File 'lib/headdesk/versions.rb', line 27

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

.latest_version?(version = VERSION) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/headdesk/versions.rb', line 31

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

.versionObject



10
11
12
# File 'lib/headdesk/versions.rb', line 10

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

.versionsObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/headdesk/versions.rb', line 14

def self.versions
  begin
    Gems.versions('headdesk').collect do |version|
      Gem::Version.new(version['number'])
    end
      .compact
      .sort
      .reverse
  rescue StandardError
    nil
  end
end