Created
July 27, 2012 02:49
-
-
Save mkaito/3185932 to your computer and use it in GitHub Desktop.
Revisions
-
Kaito Michishige revised this gist
Aug 6, 2012 . 1 changed file with 4 additions and 3 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 charactersOriginal file line number Diff line number Diff line change @@ -4,15 +4,16 @@ require 'net/http' branches = [] cnum = 0 STDIN.each do |line| (oldref, newref, refname) = line.split branches.push `git rev-parse --symbolic --abbrev-ref #{refname}`.chomp cnum += `git log --format=oneline #{oldref}..#{newref} | wc -l`.chomp end branches = branches.uniq.join(", ") repo = ENV['GL_REPO'] user = ENV['GL_USER'] uri = URI('http://memorici.de:54545/hubot/git/pushed/spaceships/') Net::HTTP.post_form uri, 'user' => user, 'num' => cnum, 'branch' => branches, 'repo' => repo -
Kaito Michishige created this gist
Jul 27, 2012 .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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ #!/usr/bin/env ruby # Notify hubot when someone pushes. require 'net/http' branches = [] STDIN.each do |line| (oldrev, newref, refname) = line.split branches.push `git rev-parse --symbolic --abbrev-ref #{refname}`.chomp end branches = branches.uniq.join(", ") repo = ENV['GL_REPO'] user = ENV['GL_USER'] cnum = STDIN.length uri = URI('http://memorici.de:54545/hubot/git/pushed/spaceships/') Net::HTTP.post_form uri, 'user' => user, 'num' => cnum, 'branch' => branches, 'repo' => repo