pivotal-git-tracker 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/Gemfile +0 -3
- data/Gemfile.lock +4 -4
- data/README.md +3 -0
- data/lib/pivotal-git-tracker/git.rb +1 -1
- data/lib/pivotal-git-tracker/project.rb +4 -2
- data/lib/pivotal-git-tracker/version.rb +1 -1
- data/spec/git_spec.rb +2 -2
- data/spec/project_spec.rb +11 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04afbbdc0ca515c5ceed6ea612de0588c9a7bfe6
|
4
|
+
data.tar.gz: e022fd448465c950d1aad32d2f826eb0e363b3c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6abf78ac34fe20589a466852b60e3fff274d6a0335ff4b54e442b7f42ede661d2d91d715af4f644efab3c168bfb819ff3a69c50ad0176d265a15a258ca5466fd
|
7
|
+
data.tar.gz: 711fffa457d6721cb5d349d2096467c60c8e1835a69a277be2f3befdf84a2304aa1b91db11eeda5c595921ccadf6f844928cc8cdfcc5570154be7c19166c521a
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
pivotal-git-tracker (0.
|
4
|
+
pivotal-git-tracker (0.2.3)
|
5
5
|
pivotal-tracker (>= 0.5.10)
|
6
6
|
|
7
7
|
GEM
|
@@ -86,10 +86,10 @@ PLATFORMS
|
|
86
86
|
|
87
87
|
DEPENDENCIES
|
88
88
|
guard-rspec
|
89
|
-
happymapper
|
90
|
-
nokogiri
|
91
89
|
pivotal-git-tracker!
|
92
90
|
pivotal-tracker (~> 0.5, >= 0.5.10)
|
93
91
|
rake
|
94
|
-
rest-client
|
95
92
|
rspec
|
93
|
+
|
94
|
+
BUNDLED WITH
|
95
|
+
1.10.6
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ module Tracker
|
|
10
10
|
def latest_log(options = {})
|
11
11
|
branch = options.fetch(:branch, 'HEAD')
|
12
12
|
remote_branch = options[:remote_branch]
|
13
|
-
commits = `git log -n
|
13
|
+
commits = `git log -n 50 #{[remote_branch, branch].compact.join('..')} --grep='#' --oneline`
|
14
14
|
commits.scan(/#([0-9]{9})/).flatten
|
15
15
|
end
|
16
16
|
end
|
@@ -35,8 +35,10 @@ module Tracker
|
|
35
35
|
|
36
36
|
def add_label(story, label)
|
37
37
|
labels = (story.labels || '').split(',')
|
38
|
-
labels
|
39
|
-
|
38
|
+
unless labels.any?{|label| label =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/}
|
39
|
+
labels << label
|
40
|
+
story.update(labels: labels.join(','))
|
41
|
+
end
|
40
42
|
end
|
41
43
|
|
42
44
|
def comment(story, server_name)
|
data/spec/git_spec.rb
CHANGED
@@ -10,11 +10,11 @@ describe Tracker::Git do
|
|
10
10
|
|
11
11
|
context 'from history' do
|
12
12
|
before do
|
13
|
-
expect(git).to receive(:`).with("git log -n
|
13
|
+
expect(git).to receive(:`).with("git log -n 50 HEAD --grep='#' --oneline") { '#123456789 #987654321' }
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'gets latest x logs' do
|
17
|
-
expect(git.latest_log).to eq(['
|
17
|
+
expect(git.latest_log).to eq(['123456789', '987654321'])
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
data/spec/project_spec.rb
CHANGED
@@ -60,6 +60,11 @@ describe Tracker::Project do
|
|
60
60
|
expect(story).to receive(:update).with(labels: 'foo,label')
|
61
61
|
project.add_label(story, 'label')
|
62
62
|
end
|
63
|
+
it 'doesnt add a second version label' do
|
64
|
+
expect(story).to receive(:labels) { 'v1.0.1' }
|
65
|
+
expect(story).not_to receive(:update)
|
66
|
+
project.add_label(story, 'v1.0.2')
|
67
|
+
end
|
63
68
|
end
|
64
69
|
|
65
70
|
context 'there is already two labels on the story' do
|
@@ -77,10 +82,14 @@ describe Tracker::Project do
|
|
77
82
|
let(:notes_stub) { double }
|
78
83
|
let(:server_name) {'spot instance' }
|
79
84
|
|
80
|
-
before { allow(notes_stub).to receive(:create).with( hash_including(:text => "Delivered by script to #{server_name}")) }
|
81
|
-
before { expect(story).to receive(:notes) { notes_stub } }
|
82
85
|
|
83
86
|
it 'comment story with server' do
|
87
|
+
expect(story).to receive(:notes) { notes_stub }
|
88
|
+
expect(notes_stub).to receive(:all) { [] }
|
89
|
+
|
90
|
+
expect(story).to receive(:notes) { notes_stub }
|
91
|
+
allow(notes_stub).to receive(:create).with( hash_including(:text => "Delivered by script to #{server_name}"))
|
92
|
+
|
84
93
|
project.comment story, server_name
|
85
94
|
end
|
86
95
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pivotal-git-tracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcel Panse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pivotal-tracker
|
@@ -77,6 +77,7 @@ files:
|
|
77
77
|
- ".gitignore"
|
78
78
|
- ".rakeTasks"
|
79
79
|
- ".rspec"
|
80
|
+
- ".travis.yml"
|
80
81
|
- Gemfile
|
81
82
|
- Gemfile.lock
|
82
83
|
- Guardfile
|