git_tracker 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -0
- data/README.md +1 -1
- data/lib/git_tracker/branch.rb +5 -0
- data/lib/git_tracker/version.rb +1 -1
- data/spec/git_tracker/branch_spec.rb +11 -2
- metadata +12 -12
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# GitTracker
|
1
|
+
# GitTracker [![Build Status](https://secure.travis-ci.org/highgroove/git_tracker.png)](http://travis-ci.org/highgroove/git_tracker)
|
2
2
|
|
3
3
|
*GitTracker*, or *git-tracker*, is a Git hook that will scan your current
|
4
4
|
branch name looking for something it recognizes as a [Pivotal Tracker][pt]
|
data/lib/git_tracker/branch.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'English'
|
2
|
+
|
1
3
|
module GitTracker
|
2
4
|
module Branch
|
3
5
|
def self.story_number
|
@@ -6,6 +8,9 @@ module GitTracker
|
|
6
8
|
|
7
9
|
def self.current
|
8
10
|
branch_path = `git symbolic-ref HEAD`
|
11
|
+
|
12
|
+
abort unless $CHILD_STATUS.exitstatus == 0
|
13
|
+
|
9
14
|
branch_path[%r{refs/heads/(?<name>.+)}, :name] || ''
|
10
15
|
end
|
11
16
|
end
|
data/lib/git_tracker/version.rb
CHANGED
@@ -3,8 +3,17 @@ require 'git_tracker/branch'
|
|
3
3
|
describe GitTracker::Branch do
|
4
4
|
subject { described_class }
|
5
5
|
|
6
|
-
def stub_branch(ref)
|
7
|
-
subject.stub(
|
6
|
+
def stub_branch(ref, exit_status = 0)
|
7
|
+
subject.stub(:`) { ref }
|
8
|
+
$?.stub(:exitstatus) { exit_status }
|
9
|
+
end
|
10
|
+
|
11
|
+
context 'not in a Git repository' do
|
12
|
+
it 'aborts with non-zero exit status' do
|
13
|
+
stub_branch(nil, 128)
|
14
|
+
|
15
|
+
-> { subject.current }.should raise_error SystemExit
|
16
|
+
end
|
8
17
|
end
|
9
18
|
|
10
19
|
context "Current branch has a story number" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_tracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70233021591920 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.9.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70233021591920
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec-spies
|
27
|
-
requirement: &
|
27
|
+
requirement: &70233021587380 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '2.0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70233021587380
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: pry
|
38
|
-
requirement: &
|
38
|
+
requirement: &70233021586580 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.9.8
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70233021586580
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: activesupport
|
49
|
-
requirement: &
|
49
|
+
requirement: &70233021585440 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '3.2'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70233021585440
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rake
|
60
|
-
requirement: &
|
60
|
+
requirement: &70233021583740 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70233021583740
|
69
69
|
description: ! " Some simple tricks that make working with Pivotal Tracker even\n
|
70
70
|
\ better... and easier... um, besier!\n"
|
71
71
|
email:
|