Last active
December 17, 2015 06:58
-
-
Save robink/5568944 to your computer and use it in GitHub Desktop.
Revisions
-
Robin Komiwes revised this gist
Jun 11, 2013 . 1 changed file with 8 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -12,12 +12,12 @@ def print_changelog( repo, pr ) def print_pr( repo, pr ) date_at = Date.rfc3339( pr.merged_at ? pr.merged_at : pr.updated_at ) users = repo.pull_requests.commits( number: pr["number"]).map{ |commit| commit["author"].nil? ? "" : commit["author"]["login"] } users.uniq! puts "[" + date_at.strftime('%d/%m/%Y') + "] " + pr.title.strip.upcase puts "Authors: " + users.join(", ") puts pr.body puts "" @@ -41,4 +41,8 @@ def print_pr( repo, pr ) puts "RELEASED" puts "" pull_requests.list( state: "closed" ).each do |pr| if pull_requests.merged?( owner, repo_name, pr.number) print_changelog( repo, pr ) end end -
Robin Komiwes revised this gist
May 20, 2013 . 1 changed file with 13 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,29 +1,31 @@ require 'highline/import' require 'github_api' login = ask("Login: ") password = ask("Password: ") { |q| q.echo = false } owner = ask("Repo owner: ") repo_name = ask("Repo name: ") def print_changelog( repo, pr ) print_pr(repo, pr) if pr.title.gsub!(/#changelog/, '') end def print_pr( repo, pr ) updated_at = Date.rfc3339(pr.updated_at) users = repo.pull_requests.commits( number: pr["number"]).map{ |commit| commit["author"]["login"] } users.uniq! puts "[" + updated_at.strftime('%d/%m/%Y') + "] " + pr.title.strip.upcase puts "Authors: " + users.join(", ") puts pr.body puts "" end repo = Github.new login: login, password: password, user: owner, repo: repo_name pull_requests = repo.pull_requests puts "### CHANGELOG ###" puts "" @@ -32,11 +34,11 @@ def print_pr( pr ) puts "UPCOMING CHANGES" puts "" pull_requests.list.each{ |pr| print_changelog( repo, pr ) } puts "----------------" puts "RELEASED" puts "" pull_requests.list( state: "closed" ).each{ |pr| print_changelog( repo, pr ) } -
Robin Komiwes created this gist
May 13, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ source 'https://rubygems.org' gem "github_api" gem "highline" This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ require 'highline/import' require 'github_api' login = ask("Login: ") password = ask("Password: ") { |q| q.echo = false } owner = ask("Repo owner: ") repo = ask("Repo name: ") def print_changelog( pr ) print_pr(pr) if pr.title.gsub!(/#changelog/, '') end def print_pr( pr ) updated_at = Date.rfc3339(pr.updated_at) puts "[" + updated_at.strftime('%d/%m/%Y') + "] " + pr.title.strip.upcase puts pr.body puts "" end github = Github.new login: login, password: password, user: owner, repo: repo pull_requests = github.pull_requests puts "### CHANGELOG ###" puts "" puts "----------------" puts "UPCOMING CHANGES" puts "" pull_requests.list.each{ |pr| print_changelog pr } puts "----------------" puts "RELEASED" puts "" pull_requests.list( state: "closed" ).each{ |pr| print_changelog pr }