dev_commands 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/commit.rb +10 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c08fc6ed7b442bb74a84d2792336718a0a927ff
|
4
|
+
data.tar.gz: ad1b738ef603f275b5833bb4162a128340bed20a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e51e506cc87a5c39e00cea94458056927fe6ee116de117033e89cc91afad5af844815d97fac873f4a2cd32c6042ec1fd8de69d88950893100c23b5b2363c2f5e
|
7
|
+
data.tar.gz: 97b257eb8ba5d9b3958bd4beea79d63520c52262a09bca90f30572273be00f117033e40a12e58e753f849dd9c70c1dd417eaf2fd56a11b56e20d99490c1c5986
|
data/lib/commit.rb
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
class Commit < Array
|
2
2
|
def update
|
3
|
-
if(File.exists?('.git'))
|
4
|
-
|
3
|
+
if(File.exists?('.git') && `git config --list`.include?('user.name='))
|
4
|
+
if(!`git status`.include?('nothing to commit') &&
|
5
|
+
!`git status`.include?('untracked files present'))
|
6
|
+
if(File.exists?('commit.message') && File.read('commit.message').gsub(/\s+/,"").length >0)
|
7
|
+
add "git commit -a -v -m \"#{File.read('commit.message')}\""
|
8
|
+
else
|
9
|
+
add "git commit -m'all'"
|
10
|
+
end
|
11
|
+
add "<%FileUtils.rm('commit.message')%>" if File.exists?('commit.message')
|
12
|
+
end
|
5
13
|
end
|
6
14
|
end
|
7
15
|
end
|