mynewsdesk-git-pair 0.2.4 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +1 -1
- data/features/switching_authors.feature +17 -0
- data/lib/git-pair/author.rb +7 -7
- data/lib/git-pair/command.rb +1 -1
- data/lib/git-pair/version.rb +1 -1
- metadata +36 -62
- data/VERSION +0 -1
data/Gemfile.lock
CHANGED
@@ -20,3 +20,20 @@ Feature: Switching authors
|
|
20
20
|
When I switch to the pair "LT JCH"
|
21
21
|
Then `git pair` should display "Junio C Hamano + Linus Torvalds" for the current author
|
22
22
|
And `git pair` should display "devs+jch+lt@example.com" for the current email
|
23
|
+
|
24
|
+
Scenario: Pairing with two authors, specifyed by first names
|
25
|
+
Given I have added the author "Linus Torvalds <linus@example.org>"
|
26
|
+
And I have added the author "Junio C Hamano <junio@example.org>"
|
27
|
+
And my global Git configuration is setup with email "devs@example.com"
|
28
|
+
When I switch to the pair "linus junio"
|
29
|
+
Then `git pair` should display "Junio C Hamano + Linus Torvalds" for the current author
|
30
|
+
And `git pair` should display "devs+jch+lt@example.com" for the current email
|
31
|
+
|
32
|
+
Scenario: Pairing with two authors, specifyed by last names
|
33
|
+
Given I have added the author "Linus Torvalds <linus@example.org>"
|
34
|
+
And I have added the author "Junio C Hamano <junio@example.org>"
|
35
|
+
And my global Git configuration is setup with email "devs@example.com"
|
36
|
+
When I switch to the pair "torvalds hamano"
|
37
|
+
Then `git pair` should display "Junio C Hamano + Linus Torvalds" for the current author
|
38
|
+
And `git pair` should display "devs+jch+lt@example.com" for the current email
|
39
|
+
|
data/lib/git-pair/author.rb
CHANGED
@@ -9,14 +9,14 @@ module GitPair
|
|
9
9
|
Config.all_author_strings.map { |string| new(string) }
|
10
10
|
end
|
11
11
|
|
12
|
-
def self.find_all(
|
12
|
+
def self.find_all(abbrs_or_names)
|
13
13
|
raise MissingConfigurationError, "Please add some authors first" if all.empty?
|
14
|
-
|
14
|
+
abbrs_or_names.map { |abbr_or_name| self.find(abbr_or_name) }
|
15
15
|
end
|
16
16
|
|
17
|
-
def self.find(
|
18
|
-
all.find { |author| author.match?(
|
19
|
-
raise(NoMatchingAuthorsError, "no authors matched #{
|
17
|
+
def self.find(abbr_or_name)
|
18
|
+
all.find { |author| author.match?(abbr_or_name) } ||
|
19
|
+
raise(NoMatchingAuthorsError, "no authors matched #{abbr_or_name}")
|
20
20
|
end
|
21
21
|
|
22
22
|
def self.email(authors)
|
@@ -64,8 +64,8 @@ module GitPair
|
|
64
64
|
name.split.last.downcase
|
65
65
|
end
|
66
66
|
|
67
|
-
def match?(
|
68
|
-
|
67
|
+
def match?(abbr_or_name)
|
68
|
+
abbr_or_name.downcase == first_name || abbr_or_name.downcase == last_name || abbr_or_name.downcase == initials
|
69
69
|
end
|
70
70
|
end
|
71
71
|
end
|
data/lib/git-pair/command.rb
CHANGED
@@ -35,7 +35,7 @@ module GitPair
|
|
35
35
|
|
36
36
|
opts.separator ' '
|
37
37
|
opts.separator highlight('Switching authors:')
|
38
|
-
opts.separator ' git pair aa [bb] Where AA and BB are any abbreviation of an'
|
38
|
+
opts.separator ' git pair aa [bb] Where AA and BB are any abbreviation or name of an'
|
39
39
|
opts.separator ' '*37 + 'author\'s name. You can specify one or more authors.'
|
40
40
|
|
41
41
|
opts.separator ' '
|
data/lib/git-pair/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,10 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: mynewsdesk-git-pair
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 4
|
10
|
-
version: 0.2.4
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Chris Kampmeier
|
14
9
|
- Adam McCrea
|
15
10
|
- Jon Distad
|
@@ -17,49 +12,38 @@ authors:
|
|
17
12
|
autorequire:
|
18
13
|
bindir: bin
|
19
14
|
cert_chain: []
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
- !ruby/object:Gem::Dependency
|
15
|
+
date: 2012-03-20 00:00:00.000000000Z
|
16
|
+
dependencies:
|
17
|
+
- !ruby/object:Gem::Dependency
|
24
18
|
name: cucumber
|
25
|
-
|
26
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
requirement: &70226962336600 !ruby/object:Gem::Requirement
|
27
20
|
none: false
|
28
|
-
requirements:
|
21
|
+
requirements:
|
29
22
|
- - ~>
|
30
|
-
- !ruby/object:Gem::Version
|
31
|
-
|
32
|
-
segments:
|
33
|
-
- 1
|
34
|
-
- 0
|
35
|
-
version: "1.0"
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: '1.0'
|
36
25
|
type: :development
|
37
|
-
version_requirements: *id001
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
|
-
name: rspec
|
40
26
|
prerelease: false
|
41
|
-
|
27
|
+
version_requirements: *70226962336600
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rspec
|
30
|
+
requirement: &70226962336040 !ruby/object:Gem::Requirement
|
42
31
|
none: false
|
43
|
-
requirements:
|
32
|
+
requirements:
|
44
33
|
- - ~>
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
hash: 23
|
47
|
-
segments:
|
48
|
-
- 2
|
49
|
-
- 6
|
50
|
-
- 0
|
34
|
+
- !ruby/object:Gem::Version
|
51
35
|
version: 2.6.0
|
52
36
|
type: :development
|
53
|
-
|
54
|
-
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: *70226962336040
|
39
|
+
description: A git porcelain for pair programming. Changes git-config's user.name
|
40
|
+
and user.email settings so you can commit as more than one author.
|
55
41
|
email: dev@mynewsdesk.com
|
56
|
-
executables:
|
42
|
+
executables:
|
57
43
|
- git-pair
|
58
44
|
extensions: []
|
59
|
-
|
60
45
|
extra_rdoc_files: []
|
61
|
-
|
62
|
-
files:
|
46
|
+
files:
|
63
47
|
- .autotest
|
64
48
|
- .gitignore
|
65
49
|
- .rvmrc
|
@@ -69,7 +53,6 @@ files:
|
|
69
53
|
- README.markdown
|
70
54
|
- Rakefile
|
71
55
|
- Rakefilex
|
72
|
-
- VERSION
|
73
56
|
- bin/git-pair
|
74
57
|
- config/cucumber.yml
|
75
58
|
- features/adding_an_author.feature
|
@@ -87,38 +70,29 @@ files:
|
|
87
70
|
- mynewsdesk-git-pair.gemspec
|
88
71
|
homepage: http://github.com/mynewsdesk/git-pair
|
89
72
|
licenses: []
|
90
|
-
|
91
73
|
post_install_message:
|
92
74
|
rdoc_options: []
|
93
|
-
|
94
|
-
require_paths:
|
75
|
+
require_paths:
|
95
76
|
- lib
|
96
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
97
78
|
none: false
|
98
|
-
requirements:
|
99
|
-
- -
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
|
102
|
-
|
103
|
-
- 0
|
104
|
-
version: "0"
|
105
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
84
|
none: false
|
107
|
-
requirements:
|
108
|
-
- -
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
|
111
|
-
segments:
|
112
|
-
- 0
|
113
|
-
version: "0"
|
85
|
+
requirements:
|
86
|
+
- - ! '>='
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
114
89
|
requirements: []
|
115
|
-
|
116
90
|
rubyforge_project: git-pair
|
117
|
-
rubygems_version: 1.8.
|
91
|
+
rubygems_version: 1.8.10
|
118
92
|
signing_key:
|
119
93
|
specification_version: 3
|
120
94
|
summary: Configure git to commit as more than one author
|
121
|
-
test_files:
|
95
|
+
test_files:
|
122
96
|
- features/adding_an_author.feature
|
123
97
|
- features/configuring_pair_email.feature
|
124
98
|
- features/removing_an_author.feature
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.2.3
|