Skip to content

Instantly share code, notes, and snippets.

@emsk
Created January 26, 2017 23:49
Show Gist options
  • Save emsk/9200603c2da1d6c6451e2d34eb731faf to your computer and use it in GitHub Desktop.
Save emsk/9200603c2da1d6c6451e2d34eb731faf to your computer and use it in GitHub Desktop.
require 'octokit'
MGEM_LIST_REPO = 'mruby/mgem-list'
client = Octokit::Client.new(access_token: '') # Note: Set access token
files = client.contents(MGEM_LIST_REPO)
puts "count of files: #{files.size}"
files.each do |f|
next unless /\A.+\.gem\z/ =~ f.path
content = client.contents(MGEM_LIST_REPO, path: f.path, accept: 'application/vnd.github.V3.raw')
name = content[%r{^name: (.+)$}, 1]
description = content[%r{^description: (.+)$}, 1]
puts "#{name}: #{description}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment