pair-salad 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/pair +5 -0
  2. metadata +59 -43
  3. data/bin/pair-salad +0 -79
data/bin/pair ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "lib/pair_salad_runner"
4
+
5
+ PairSaladRunner.new.run(ARGV)
metadata CHANGED
@@ -1,65 +1,81 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: pair-salad
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 1
9
- version: 0.0.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Scott Albertson
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2012-04-06 00:00:00 -07:00
18
- default_executable: pair-salad
19
- dependencies: []
20
-
12
+ date: 2012-10-24 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rspec
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: ruby-debug
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
21
46
  description: Git utility used when pair programming.
22
- email:
47
+ email:
23
48
  - salbertson@streamsend.com
24
- executables:
25
- - pair-salad
49
+ executables:
50
+ - pair
26
51
  extensions: []
27
-
28
52
  extra_rdoc_files: []
29
-
30
- files:
53
+ files:
31
54
  - Rakefile
32
55
  - README.md
33
- - bin/pair-salad
34
- has_rdoc: true
35
- homepage: ""
56
+ - bin/pair
57
+ homepage: ''
36
58
  licenses: []
37
-
38
59
  post_install_message:
39
60
  rdoc_options: []
40
-
41
- require_paths:
61
+ require_paths:
42
62
  - lib
43
- required_ruby_version: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- segments:
48
- - 0
49
- version: "0"
50
- required_rubygems_version: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- segments:
55
- - 0
56
- version: "0"
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ none: false
71
+ requirements:
72
+ - - ! '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
57
75
  requirements: []
58
-
59
76
  rubyforge_project:
60
- rubygems_version: 1.3.6
77
+ rubygems_version: 1.8.24
61
78
  signing_key:
62
79
  specification_version: 3
63
80
  summary: Git utility used when pair programming.
64
81
  test_files: []
65
-
data/bin/pair-salad DELETED
@@ -1,79 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # Configures the git author to a list of developers when pair programming
4
- #
5
- # Usage: pair lm bh (Sets the author to 'Luke Melia and Bryan Helmkamp')
6
- # pair (Unsets the author so the git global config takes effect)
7
- #
8
- # Author: Bryan Helmkamp (http://brynary.com)
9
- # Author: Rod Hilton and Adam Esterline (http://www.rallydev.com)
10
- #
11
- # http://www.rallydev.com/engblog/2009/09/10/improved-pair-programming-git/
12
-
13
- #######################################################################
14
- ## Configuration
15
-
16
- EMAIL_PREFIX = "engineers"
17
- EMAIL_SUFFIX = "@streamsend.com"
18
- AUTHORS = {}
19
-
20
- @pair_initials = ARGV.sort
21
-
22
- ## End of configuration
23
- #######################################################################
24
-
25
- unless File.exists?(".git")
26
- puts "This doesn't look like a git repository."
27
- exit 1
28
- end
29
-
30
- unless File.exists?(".authors")
31
- puts "You do not have an .authors file in the repository."
32
- puts "Repository needs a file named .authors in the following format:"
33
- puts " ck Clark Kent"
34
- puts " bw Bruce Wayne"
35
- puts " pp Peter Parker"
36
- exit 1
37
- end
38
-
39
- # Read the local .authors file, parsing to get the AUTHORS map
40
- File.open('.authors').each_line do |line|
41
- initials, name = line.match(/^(\w+)\s+(.*)$/).captures
42
- if(AUTHORS.has_key?(initials))
43
- puts "Duplicate initials for #{initials}"
44
- exit 1
45
- end
46
- AUTHORS[initials] = name
47
- end
48
-
49
- authors = @pair_initials.map do |initials|
50
- if AUTHORS[initials.downcase]
51
- AUTHORS[initials.downcase]
52
- else
53
- puts "Couldn't find author name for initials: #{initials}"
54
- exit 1
55
- end
56
- end
57
-
58
- if authors.any?
59
- if authors.size == 1
60
- authors = authors.first
61
- elsif authors.size == 2
62
- authors = authors.join(" and ")
63
- else
64
- authors = authors[0..-2].join(", ") + " and " + authors.last
65
- end
66
-
67
- email="#{EMAIL_PREFIX}+#{@pair_initials.join("+")}#{EMAIL_SUFFIX}"
68
-
69
- `git config user.name '#{authors}'`
70
- `git config user.email '#{email}'`
71
-
72
- puts "user.name = #{authors}"
73
- puts "user.email = #{email}"
74
- else
75
- `git config --unset user.name`
76
- `git config --unset user.email`
77
-
78
- puts "Unset user.name and user.email"
79
- end