Class: Headdesk::Versions
- Inherits:
-
Object
- Object
- Headdesk::Versions
- Defined in:
- lib/headdesk/versions.rb
Overview
Version information from RubyGems.org
Class Method Summary collapse
- .latest_version ⇒ Object
- .latest_version?(version = VERSION) ⇒ Boolean
- .version ⇒ Object
- .versions ⇒ Object
Class Method Details
.latest_version ⇒ Object
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
31 32 33 |
# File 'lib/headdesk/versions.rb', line 31 def self.latest_version?(version = VERSION) latest_version == Gem::Version.new(version) end |
.version ⇒ Object
10 11 12 |
# File 'lib/headdesk/versions.rb', line 10 def self.version Gem::Version.new(VERSION) end |
.versions ⇒ Object
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 |