-
-
Save sevos/4047178 to your computer and use it in GitHub Desktop.
A script to change pairs
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
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
Person = Struct.new(:name, :email) do | |
def activate | |
`git config user.name '#{name}'` | |
`git config user.email '#{email}'` | |
end | |
end | |
class Pair < Person | |
def name | |
"Pairing #{super} + #{$me.name}" | |
end | |
end | |
$me = Person.new('Artur Roszczyk', '[email protected]') | |
$pairs = { | |
'andrzej' => Pair.new('Andrzej Śliwa', '[email protected]'), | |
'jan' => Pair.new('Jan Riethmayer', '[email protected]'), | |
} | |
person = $pairs[ARGV[0]] || $me | |
puts "Activating: #{person.name}" | |
person.activate |
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
# -*- encoding: utf-8 -*- | |
$:.push File.expand_path("../", __FILE__) | |
Gem::Specification.new do |s| | |
s.name = "git-pair" | |
s.version = "0.0.1" | |
s.platform = Gem::Platform::RUBY | |
s.authors = ["Artur Roszczyk", "Andrzej Sliwa"] | |
s.email = ["[email protected]", "[email protected]"] | |
s.homepage = "https://gist.github.com/4047178" | |
s.summary = %q{Microgem for pair programming in git} | |
s.description = %q{Microgem for pair programming in git} | |
s.files = `git ls-files`.split("\n") | |
s.test_files = [] | |
s.executables = ['git-pair'] | |
s.require_paths = [] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment