class Kurgan::GitHub
Constants
- GITHUB_ORG
- GITHUB_URL
Public Class Methods
get_releases(component)
click to toggle source
# File lib/kurgan/github.rb, line 22 def self.get_releases(component) url = "#{GITHUB_URL}/repos/#{GITHUB_ORG}/hl-component-#{component}/releases" response = Faraday.get(url, {}, {'Accept' => 'Accept: application/vnd.github.v3+json'}) if response.status != 200 return nil end return JSON.parse(response.body, symbolize_names: true) end
get_repos()
click to toggle source
# File lib/kurgan/github.rb, line 10 def self.get_repos url = "#{GITHUB_URL}/orgs/#{GITHUB_ORG}/repos" response = Faraday.get(url, {type: 'public', per_page: 100}, {'Accept' => 'Accept: application/vnd.github.v3+json'}) if response.status != 200 return nil end repos = JSON.parse(response.body, symbolize_names: true) return repos.select {|repo| repo[:name].start_with?('hl-component')} end