lib/headdesk/versions.rb in headdesk-0.13.0 vs lib/headdesk/versions.rb in headdesk-0.14.0

- old
+ new

@@ -10,17 +10,19 @@ 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 + begin + Gems.versions('headdesk').collect do |version| + Gem::Version.new(version['number']) + end .compact .sort .reverse + rescue StandardError + nil + end end def self.latest_version Gem::Version.new(Gems.latest_version('headdesk')['version']) end