git_pivotal_tracker 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -73,7 +73,7 @@ module GitPivotalTracker
|
|
73
73
|
options[key.sub(/-/, '_').to_sym] = repository.config["pivotal.#{key}"]
|
74
74
|
end
|
75
75
|
|
76
|
-
['only-mine', 'include-rejected', 'fast-forward', 'rebase', 'verbose', 'use-ssl'].each do |key|
|
76
|
+
['only-mine', 'include-rejected', 'fast-forward', 'rebase', 'verbose', 'use-ssl', 'interactive'].each do |key|
|
77
77
|
options[key.sub(/-/, '_').to_sym] = repository.config["pivotal.#{key}"] == '1'
|
78
78
|
end
|
79
79
|
|
@@ -95,6 +95,7 @@ module GitPivotalTracker
|
|
95
95
|
opts.on("-S", "--use-ssl", "Use SSL for connection to Pivotal Tracker") { |s| options[:use_ssl] = s }
|
96
96
|
opts.on("-R", "--rebase", "Fetch and rebase the integration branch before merging") { |r| options[:rebase] = r }
|
97
97
|
opts.on("-V", "--verbose", "Verbose command logging") { |v| options[:verbose] = v }
|
98
|
+
opts.on("-X", "--interactive", "Interactive story picking") { |x| options[:interactive] = x }
|
98
99
|
opts.on_tail("-h", "--help", "This usage guide") { put opts.to_s; exit 0 }
|
99
100
|
end.parse!(args)
|
100
101
|
end
|
@@ -5,8 +5,19 @@ module GitPivotalTracker
|
|
5
5
|
return 1 if super
|
6
6
|
|
7
7
|
puts "Retrieving latest #{type} from Pivotal Tracker"
|
8
|
+
story = nil
|
9
|
+
if options[:interactive]
|
10
|
+
stories = fetch_stories(10)
|
11
|
+
stories.each_with_index do |s, i|
|
12
|
+
puts "#{i}) #{s.story_type} #{s.id} #{s.name}"
|
13
|
+
end
|
14
|
+
print "Pick a story: "
|
15
|
+
story = stories[gets.chomp.to_i]
|
16
|
+
else
|
17
|
+
story = fetch_stories.first
|
18
|
+
end
|
8
19
|
|
9
|
-
unless story
|
20
|
+
unless story
|
10
21
|
puts "No #{type} available!"
|
11
22
|
return 1
|
12
23
|
end
|
@@ -41,12 +52,12 @@ module GitPivotalTracker
|
|
41
52
|
|
42
53
|
private
|
43
54
|
|
44
|
-
def
|
55
|
+
def fetch_stories(count = 1)
|
45
56
|
state = options[:include_rejected] ? "unstarted,rejected" : "unstarted"
|
46
|
-
conditions = { :current_state => state, :limit =>
|
57
|
+
conditions = { :current_state => state, :limit => count }
|
47
58
|
conditions[:story_type] = type == 'story' ? 'bug,chore,feature' : type
|
48
59
|
conditions[:owned_by] = "\"#{options[:full_name]}\"" if options[:only_mine]
|
49
|
-
project.stories.all(conditions)
|
60
|
+
project.stories.all(conditions)
|
50
61
|
end
|
51
62
|
|
52
63
|
def branch_suffix(story)
|
@@ -17,7 +17,7 @@ describe GitPivotalTracker::Base do
|
|
17
17
|
subject.options[:full_name].should be_nil
|
18
18
|
end
|
19
19
|
|
20
|
-
[:fast_forward, :rebase, :verbose, :use_ssl, :include_rejected, :only_mine].each do |key|
|
20
|
+
[:fast_forward, :rebase, :verbose, :use_ssl, :include_rejected, :only_mine, :interactive].each do |key|
|
21
21
|
it "does not set #{key}" do
|
22
22
|
subject.options[key].should_not be
|
23
23
|
end
|
@@ -73,6 +73,11 @@ describe GitPivotalTracker::Base do
|
|
73
73
|
GitPivotalTracker::Base.new("--verbose").options[:verbose].should be
|
74
74
|
GitPivotalTracker::Base.new("-V").options[:verbose].should be
|
75
75
|
end
|
76
|
+
|
77
|
+
it "sets interactive" do
|
78
|
+
GitPivotalTracker::Base.new("--interactive").options[:interactive].should be
|
79
|
+
GitPivotalTracker::Base.new("-X").options[:interactive].should be
|
80
|
+
end
|
76
81
|
end
|
77
82
|
|
78
83
|
describe "#parse_gitconfig" do
|
@@ -97,7 +102,8 @@ describe GitPivotalTracker::Base do
|
|
97
102
|
'pivotal.fast-forward' => '1',
|
98
103
|
'pivotal.rebase' => '1',
|
99
104
|
'pivotal.verbose' => '1',
|
100
|
-
'pivotal.use-ssl' => '1'
|
105
|
+
'pivotal.use-ssl' => '1',
|
106
|
+
'pivotal.interactive' => '1'
|
101
107
|
})
|
102
108
|
subject = GitPivotalTracker::Base.new
|
103
109
|
end
|
@@ -114,7 +120,7 @@ describe GitPivotalTracker::Base do
|
|
114
120
|
subject.options[:project_id].should == '123'
|
115
121
|
end
|
116
122
|
|
117
|
-
[:only_mine, :include_rejected, :fast_forward, :rebase, :verbose, :use_ssl].each do |key|
|
123
|
+
[:only_mine, :include_rejected, :fast_forward, :rebase, :verbose, :use_ssl, :interactive].each do |key|
|
118
124
|
it "sets #{key}" do
|
119
125
|
subject.options[key].should be
|
120
126
|
end
|
@@ -133,12 +139,13 @@ describe GitPivotalTracker::Base do
|
|
133
139
|
'pivotal.fast-forward' => '0',
|
134
140
|
'pivotal.rebase' => '0',
|
135
141
|
'pivotal.verbose' => '0',
|
136
|
-
'pivotal.use-ssl' => '0'
|
142
|
+
'pivotal.use-ssl' => '0',
|
143
|
+
'pivotal.interactive' => '0'
|
137
144
|
})
|
138
145
|
subject = GitPivotalTracker::Base.new
|
139
146
|
end
|
140
147
|
|
141
|
-
[:only_mine, :include_rejected, :fast_forward, :rebase, :verbose, :use_ssl].each do |key|
|
148
|
+
[:only_mine, :include_rejected, :fast_forward, :rebase, :verbose, :use_ssl, :interactive].each do |key|
|
142
149
|
it "does not set #{key}" do
|
143
150
|
subject.options[key].should_not be
|
144
151
|
end
|
@@ -3,6 +3,7 @@ require File.join(File.dirname(__FILE__), '..', 'spec_helper')
|
|
3
3
|
describe GitPivotalTracker::Finish do
|
4
4
|
|
5
5
|
before do
|
6
|
+
File.delete( "test.txt" ) if File.exists?( "test.txt" )
|
6
7
|
stub_request(:get, 'http://www.pivotaltracker.com/services/v3/projects/123').
|
7
8
|
to_return :body => File.read("#{FIXTURES_PATH}/project.xml")
|
8
9
|
stub_request(:get, 'http://www.pivotaltracker.com/services/v3/projects/123/stories/1234567890').
|
@@ -55,7 +56,7 @@ describe GitPivotalTracker::Finish do
|
|
55
56
|
finish.run!.should == 0
|
56
57
|
@repo.head.name.should == @current_head.name
|
57
58
|
@repo.commits.first.parents.should have(2).items
|
58
|
-
@repo.
|
59
|
+
@repo.commits( @current_head.name ).first.sha.should == @sha
|
59
60
|
end
|
60
61
|
|
61
62
|
context "when I have rebase turned on" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_pivotal_tracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
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: 2011-12-
|
12
|
+
date: 2011-12-07 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70146443531320 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70146443531320
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: webmock
|
27
|
-
requirement: &
|
27
|
+
requirement: &70146443530860 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70146443530860
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: aruba
|
38
|
-
requirement: &
|
38
|
+
requirement: &70146443530440 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70146443530440
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: grit
|
49
|
-
requirement: &
|
49
|
+
requirement: &70146443526940 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70146443526940
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: pivotal-tracker
|
60
|
-
requirement: &
|
60
|
+
requirement: &70146443526520 !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: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70146443526520
|
69
69
|
description: provides a set of git workflow tools to start and finish Pivotal Tracker
|
70
70
|
stories in topic branches
|
71
71
|
email:
|