Skip to content

Instantly share code, notes, and snippets.

@sevos
Forked from andrzejsliwa/pair
Last active August 3, 2022 10:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sevos/4047178 to your computer and use it in GitHub Desktop.
Save sevos/4047178 to your computer and use it in GitHub Desktop.
A script to change pairs
#!/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', 'artur.roszczyk@gmail.com')
$pairs = {
'andrzej' => Pair.new('Andrzej Śliwa', 'andrzej+artur@bonusbox.me'),
'jan' => Pair.new('Jan Riethmayer', 'jan+artur@bonusbox.me'),
}
person = $pairs[ARGV[0]] || $me
puts "Activating: #{person.name}"
person.activate
# -*- 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 = ["artur.roszczyk@gmail.com", "andrzej.sliwa@i-tool.eu"]
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