gas 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/gas/gitconfig.rb CHANGED
@@ -7,7 +7,7 @@ module Gas
7
7
  @gitconfig_file = File.expand_path('~/.gitconfig')
8
8
  @gitconfig = ''
9
9
 
10
- if gitconfig.nil?
10
+ if gitconfig.nil? && File.exists? @gitconfig_file
11
11
  @gitconfig = File.read(@gitconfig_file)
12
12
  else
13
13
  @gitconfig = gitconfig
@@ -29,8 +29,8 @@ module Gas
29
29
  # @param [String] name The new name
30
30
  # @param [String] email The new email
31
31
  def change_user(name, email)
32
- @gitconfig.gsub! /name\s?=\s?.+/, "name = #{name}"
33
- @gitconfig.gsub! /email\s?=\s?.+/, "email = #{email}"
32
+ @gitconfig.gsub! /^\s*name\s?=\s?.+/, " name = #{name}"
33
+ @gitconfig.gsub! /^\s*email\s?=\s?.+/, " email = #{email}"
34
34
  end
35
35
 
36
36
  # Saves the gitconfig
data/lib/gas/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Gas
2
2
 
3
- VERSION = '0.1.2'
3
+ VERSION = '0.1.3'
4
4
 
5
5
  end
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor
17
- requirement: &12157820 !ruby/object:Gem::Requirement
17
+ requirement: &10984240 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 0.14.6
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *12157820
25
+ version_requirements: *10984240
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rspec
28
- requirement: &12194240 !ruby/object:Gem::Requirement
28
+ requirement: &10983820 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *12194240
36
+ version_requirements: *10983820
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: bundler
39
- requirement: &12193780 !ruby/object:Gem::Requirement
39
+ requirement: &10983360 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,7 +44,7 @@ dependencies:
44
44
  version: '0'
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *12193780
47
+ version_requirements: *10983360
48
48
  description: Gas is a utility to keep track of your git authors. Add them to gas and
49
49
  switch at any time. Great if you use one author at work and one at home for instance.
50
50
  email: fredrik.wallgren@gmail.com