hitch 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/{MIT_LICENSE → LICENSE.md} +1 -1
- data/README.md +7 -27
- data/lib/hitch.rb +9 -1
- data/lib/hitch/ui.rb +2 -4
- data/lib/hitch/version.rb +1 -1
- data/spec/hitch/ui_spec.rb +1 -1
- data/spec/hitch_spec.rb +8 -4
- metadata +8 -8
data/{MIT_LICENSE → LICENSE.md}
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
(The MIT License)
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) 2009-2011 Rogelio J. Samour
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
6
|
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
hitch
|
2
2
|
=====
|
3
|
-
|
4
|
-
http://blog.therubymug.com
|
3
|
+
by Rogelio J. Samour (http://blog.therubymug.com)
|
5
4
|
|
6
5
|
Description:
|
7
6
|
-----------
|
@@ -13,6 +12,7 @@ Features:
|
|
13
12
|
|
14
13
|
* Persists pair(s) between different terminal instances.
|
15
14
|
* Creates a unique email address for the pair. (e.g. dev+fry+leela@hashrocket.com) This provides the ability to create a Gravatar for the pair.
|
15
|
+
* Allows you to expire the pair information in N hours. e.g. hitch --expire 8 fry leela
|
16
16
|
|
17
17
|
Synopsis:
|
18
18
|
--------
|
@@ -51,9 +51,9 @@ Development:
|
|
51
51
|
* It's easier if you use rvm.
|
52
52
|
* Fork hitch
|
53
53
|
* When you cd into the directory the .rvmrc will activate and create a hitch gemset
|
54
|
-
*
|
55
|
-
|
56
|
-
|
54
|
+
* Then run the following scripts:
|
55
|
+
<pre><code>sh install_supported_rubies.sh
|
56
|
+
sh rake_spec_with_all_rubies.sh # this also bundles all necessary gems</code></pre>
|
57
57
|
|
58
58
|
Requirements:
|
59
59
|
------------
|
@@ -69,26 +69,6 @@ Acknowledgements:
|
|
69
69
|
|
70
70
|
License:
|
71
71
|
-------
|
72
|
+
Released under the MIT License. See the [LICENSE][license] file for further details.
|
72
73
|
|
73
|
-
|
74
|
-
|
75
|
-
Copyright (c) 2010 Rogelio J. Samour
|
76
|
-
|
77
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
78
|
-
a copy of this software and associated documentation files (the
|
79
|
-
'Software'), to deal in the Software without restriction, including
|
80
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
81
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
82
|
-
permit persons to whom the Software is furnished to do so, subject to
|
83
|
-
the following conditions:
|
84
|
-
|
85
|
-
The above copyright notice and this permission notice shall be
|
86
|
-
included in all copies or substantial portions of the Software.
|
87
|
-
|
88
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
89
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
90
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
91
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
92
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
93
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
94
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
74
|
+
[license]: https://github.com/therubymug/hitch/blob/master/LICENSE.md
|
data/lib/hitch.rb
CHANGED
@@ -63,7 +63,15 @@ module Hitch
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def self.git_author_name
|
66
|
-
current_pair.sort.map {|pair| Hitch::Author.find(pair)}
|
66
|
+
devs = current_pair.sort.map {|pair| Hitch::Author.find(pair)}
|
67
|
+
case devs.length
|
68
|
+
when 1
|
69
|
+
devs[0]
|
70
|
+
when 2
|
71
|
+
"#{devs[0]} and #{devs[1]}"
|
72
|
+
else
|
73
|
+
"#{devs[0...-1].join(', ')}, and #{devs[-1]}"
|
74
|
+
end
|
67
75
|
end
|
68
76
|
|
69
77
|
def self.git_author_email
|
data/lib/hitch/ui.rb
CHANGED
@@ -12,10 +12,8 @@ module Hitch
|
|
12
12
|
|
13
13
|
def self.prompt_for_pair(new_author)
|
14
14
|
highline.say("I don't know who #{new_author} is.")
|
15
|
-
if highline.agree("Do you want to add #{new_author} to ~/.hitch_pairs?"
|
16
|
-
author_name = highline.ask("What is #{new_author}'s full name?")
|
17
|
-
q.validate = /\A[\w.,-]+(?: [\w.,-]+)*\z/
|
18
|
-
end
|
15
|
+
if highline.agree("Do you want to add #{new_author} to ~/.hitch_pairs?")
|
16
|
+
author_name = highline.ask("What is #{new_author}'s full name?")
|
19
17
|
Hitch::Author.add(new_author, author_name)
|
20
18
|
Hitch::Author.write_file
|
21
19
|
return new_author
|
data/lib/hitch/version.rb
CHANGED
data/spec/hitch/ui_spec.rb
CHANGED
@@ -38,7 +38,7 @@ describe Hitch::UI do
|
|
38
38
|
end
|
39
39
|
|
40
40
|
it 'prompts for pair' do
|
41
|
-
Hitch::UI.highline.should_receive(:agree).with("Do you want to add #{new_author} to ~/.hitch_pairs?"
|
41
|
+
Hitch::UI.highline.should_receive(:agree).with("Do you want to add #{new_author} to ~/.hitch_pairs?")
|
42
42
|
Hitch::UI.prompt_for_pair(new_author)
|
43
43
|
end
|
44
44
|
|
data/spec/hitch_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Hitch do
|
4
4
|
|
5
|
-
let(:hitch_pairs) {{'leela' => 'Turanga Leela', 'fry' => 'Philip J. Fry'}}
|
5
|
+
let(:hitch_pairs) {{'leela' => 'Turanga Leela', 'fry' => 'Philip J. Fry', 'zoidberg' => 'John A. Zoidberg'}}
|
6
6
|
|
7
7
|
let(:hitch_config) do
|
8
8
|
{ :group_email => 'dev@hashrocket.com',
|
@@ -58,6 +58,13 @@ describe Hitch do
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
+
context 'with more than 2 developers' do
|
62
|
+
it "joins 3+ developers together with commas and an 'and'" do
|
63
|
+
Hitch.current_pair = ['leela', 'fry', 'zoidberg']
|
64
|
+
Hitch.author_command.should == "export GIT_AUTHOR_NAME='Philip J. Fry, Turanga Leela, and John A. Zoidberg' GIT_AUTHOR_EMAIL='dev+fry+leela+zoidberg@hashrocket.com'"
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
61
68
|
end
|
62
69
|
|
63
70
|
describe '.unhitch' do
|
@@ -236,7 +243,4 @@ describe Hitch do
|
|
236
243
|
end
|
237
244
|
end
|
238
245
|
|
239
|
-
describe '.command' do
|
240
|
-
end
|
241
|
-
|
242
246
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hitch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-06-02 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70229657686720 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.6.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70229657686720
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: highline
|
27
|
-
requirement: &
|
27
|
+
requirement: &70229657686240 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: 1.6.2
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70229657686240
|
36
36
|
description: Git author attribution helper for pair programmers.
|
37
37
|
email: rogelio@therubymug.com
|
38
38
|
executables:
|
@@ -46,7 +46,7 @@ files:
|
|
46
46
|
- lib/hitch.rb
|
47
47
|
- bin/hitch
|
48
48
|
- Rakefile
|
49
|
-
-
|
49
|
+
- LICENSE.md
|
50
50
|
- README.md
|
51
51
|
- spec/hitch/author_spec.rb
|
52
52
|
- spec/hitch/ui_spec.rb
|
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
73
|
version: 1.3.6
|
74
74
|
requirements: []
|
75
75
|
rubyforge_project:
|
76
|
-
rubygems_version: 1.8.
|
76
|
+
rubygems_version: 1.8.15
|
77
77
|
signing_key:
|
78
78
|
specification_version: 3
|
79
79
|
summary: Hitch allows developers to be properly credited when Pair Programming and
|