demarches-normaliennes/lib/github/releases.rb

11 lines
285 B
Ruby
Raw Normal View History

class Github::Releases
def self.latest
2016-06-13 11:15:25 +02:00
latest_release = Github::API.latest_release
return nil if latest_release.nil?
2016-06-13 11:15:25 +02:00
release = Hashie::Mash.new JSON.parse(latest_release)
release.published_at = release.published_at.to_date.strftime('%d/%m/%Y')
release
end
end