girc 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/lib/girc.rb +11 -5
  2. data/lib/girc/version.rb +1 -1
  3. metadata +2 -2
@@ -27,13 +27,19 @@ module Girc
27
27
  files
28
28
  end
29
29
 
30
- # return the value of user.name in configuration
31
- def me
30
+ # return config list as a hash
31
+ def config
32
+ h = Hash.new
32
33
  `#{@git} config --list`.split("\n").each do |line|
33
- matches = /user\.name\=(.+)/.match line
34
- return matches[1] if matches
34
+ key, value = line.split("=")
35
+ h[key] = value
35
36
  end
36
- "?"
37
+ h
38
+ end
39
+
40
+ # return the value of user.name in configuration
41
+ def me
42
+ config["user.name"] || "?"
37
43
  end
38
44
 
39
45
  # all branches include remote branches
@@ -1,3 +1,3 @@
1
1
  module Girc
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: girc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-20 00:00:00.000000000 Z
12
+ date: 2013-03-21 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Girc is a ruby console handler for git commands.
15
15
  email: huangw@pe-po.com