pivo_flow 0.4.0 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -0
- data/lib/pivo_flow/base.rb +1 -0
- data/lib/pivo_flow/pivotal.rb +7 -6
- data/lib/pivo_flow/version.rb +1 -1
- data/spec/pivo_flow/pivotal_spec.rb +2 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -16,6 +16,9 @@ All the required information is gathered on demand, but it's a good idea to prep
|
|
16
16
|
|
17
17
|
* project's Pivotal Tracker ID
|
18
18
|
* your Pivotal Tracker API token
|
19
|
+
* when project's ID is strictly connected with one project, API-token is for all the projects, so the best solution would be to add it globally to git config:
|
20
|
+
|
21
|
+
`git config --global pivo-flow.pivotal-token YOUR_PIVOTAL_API_TOKEN`
|
19
22
|
|
20
23
|
Show help
|
21
24
|
|
data/lib/pivo_flow/base.rb
CHANGED
@@ -52,6 +52,7 @@ module PivoFlow
|
|
52
52
|
def install_git_hook
|
53
53
|
puts "Installing prepare-commit-msg hook..."
|
54
54
|
hook_path = File.join(File.dirname(__FILE__), '..', '..', 'bin', @pf_git_hook_name)
|
55
|
+
FileUtils.mkdir_p(File.dirname(@pf_git_hook_path))
|
55
56
|
FileUtils.cp(hook_path, @pf_git_hook_path, preserve: true)
|
56
57
|
puts "File copied..."
|
57
58
|
unless File.exists?(@git_hook_path) && File.read(@git_hook_path).match(@pf_git_hook_cmd)
|
data/lib/pivo_flow/pivotal.rb
CHANGED
@@ -36,7 +36,7 @@ module PivoFlow
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def finished_stories
|
39
|
-
fetch_stories(10, "finished")
|
39
|
+
fetch_stories(10, "finished").select{ |story| story.owned_by == user_name }
|
40
40
|
end
|
41
41
|
|
42
42
|
def current_story force = false
|
@@ -47,24 +47,25 @@ module PivoFlow
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
def list_stories_to_output stories
|
50
|
+
def list_stories_to_output stories, activity="start"
|
51
51
|
if (stories.nil? || stories.empty?)
|
52
52
|
puts "No stories to show"
|
53
53
|
return 1
|
54
54
|
end
|
55
55
|
|
56
56
|
HighLine.new.choose do |menu|
|
57
|
-
menu.header = "\n--- STORIES FROM PIVOTAL TRACKER ---\nWhich one would you like to
|
57
|
+
menu.header = "\n--- STORIES FROM PIVOTAL TRACKER ---\nWhich one would you like to #{activity}? "
|
58
58
|
menu.prompt = "story no.? "
|
59
59
|
menu.select_by = :index
|
60
60
|
stories.each do |story|
|
61
61
|
menu.choice(story_string(story)) { |answer| show_story(answer.match(/\[#(?<id>\d+)\]/)[:id])}
|
62
62
|
end
|
63
|
+
menu.choice("Show all") { show_stories(100) }
|
63
64
|
end
|
64
65
|
end
|
65
66
|
|
66
67
|
def deliver
|
67
|
-
list_stories_to_output finished_stories
|
68
|
+
list_stories_to_output finished_stories, "deliver"
|
68
69
|
end
|
69
70
|
|
70
71
|
def show_story story_id
|
@@ -247,9 +248,9 @@ module PivoFlow
|
|
247
248
|
File.open(@story_id_file_path, 'w') { |f| f.write(story_id) }
|
248
249
|
end
|
249
250
|
|
250
|
-
def show_stories
|
251
|
+
def show_stories count=9
|
251
252
|
stories = user_stories + other_users_stories
|
252
|
-
list_stories_to_output stories.first(
|
253
|
+
list_stories_to_output stories.first(count)
|
253
254
|
end
|
254
255
|
|
255
256
|
def fetch_stories(count = 100, state = "unstarted,started,unscheduled,rejected", story_type = "feature,chore,bug")
|
data/lib/pivo_flow/version.rb
CHANGED
@@ -63,8 +63,9 @@ describe PivoFlow::Pivotal do
|
|
63
63
|
describe "deliver" do
|
64
64
|
|
65
65
|
it "list only the stories with 'finished' status" do
|
66
|
+
pivotal.should_receive(:user_name).and_return(@story_finished.owned_by)
|
66
67
|
@project.stub_chain(:stories, :all).and_return([@story_finished])
|
67
|
-
pivotal.should_receive(:list_stories_to_output).with([@story_finished])
|
68
|
+
pivotal.should_receive(:list_stories_to_output).with([@story_finished], "deliver")
|
68
69
|
pivotal.deliver
|
69
70
|
end
|
70
71
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pivo_flow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-09-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pivotal-tracker
|