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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 01d4bc8b6fcd92dd763ef3636193814bc43f9e94
4
- data.tar.gz: 17854f76b472eaaf82e054ab9bdc4d9def5e1970
3
+ metadata.gz: 6ba3c996620f26094488b2507cc1d94df2edbf94
4
+ data.tar.gz: 357424569a2b1e7bcb09de04a5a94f469f18f9b1
5
5
  SHA512:
6
- metadata.gz: 1daa1878102ef11b1124f089d8cfa7b977d3030c6b878358123857fde7d0e6bc50e2e9c878f929f50ad982da609b2b62ba43198aecd1879685402f03d2216b25
7
- data.tar.gz: 48a3795503735215a0836714c47b06e45fbeaad3748aa380449105279f69cdfaefe286eef74f021d3eec7ca43031de9bc6737ad19c442662658f44c72caa7189
6
+ metadata.gz: 38dce181807b2049a1a4672878bca8ea25179af52b53717fd9be59b66696410dd5a6ae1cd4ec93663ef75f1caaa4c2b80de50491dc1ddd66e5bebab9638e7da5
7
+ data.tar.gz: 3f7471bf3fba8d3e704520fbd70ad075e7c0422fc6a1dddeca1f6ba98c33626d1571c5b47a69af17587f460daa5176acf48c7af65507224d32b81990a274d124
@@ -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" ).stdout.strip
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
@@ -9,5 +9,9 @@ module Asgit
9
9
  end
10
10
 
11
11
  end
12
+
13
+ class ResponseError < StandardError
14
+ end
15
+
12
16
  end
13
17
  end
@@ -1,3 +1,3 @@
1
1
  module Asgit
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -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
@@ -1,5 +1,5 @@
1
1
  require 'rspec'
2
- require 'pry-debugger'
2
+ require 'pry-byebug'
3
3
 
4
4
  require 'asgit'
5
5
 
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.3.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-04-15 00:00:00.000000000 Z
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: ' A simple query interface for git. '
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