git-pairing 0.2.4 → 0.2.5

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.
Files changed (4) hide show
  1. checksums.yaml +8 -8
  2. data/bin/git-pair +5 -25
  3. data/lib/commands/set.rb +2 -2
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWEzYTI2ZDViMTEzNmMxMDk4OWNjNThjZTgwYWZkZGMwOWY2MWYyOA==
4
+ NDE5NjgwZTdiNjYwNDU2ZTMxMTQyNWZkM2MxODNjMWRiZTdmMTZhMQ==
5
5
  data.tar.gz: !binary |-
6
- YjNjNjAxNGQ4NjM2NGNhNDBhMTdkZWFlZWU4ZDM5MGRlYWNhOGMzOA==
6
+ OTUzMDg1ZTEwZTU2NTUyZWUyYjI5MzI2N2IzYTEyNDZmZTQyMDg5Zg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MWE1Nzc5MmQ3MDQ5NWZjZDdlZGYxMzQ0N2JkYzQzOGZkYmVjMWY0NWFiMDgw
10
- ZGRiZmRmYTMxOWFiYTBlMjllYjRjMWY4MjcwMzNjNjkzM2M5NjZhNTMwNGM0
11
- Mzk2YWI1N2MzNzkyZmFmOGFkNzRkY2Q0NjliZGFkNzIxY2JjMmQ=
9
+ ZTJjODQ4MTk0YjdmNWZiNmZhNDg2ZjBkZTg0ZTI0ZDBiNDE3ZGQ5M2VhYmIy
10
+ MjU2YzUxMjcxZGM4MGFlZTY3OTNhY2ZhMTEwOTY2MmM3N2MyYzgwNmUyZWNl
11
+ MjIyZWY4MjU2NzJlZWVhODQ4N2ZjZjAyYjA5YTQ3MzZmZmVhZjQ=
12
12
  data.tar.gz: !binary |-
13
- OTVkYWM3MjllY2JiM2FkNzhmNWIwMzAyNjNiZTljNzRkZDE4OTNjNGFhMTVh
14
- MmMxNDA5NWIxNmRmMmMyYThmNTFlMWUwMDRjMDYwZWYyZWFhZjc3OTczMjNl
15
- ZmU2ZmM3YWZlODMyN2Y5YWZkZGMxOWM4ZjAzNzhkZGU4YjIyZTI=
13
+ OWY0NDg2YzVhM2ZkM2VkMTgyZjY2YTJhY2U3MDhlYTQ2NTdiZTIyOTZiZjUw
14
+ ZWVmZDgxYTY2Y2M4YjBiNjBmNGE0NWU5OGNjOWVkNTgxODU1OGYwMWY3YTNh
15
+ MGZlNTllYzMyNmIwMWJjYzE5NjRlMmQ2YzRmMWYyNTMwNTQ3MmU=
data/bin/git-pair CHANGED
@@ -1,22 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- =begin
4
- # 1.9 adds realpath to resolve symlinks; 1.8 doesn't
5
- # have this method, so we add it so we get resolved symlinks
6
- # and compatibility
7
- unless File.respond_to? :realpath
8
- class File #:nodoc:
9
- def self.realpath path
10
- return realpath(File.readlink(path)) if symlink?(path)
11
- path
12
- end
13
- end
14
- end
15
-
16
- $: << File.expand_path(File.dirname(File.realpath(__FILE__)) + '/../lib')
17
- #$: << File.expand_path(File.dirname(__FILE__) + './../lib')
18
- =end
19
-
20
3
  require 'gli'
21
4
  require 'git-pair'
22
5
 
@@ -42,19 +25,16 @@ pre do |global,command,options,args|
42
25
  name.strip.downcase.split(/ /).each { |n| initials << n.split(//)[0] }
43
26
  email = `git config --get user.email`
44
27
  username = email.split("@")[0]
45
- $pairs_conf = YAML::Store.new(CFG_FILE)
46
- $pairs_conf.transaction do
47
- $pairs_conf["pairs"] = {"#{initials}" => {'name'=>"#{name.strip}", 'username'=>"#{username}", 'email'=>"#{email.strip}"} }
48
- #puts "in conf create"
49
- #ap $pairs_conf
28
+ default_conf = YAML::Store.new(CFG_FILE)
29
+ default_conf.transaction do
30
+ default_conf["pairs"] = {"#{initials}" => {'name'=>"#{name.strip}", 'username'=>"#{username}", 'email'=>"#{email.strip}"} }
31
+ default_conf["delimiters"] = {"name" => " / ", "initials" => " "}
50
32
  end
51
33
  end
52
34
 
53
35
  # Load .pairs config
54
36
  if (File.exist?(CFG_FILE))
55
37
  $pairs_conf = YAML::load(File.open(CFG_FILE, 'r'))
56
- #puts "in conf load"
57
- #ap $pairs_conf
58
38
  else
59
39
  exit_now!("No ~/.pairs config file found")
60
40
  end
@@ -74,7 +54,7 @@ on_error do |exception|
74
54
  true
75
55
  end
76
56
 
77
- # put command rb files into ./lib/commands/
57
+ # put command rb files into ./../lib/commands/
78
58
  commands_from './../lib/commands'
79
59
 
80
60
  exit run(ARGV)
data/lib/commands/set.rb CHANGED
@@ -41,8 +41,8 @@ command :set do |c|
41
41
  sorted_authors << a[0]
42
42
  sorted_initials << a[1]
43
43
  if size > 1 && authors.index(a) < size-1
44
- sorted_authors << " / "
45
- sorted_initials << " "
44
+ sorted_authors << $pairs_conf['delimiters']['name'] #" / "
45
+ sorted_initials << $pairs_conf['delimiters']['initials'] #" "
46
46
  end
47
47
  end
48
48
  #puts"sorted authors: #{sorted_authors}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-pairing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Quince
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-04 00:00:00.000000000 Z
11
+ date: 2013-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print