-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename
contributors:update
task to contributors
Since we no longer keep the yaml file in source control, I think the `update` part has lost most of its meaning.
- Loading branch information
1 parent
350e4de
commit 25b5237
Showing
2 changed files
with
34 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,37 @@ | ||
desc "Regenerate file with contributor's information that our team page will display" | ||
namespace :contributors do | ||
task :update do | ||
def small_avatar(url) | ||
connector = url.include?("?") ? "&" : "?" | ||
[url, "s=40"].join(connector) | ||
end | ||
|
||
core_team = %w[ | ||
colby-swandale | ||
deivid-rodriguez | ||
greysteil | ||
hsbt | ||
indirect | ||
rubymorillo | ||
segiddins | ||
] | ||
credited_elsewhere = core_team + %w[homu bundlerbot] | ||
desc "Generate file with contributor's information that our team page will display" | ||
task :contributors do | ||
def small_avatar(url) | ||
connector = url.include?("?") ? "&" : "?" | ||
[url, "s=40"].join(connector) | ||
end | ||
|
||
require "octokit" | ||
require "yaml" | ||
options = { auto_paginate: true } | ||
options[:access_token] = ENV["GITHUB_TOKEN"] if ENV["GITHUB_TOKEN"] | ||
client = Octokit::Client.new(**options) | ||
contributors = client.contributors("rubygems/rubygems", false) | ||
contributors.reject!{|c| credited_elsewhere.include?(c[:login]) } | ||
contributors.map! do |c| | ||
{ | ||
avatar_url: small_avatar(c[:avatar_url]), | ||
commits: c[:contributions], | ||
href: c[:html_url], | ||
name: c[:login] | ||
} | ||
end | ||
contributors.sort_by! {|c| [-c[:commits], c[:name].downcase] } | ||
core_team = %w[ | ||
colby-swandale | ||
deivid-rodriguez | ||
greysteil | ||
hsbt | ||
indirect | ||
rubymorillo | ||
segiddins | ||
] | ||
credited_elsewhere = core_team + %w[homu bundlerbot] | ||
|
||
File.write("data/contributors.yml", YAML.dump(contributors)) | ||
require "octokit" | ||
require "yaml" | ||
options = { auto_paginate: true } | ||
options[:access_token] = ENV["GITHUB_TOKEN"] if ENV["GITHUB_TOKEN"] | ||
client = Octokit::Client.new(**options) | ||
contributors = client.contributors("rubygems/rubygems", false) | ||
contributors.reject!{|c| credited_elsewhere.include?(c[:login]) } | ||
contributors.map! do |c| | ||
{ | ||
avatar_url: small_avatar(c[:avatar_url]), | ||
commits: c[:contributions], | ||
href: c[:html_url], | ||
name: c[:login] | ||
} | ||
end | ||
contributors.sort_by! {|c| [-c[:commits], c[:name].downcase] } | ||
|
||
File.write("data/contributors.yml", YAML.dump(contributors)) | ||
end |