Update landing page :
- Release scrape on Github - Add presentation video - Add demonstration link for gestionnaire and user
This commit is contained in:
parent
419f74948a
commit
51c145d2ce
13 changed files with 152 additions and 64 deletions
18
lib/github/api.rb
Normal file
18
lib/github/api.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
class Github::API
|
||||
|
||||
def self.base_uri
|
||||
'https://api.github.com'
|
||||
end
|
||||
|
||||
def self.latest_release
|
||||
call '/repos/sgmap/tps/releases/latest'
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def self.call(end_point, params = {})
|
||||
RestClient::Resource.new(
|
||||
base_uri+end_point
|
||||
).get(params: params)
|
||||
end
|
||||
end
|
9
lib/github/releases.rb
Normal file
9
lib/github/releases.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
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')
|
||||
|
||||
release
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue