tobytripp-git-pair 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +4 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +36 -0
- data/Rakefile +16 -5
- data/features/adding_an_author.feature +7 -7
- data/features/listing_authors.feature +7 -0
- data/features/resetting_the_pair.feature +5 -3
- data/features/step_definitions/config_steps.rb +9 -9
- data/features/support/env.rb +1 -4
- data/git-pair.gems +1 -0
- data/lib/git-pair/author.rb +2 -3
- data/tobytripp-git-pair.gemspec +10 -9
- metadata +22 -21
data/.rvmrc
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
tobytripp-git-pair (1.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://rubygems.org/
|
8
|
+
specs:
|
9
|
+
builder (3.0.0)
|
10
|
+
cucumber (0.10.0)
|
11
|
+
builder (>= 2.1.2)
|
12
|
+
diff-lcs (~> 1.1.2)
|
13
|
+
gherkin (~> 2.3.2)
|
14
|
+
json (~> 1.4.6)
|
15
|
+
term-ansicolor (~> 1.0.5)
|
16
|
+
diff-lcs (1.1.2)
|
17
|
+
gherkin (2.3.3)
|
18
|
+
json (~> 1.4.6)
|
19
|
+
json (1.4.6)
|
20
|
+
rspec (2.5.0)
|
21
|
+
rspec-core (~> 2.5.0)
|
22
|
+
rspec-expectations (~> 2.5.0)
|
23
|
+
rspec-mocks (~> 2.5.0)
|
24
|
+
rspec-core (2.5.1)
|
25
|
+
rspec-expectations (2.5.0)
|
26
|
+
diff-lcs (~> 1.1.2)
|
27
|
+
rspec-mocks (2.5.0)
|
28
|
+
term-ansicolor (1.0.5)
|
29
|
+
|
30
|
+
PLATFORMS
|
31
|
+
ruby
|
32
|
+
|
33
|
+
DEPENDENCIES
|
34
|
+
cucumber
|
35
|
+
rspec (~> 2.5.0)
|
36
|
+
tobytripp-git-pair!
|
data/Rakefile
CHANGED
@@ -1,19 +1,30 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'rake'
|
3
3
|
|
4
|
+
require 'bundler'
|
5
|
+
Bundler::GemHelper.install_tasks
|
6
|
+
|
4
7
|
begin
|
5
8
|
require 'cucumber/rake/task'
|
6
|
-
Cucumber::Rake::Task.new(:features)
|
7
9
|
|
8
|
-
|
10
|
+
namespace :cucumber do
|
11
|
+
Cucumber::Rake::Task.new(:ok) do |t|
|
12
|
+
t.cucumber_opts = "--tags ~@wip"
|
13
|
+
end
|
14
|
+
|
15
|
+
Cucumber::Rake::Task.new(:wip, "Run features that are being worked on") do |t|
|
16
|
+
t.cucumber_opts = "--tags @wip:2 --wip"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
task :cucumber => 'cucumber:ok'
|
9
21
|
rescue LoadError
|
10
|
-
task :
|
22
|
+
task :cucumber do
|
11
23
|
abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
|
12
24
|
end
|
13
25
|
end
|
14
26
|
|
15
|
-
task :default => :
|
27
|
+
task :default => :cucumber
|
16
28
|
|
17
29
|
# Don't print commands when shelling out (for example, running Cucumber)
|
18
30
|
RakeFileUtils.verbose(false)
|
19
|
-
|
@@ -9,19 +9,19 @@ Feature: Adding an author
|
|
9
9
|
|
10
10
|
Scenario: adding the same name and email twice
|
11
11
|
When I add the author "Linus Torvalds <linus@example.org>"
|
12
|
-
|
12
|
+
And I add the author "Linus Torvalds <linus@example.org>"
|
13
13
|
Then `git pair` should display "Linus Torvalds" in its author list only once
|
14
|
-
|
14
|
+
And the gitconfig should include "Linus Torvalds" in its author list only once
|
15
15
|
|
16
16
|
Scenario: adding the same name twice with different emails
|
17
17
|
When I add the author "Linus Torvalds <linus@example.org>"
|
18
|
-
|
18
|
+
And I add the author "Linus Torvalds <linus@example.com>"
|
19
19
|
Then `git pair` should display "Linus Torvalds" in its author list only once
|
20
|
-
|
21
|
-
|
20
|
+
And the gitconfig should include "Linus Torvalds" in its author list only once
|
21
|
+
And the gitconfig should include "linus@example.org" as the email of "Linus Torvalds"
|
22
22
|
|
23
23
|
Scenario: adding a malformed author string
|
24
24
|
When I add the author " "
|
25
|
-
|
26
|
-
|
25
|
+
And I add the author "Bob Dole"
|
26
|
+
And I add the author "Jimmy <asdf"
|
27
27
|
Then the config file should have no authors
|
@@ -1,7 +1,9 @@
|
|
1
1
|
Feature: Resetting the current authors
|
2
2
|
Scenario: resetting the current authors
|
3
3
|
Given I have added the author "Linus Torvalds <linus@example.org>"
|
4
|
-
|
5
|
-
|
4
|
+
And my global Git configuration is setup with user "Global User"
|
5
|
+
And I switch to the pair "LT"
|
6
|
+
|
6
7
|
When I reset the current authors
|
7
|
-
|
8
|
+
|
9
|
+
Then `git pair` should display "Global User" for the current author
|
@@ -22,20 +22,20 @@ When /^I (?:try to )?switch to the pair "([^\"]*)"$/ do |abbreviations|
|
|
22
22
|
@output = git_pair abbreviations
|
23
23
|
end
|
24
24
|
|
25
|
-
When /^I reset the current authors$/ do
|
25
|
+
When /^I reset the current authors$/ do
|
26
26
|
git_pair '--reset'
|
27
27
|
end
|
28
28
|
|
29
29
|
Then /^`git pair` should display "([^\"]*)" in its author list$/ do |name|
|
30
30
|
output = git_pair
|
31
31
|
authors = authors_list_from_output(output)
|
32
|
-
|
32
|
+
authors.should include( name )
|
33
33
|
end
|
34
34
|
|
35
35
|
Then /^`git pair` should display "([^\"]*)" in its author list only once$/ do |name|
|
36
36
|
output = git_pair
|
37
37
|
authors = authors_list_from_output(output)
|
38
|
-
|
38
|
+
authors.select { |author| author == name}.size.should == 1
|
39
39
|
end
|
40
40
|
|
41
41
|
Then /^`git pair` should display no authors$/ do
|
@@ -47,24 +47,24 @@ end
|
|
47
47
|
|
48
48
|
Then /^`git pair` should display "([^\"]*)" for the current author$/ do |names|
|
49
49
|
output = git_pair
|
50
|
-
|
50
|
+
current_author_from_output(output).should == names
|
51
51
|
end
|
52
52
|
|
53
53
|
Then /^`git pair` should display "([^\"]*)" for the current email$/ do |email|
|
54
54
|
output = git_pair
|
55
|
-
|
55
|
+
current_email_from_output(output).should == email
|
56
56
|
end
|
57
57
|
|
58
58
|
Then /^the gitconfig should include "([^\"]*)" in its author list only once$/ do |name|
|
59
59
|
output = git_config
|
60
60
|
authors = output.split("\n").map { |line| line =~ /^git-pair\.authors=(.*) <[^>]+>$/; $1 }.compact
|
61
|
-
|
61
|
+
authors.select { |author| author == name}.size.should == 1
|
62
62
|
end
|
63
63
|
|
64
64
|
Then /^the gitconfig should include "([^\"]*)" as the email of "([^\"]*)"$/ do |email, name|
|
65
65
|
output = git_config
|
66
66
|
authors = output.split("\n").map { |line| line =~ /^git-pair\.authors=.* <([^>]+)>$/; $1 }.compact
|
67
|
-
|
67
|
+
authors.select { |author| author == email}.size.should == 1
|
68
68
|
end
|
69
69
|
|
70
70
|
Then /^`git pair` should display the following author list:$/ do |table|
|
@@ -75,11 +75,11 @@ end
|
|
75
75
|
|
76
76
|
Then /^`git pair` should display an empty author list$/ do
|
77
77
|
output = git_pair
|
78
|
-
|
78
|
+
authors_list_from_output(output).should be_empty
|
79
79
|
end
|
80
80
|
|
81
81
|
Then /^the last command\'s output should include "([^\"]*)"$/ do |output|
|
82
|
-
|
82
|
+
@output.should include(output)
|
83
83
|
end
|
84
84
|
|
85
85
|
Then /^the config file should have no authors$/ do
|
data/features/support/env.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
require 'tmpdir'
|
2
|
-
require '
|
3
|
-
World(Test::Unit::Assertions)
|
4
|
-
|
2
|
+
require 'rspec'
|
5
3
|
|
6
4
|
module RepositoryHelper
|
7
5
|
# TODO: use 1.8.7's Dir.mktmpdir?
|
@@ -37,7 +35,6 @@ end
|
|
37
35
|
|
38
36
|
World(RepositoryHelper)
|
39
37
|
|
40
|
-
|
41
38
|
Before do
|
42
39
|
backup_gitconfigs
|
43
40
|
FileUtils.mkdir_p RepositoryHelper::TEST_REPO_PATH
|
data/git-pair.gems
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
bundler -v1.0.10
|
data/lib/git-pair/author.rb
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
module GitPair
|
2
2
|
class Author
|
3
|
-
|
4
3
|
ValidAuthorStringRegex = /^\s*([^<]+)<([^>]+)>\s*$/
|
5
4
|
|
6
5
|
class InvalidAuthorString < TypeError; end
|
7
|
-
|
6
|
+
|
8
7
|
def self.all
|
9
8
|
Config.all_author_strings.map { |string| new(string) }
|
10
9
|
end
|
@@ -15,7 +14,7 @@ module GitPair
|
|
15
14
|
end
|
16
15
|
|
17
16
|
def self.find(abbr)
|
18
|
-
all.find { |author| author.match?(abbr) } ||
|
17
|
+
all.find { |author| author.match?(abbr) } ||
|
19
18
|
raise(NoMatchingAuthorsError, "no authors matched #{abbr}")
|
20
19
|
end
|
21
20
|
|
data/tobytripp-git-pair.gemspec
CHANGED
@@ -1,29 +1,30 @@
|
|
1
|
-
# -*-
|
1
|
+
# -*- coding: utf-8 -*-
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{tobytripp-git-pair}
|
5
|
-
s.version = "1.1.
|
5
|
+
s.version = "1.1.1"
|
6
6
|
s.platform = Gem::Platform::RUBY
|
7
|
-
|
7
|
+
|
8
8
|
s.authors = ["Chris Kampmeier", "Adam McCrea", "Jon Distad", "Toby Tripp"]
|
9
9
|
s.email = %q{toby.tripp+github@gmail.com}
|
10
10
|
|
11
11
|
s.summary = %q{Configure git to commit as more than one author}
|
12
12
|
s.description = %q{A git porcelain for pair programming. Changes git-config's user.name and user.email settings so you can commit as more than one author.} #'
|
13
|
-
|
14
|
-
s.default_executable = %q{git-pair}
|
13
|
+
|
15
14
|
s.executables = ["git-pair"]
|
16
|
-
|
15
|
+
|
17
16
|
s.rdoc_options = ["--charset=UTF-8"]
|
18
17
|
s.extra_rdoc_files = %w[LICENSE README.markdown]
|
19
18
|
|
20
19
|
s.files = `git ls-files`.split("\n")
|
21
20
|
s.test_files = `git ls-files -- features/*`.split("\n")
|
22
|
-
|
21
|
+
|
23
22
|
s.homepage = %q{http://github.com/tobytripp/git-pair}
|
24
|
-
|
23
|
+
|
25
24
|
s.require_paths = ["lib"]
|
26
|
-
|
25
|
+
|
27
26
|
s.required_rubygems_version = ">= 1.3.5"
|
27
|
+
|
28
28
|
s.add_development_dependency "cucumber"
|
29
|
+
s.add_development_dependency "rspec", "~> 2.5.0"
|
29
30
|
end
|
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tobytripp-git-pair
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 1
|
9
|
-
- 0
|
10
|
-
version: 1.1.0
|
4
|
+
prerelease:
|
5
|
+
version: 1.1.1
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Chris Kampmeier
|
@@ -18,8 +13,8 @@ autorequire:
|
|
18
13
|
bindir: bin
|
19
14
|
cert_chain: []
|
20
15
|
|
21
|
-
date: 2011-
|
22
|
-
default_executable:
|
16
|
+
date: 2011-05-09 00:00:00 -05:00
|
17
|
+
default_executable:
|
23
18
|
dependencies:
|
24
19
|
- !ruby/object:Gem::Dependency
|
25
20
|
name: cucumber
|
@@ -29,12 +24,20 @@ dependencies:
|
|
29
24
|
requirements:
|
30
25
|
- - ">="
|
31
26
|
- !ruby/object:Gem::Version
|
32
|
-
hash: 3
|
33
|
-
segments:
|
34
|
-
- 0
|
35
27
|
version: "0"
|
36
28
|
type: :development
|
37
29
|
version_requirements: *id001
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rspec
|
32
|
+
prerelease: false
|
33
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
35
|
+
requirements:
|
36
|
+
- - ~>
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: 2.5.0
|
39
|
+
type: :development
|
40
|
+
version_requirements: *id002
|
38
41
|
description: A git porcelain for pair programming. Changes git-config's user.name and user.email settings so you can commit as more than one author.
|
39
42
|
email: toby.tripp+github@gmail.com
|
40
43
|
executables:
|
@@ -47,6 +50,9 @@ extra_rdoc_files:
|
|
47
50
|
files:
|
48
51
|
- .autotest
|
49
52
|
- .gitignore
|
53
|
+
- .rvmrc
|
54
|
+
- Gemfile
|
55
|
+
- Gemfile.lock
|
50
56
|
- LICENSE
|
51
57
|
- README.markdown
|
52
58
|
- Rakefile
|
@@ -54,11 +60,13 @@ files:
|
|
54
60
|
- bin/git-pair
|
55
61
|
- config/cucumber.yml
|
56
62
|
- features/adding_an_author.feature
|
63
|
+
- features/listing_authors.feature
|
57
64
|
- features/removing_an_author.feature
|
58
65
|
- features/resetting_the_pair.feature
|
59
66
|
- features/step_definitions/config_steps.rb
|
60
67
|
- features/support/env.rb
|
61
68
|
- features/switching_authors.feature
|
69
|
+
- git-pair.gems
|
62
70
|
- lib/git-pair.rb
|
63
71
|
- lib/git-pair/author.rb
|
64
72
|
- lib/git-pair/command.rb
|
@@ -78,30 +86,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
86
|
requirements:
|
79
87
|
- - ">="
|
80
88
|
- !ruby/object:Gem::Version
|
81
|
-
hash: 3
|
82
|
-
segments:
|
83
|
-
- 0
|
84
89
|
version: "0"
|
85
90
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
91
|
none: false
|
87
92
|
requirements:
|
88
93
|
- - ">="
|
89
94
|
- !ruby/object:Gem::Version
|
90
|
-
hash: 17
|
91
|
-
segments:
|
92
|
-
- 1
|
93
|
-
- 3
|
94
|
-
- 5
|
95
95
|
version: 1.3.5
|
96
96
|
requirements: []
|
97
97
|
|
98
98
|
rubyforge_project:
|
99
|
-
rubygems_version: 1.
|
99
|
+
rubygems_version: 1.6.2
|
100
100
|
signing_key:
|
101
101
|
specification_version: 3
|
102
102
|
summary: Configure git to commit as more than one author
|
103
103
|
test_files:
|
104
104
|
- features/adding_an_author.feature
|
105
|
+
- features/listing_authors.feature
|
105
106
|
- features/removing_an_author.feature
|
106
107
|
- features/resetting_the_pair.feature
|
107
108
|
- features/step_definitions/config_steps.rb
|