asgit 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asgit.rb +6 -1
- data/lib/asgit/shell.rb +4 -0
- data/lib/asgit/version.rb +1 -1
- data/spec/lib/asgit_spec.rb +8 -0
- data/spec/spec_helper.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ba3c996620f26094488b2507cc1d94df2edbf94
|
4
|
+
data.tar.gz: 357424569a2b1e7bcb09de04a5a94f469f18f9b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38dce181807b2049a1a4672878bca8ea25179af52b53717fd9be59b66696410dd5a6ae1cd4ec93663ef75f1caaa4c2b80de50491dc1ddd66e5bebab9638e7da5
|
7
|
+
data.tar.gz: 3f7471bf3fba8d3e704520fbd70ad075e7c0422fc6a1dddeca1f6ba98c33626d1571c5b47a69af17587f460daa5176acf48c7af65507224d32b81990a274d124
|
data/lib/asgit.rb
CHANGED
@@ -15,7 +15,12 @@ module Asgit
|
|
15
15
|
# Get current git branch based on exec directory
|
16
16
|
# @return [String] the current checked out branch
|
17
17
|
def current_branch
|
18
|
-
Shell.run( "git symbolic-ref HEAD --short" )
|
18
|
+
resp = Shell.run( "git symbolic-ref HEAD --short" )
|
19
|
+
if !resp.stdout.strip.empty? || resp.success?
|
20
|
+
return resp.stdout.strip
|
21
|
+
else
|
22
|
+
raise Shell::ResponseError, resp.stderr
|
23
|
+
end
|
19
24
|
end
|
20
25
|
|
21
26
|
# Get current git commit based on exec directory
|
data/lib/asgit/shell.rb
CHANGED
data/lib/asgit/version.rb
CHANGED
data/spec/lib/asgit_spec.rb
CHANGED
@@ -18,6 +18,14 @@ describe Asgit do
|
|
18
18
|
stub_shell 'git symbolic-ref HEAD --short', stdout: "master\n"
|
19
19
|
expect( Asgit.current_branch ).to eq "master"
|
20
20
|
end
|
21
|
+
|
22
|
+
it "raises exception on error response" do
|
23
|
+
stub_shell 'git symbolic-ref HEAD --short', stderr: "so much fails\n", stdout: '', status: false
|
24
|
+
|
25
|
+
expect{
|
26
|
+
Asgit.current_branch
|
27
|
+
}.to raise_error Asgit::Shell::ResponseError
|
28
|
+
end
|
21
29
|
end
|
22
30
|
|
23
31
|
describe "::current_commit" do
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,30 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asgit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Sloan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: here_or_there
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.1'
|
27
|
-
description:
|
27
|
+
description: " A simple query interface for git. "
|
28
28
|
email:
|
29
29
|
- stevenosloan@gmail.com
|
30
30
|
executables: []
|
@@ -58,17 +58,17 @@ require_paths:
|
|
58
58
|
- lib
|
59
59
|
required_ruby_version: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- -
|
61
|
+
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: '0'
|
64
64
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
requirements: []
|
70
70
|
rubyforge_project:
|
71
|
-
rubygems_version: 2.4.5
|
71
|
+
rubygems_version: 2.4.5.1
|
72
72
|
signing_key:
|
73
73
|
specification_version: 4
|
74
74
|
summary: A simple query interface for git
|