pivo_flow 0.4.5.2 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +1 -1
- data/lib/pivo_flow/cli.rb +12 -2
- data/lib/pivo_flow/pivotal.rb +7 -3
- data/lib/pivo_flow/version.rb +1 -1
- data/spec/pivo_flow/pivotal_spec.rb +14 -4
- metadata +26 -51
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: de5ccffe41c5da1308530d353e02f4c1b632e5d8
|
4
|
+
data.tar.gz: 92b4cf76006efebe3559048a45d959111648ecc6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 29cee9f22ced5aec0c41275c73d27d559bf0d9ca3387c1315cb904652fefe6a67771733d6c3aeec47632e01a5c9aeefa99b8f554ab4768b18aef6cb1907c15fb
|
7
|
+
data.tar.gz: e085ab0fb14a94fbe3117786702b3c4a1db08567d03695d20d66172fa18716d87a20a75ec05671a38d55eca455d1bba69c819ee437927966e497580a37e85f96
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
[![Code Climate](https://codeclimate.com/github/lubieniebieski/pivo_flow.png)](https://codeclimate.com/github/lubieniebieski/pivo_flow)
|
4
4
|
[![Build Status](https://secure.travis-ci.org/lubieniebieski/pivo_flow.png?branch=master)](http://travis-ci.org/lubieniebieski/pivo_flow)
|
5
5
|
|
6
|
-
PivoFlow
|
6
|
+
PivoFlow lets you choose the story you are currently working on from Pivotal Tracker. Intended for all the people, who doesn't like feature-branch approach or are "merdżuj - nie pier*ol"-theory enthusiasts.
|
7
7
|
|
8
8
|
## Installation
|
9
9
|
|
data/lib/pivo_flow/cli.rb
CHANGED
@@ -27,6 +27,15 @@ module PivoFlow
|
|
27
27
|
pivotal_object.show_stories
|
28
28
|
end
|
29
29
|
|
30
|
+
def set story_id=nil
|
31
|
+
unless story_id
|
32
|
+
puts "Ok, but which story?"
|
33
|
+
return 1
|
34
|
+
end
|
35
|
+
pivotal_object.save_story_id_to_file story_id
|
36
|
+
puts "Story ##{story_id} set as current"
|
37
|
+
end
|
38
|
+
|
30
39
|
def start story_id=nil
|
31
40
|
unless story_id
|
32
41
|
puts "Ok, but which story?"
|
@@ -109,7 +118,8 @@ module PivoFlow
|
|
109
118
|
opts.separator " finish [STORY_ID] finish story on Pivotal"
|
110
119
|
opts.separator " info show info about current story"
|
111
120
|
opts.separator " reconfig clear API_TOKEN and PROJECT_ID from git config and setup new values"
|
112
|
-
opts.separator " start <STORY_ID> start a story of given ID"
|
121
|
+
opts.separator " start <STORY_ID> start a story of given ID (update in Pivotal)"
|
122
|
+
opts.separator " set <STORY_ID> set a story of given ID locally (do not update Pivotal)"
|
113
123
|
opts.separator " stories list stories for current project"
|
114
124
|
opts.separator " version show gem version"
|
115
125
|
opts.separator ""
|
@@ -138,7 +148,7 @@ module PivoFlow
|
|
138
148
|
opt_parser.parse!(args)
|
139
149
|
|
140
150
|
case args[0]
|
141
|
-
when "start", "finish"
|
151
|
+
when "start", "finish", "set"
|
142
152
|
self.send(args[0].to_sym, args[1])
|
143
153
|
when "help"
|
144
154
|
puts opt_parser
|
data/lib/pivo_flow/pivotal.rb
CHANGED
@@ -8,15 +8,17 @@ module PivoFlow
|
|
8
8
|
|
9
9
|
PivotalTracker::Client.token = @options["api-token"]
|
10
10
|
PivotalTracker::Client.use_ssl = true
|
11
|
+
end
|
11
12
|
|
13
|
+
def ensure_project(&block)
|
12
14
|
begin
|
13
15
|
@options[:project] ||= PivotalTracker::Project.find(@options["project-id"])
|
16
|
+
block.call
|
14
17
|
rescue Exception => e
|
15
18
|
message = "Pivotal Tracker: #{e.message}\n" +
|
16
19
|
"[TIPS] It means that your configuration is wrong. You can reset your settings by running:\n\tpf reconfig"
|
17
20
|
raise PivoFlow::Errors::UnsuccessfulPivotalConnection, message
|
18
21
|
end
|
19
|
-
|
20
22
|
end
|
21
23
|
|
22
24
|
def user_stories
|
@@ -251,8 +253,10 @@ module PivoFlow
|
|
251
253
|
end
|
252
254
|
|
253
255
|
def fetch_stories(count = 100, state = "unstarted,started,unscheduled,rejected", story_type = "feature,chore,bug")
|
254
|
-
|
255
|
-
|
256
|
+
ensure_project do
|
257
|
+
conditions = { current_state: state, limit: count, story_type: story_type }
|
258
|
+
@options[:stories] = @options[:project].stories.all(conditions)
|
259
|
+
end
|
256
260
|
end
|
257
261
|
|
258
262
|
end
|
data/lib/pivo_flow/version.rb
CHANGED
@@ -13,13 +13,13 @@ describe PivoFlow::Pivotal do
|
|
13
13
|
describe "raises exception" do
|
14
14
|
it "when project id is incorrect" do
|
15
15
|
VCR.use_cassette(:pivotal_fetch_project_not_found) do
|
16
|
-
expect{pivotal.
|
16
|
+
expect{pivotal.fetch_stories}.to raise_error(PivoFlow::Errors::UnsuccessfulPivotalConnection)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
it "when api-token is incorrect (unauthorized)" do
|
21
21
|
VCR.use_cassette(:pivotal_fetch_project_unauthorized) do
|
22
|
-
expect{pivotal.
|
22
|
+
expect{pivotal.fetch_stories}.to raise_error(PivoFlow::Errors::UnsuccessfulPivotalConnection)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -32,8 +32,18 @@ describe PivoFlow::Pivotal do
|
|
32
32
|
pivotal.run
|
33
33
|
end
|
34
34
|
|
35
|
-
it "
|
36
|
-
pivotal.options[:project].
|
35
|
+
it "does not call pivotal upon run" do
|
36
|
+
pivotal.options[:project].should be_nil
|
37
|
+
end
|
38
|
+
|
39
|
+
it "calls pivotal when necessary" do
|
40
|
+
pivotal.should_receive(:ensure_project).once
|
41
|
+
pivotal.fetch_stories
|
42
|
+
end
|
43
|
+
|
44
|
+
it "does not call pivotal twice" do
|
45
|
+
PivotalTracker::Project.should_receive(:find).once
|
46
|
+
2.times { pivotal.fetch_stories }
|
37
47
|
end
|
38
48
|
|
39
49
|
it "user_stories takes only stories owned by current user" do
|
metadata
CHANGED
@@ -1,158 +1,139 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pivo_flow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: '0.5'
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Adam Nowak
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-12-12 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: pivotal-tracker
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: grit
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: highline
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - '>='
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: colorize
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - '>='
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - '>='
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: rspec
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - '>='
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - '>='
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: '0'
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: coveralls
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
|
-
- -
|
87
|
+
- - '>='
|
100
88
|
- !ruby/object:Gem::Version
|
101
89
|
version: '0'
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
|
-
- -
|
94
|
+
- - '>='
|
108
95
|
- !ruby/object:Gem::Version
|
109
96
|
version: '0'
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
98
|
name: rake
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
100
|
requirements:
|
115
|
-
- -
|
101
|
+
- - '>='
|
116
102
|
- !ruby/object:Gem::Version
|
117
103
|
version: '0'
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
107
|
requirements:
|
123
|
-
- -
|
108
|
+
- - '>='
|
124
109
|
- !ruby/object:Gem::Version
|
125
110
|
version: '0'
|
126
111
|
- !ruby/object:Gem::Dependency
|
127
112
|
name: vcr
|
128
113
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
114
|
requirements:
|
131
|
-
- -
|
115
|
+
- - '>='
|
132
116
|
- !ruby/object:Gem::Version
|
133
117
|
version: '0'
|
134
118
|
type: :development
|
135
119
|
prerelease: false
|
136
120
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
121
|
requirements:
|
139
|
-
- -
|
122
|
+
- - '>='
|
140
123
|
- !ruby/object:Gem::Version
|
141
124
|
version: '0'
|
142
125
|
- !ruby/object:Gem::Dependency
|
143
126
|
name: fakeweb
|
144
127
|
requirement: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
128
|
requirements:
|
147
|
-
- -
|
129
|
+
- - '>='
|
148
130
|
- !ruby/object:Gem::Version
|
149
131
|
version: '0'
|
150
132
|
type: :development
|
151
133
|
prerelease: false
|
152
134
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
135
|
requirements:
|
155
|
-
- -
|
136
|
+
- - '>='
|
156
137
|
- !ruby/object:Gem::Version
|
157
138
|
version: '0'
|
158
139
|
description: Automated querying for pivotal stories, adding story id to commit message,
|
@@ -190,33 +171,26 @@ files:
|
|
190
171
|
- spec/spec_helper.rb
|
191
172
|
homepage: https://github.com/lubieniebieski/pivo_flow
|
192
173
|
licenses: []
|
174
|
+
metadata: {}
|
193
175
|
post_install_message:
|
194
176
|
rdoc_options: []
|
195
177
|
require_paths:
|
196
178
|
- lib
|
197
179
|
required_ruby_version: !ruby/object:Gem::Requirement
|
198
|
-
none: false
|
199
180
|
requirements:
|
200
|
-
- -
|
181
|
+
- - '>='
|
201
182
|
- !ruby/object:Gem::Version
|
202
183
|
version: '0'
|
203
|
-
segments:
|
204
|
-
- 0
|
205
|
-
hash: -507342757961463089
|
206
184
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
207
|
-
none: false
|
208
185
|
requirements:
|
209
|
-
- -
|
186
|
+
- - '>='
|
210
187
|
- !ruby/object:Gem::Version
|
211
188
|
version: '0'
|
212
|
-
segments:
|
213
|
-
- 0
|
214
|
-
hash: -507342757961463089
|
215
189
|
requirements: []
|
216
190
|
rubyforge_project:
|
217
|
-
rubygems_version: 1.
|
191
|
+
rubygems_version: 2.1.11
|
218
192
|
signing_key:
|
219
|
-
specification_version:
|
193
|
+
specification_version: 4
|
220
194
|
summary: Simple pivotal tracker integration for day to day work with git
|
221
195
|
test_files:
|
222
196
|
- spec/pivo_flow/base_spec.rb
|
@@ -225,3 +199,4 @@ test_files:
|
|
225
199
|
- spec/pivo_flow/vcr_cassettes/pivotal_fetch_project_not_found.yml
|
226
200
|
- spec/pivo_flow/vcr_cassettes/pivotal_fetch_project_unauthorized.yml
|
227
201
|
- spec/spec_helper.rb
|
202
|
+
has_rdoc:
|