Fix bug get Forbidden last version github
This commit is contained in:
parent
e72487bb28
commit
3c75fb27c4
3 changed files with 14 additions and 6 deletions
|
@ -12,7 +12,9 @@ class Github::API
|
|||
|
||||
def self.call(end_point, params = {})
|
||||
RestClient::Resource.new(
|
||||
base_uri+end_point
|
||||
base_uri+end_point, timeout: 5
|
||||
).get(params: params)
|
||||
rescue RestClient::Forbidden
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,8 +2,10 @@ class Github::Releases
|
|||
|
||||
def self.latest
|
||||
release = Hashie::Mash.new JSON.parse(Github::API.latest_release)
|
||||
release.published_at = release.published_at.to_date.strftime('%d/%m/%Y')
|
||||
|
||||
return nil if release.nil?
|
||||
|
||||
release.published_at = release.published_at.to_date.strftime('%d/%m/%Y')
|
||||
release
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue