pivotal_hub 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/pivotal-start +24 -10
- data/lib/Story.rb +7 -1
- data/lib/pivotal_hub/version.rb +1 -1
- data/pivotal_hub-0.0.1.gem +0 -0
- metadata +1 -1
data/bin/pivotal-start
CHANGED
@@ -6,23 +6,37 @@ story = Pivotal_Hub::Story.new
|
|
6
6
|
|
7
7
|
if story.nil?
|
8
8
|
puts "Enter a git directory and try again!"
|
9
|
+
exit
|
9
10
|
end
|
10
11
|
|
11
12
|
current_branch = story.get_current_branch
|
12
|
-
|
13
|
+
|
14
|
+
start_with_letter = /^[aA-zZ]/
|
15
|
+
result = start_with_letter =~ current_branch
|
16
|
+
|
13
17
|
if result != nil
|
14
|
-
puts "Sorry, but you are not in a ticket branch. Lets stop procastinating and finally open a ticket
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
puts "Sorry, but you are not in a ticket branch. Lets stop procastinating and finally open a ticket"
|
19
|
+
|
20
|
+
backlog_stories = story.get_backlog_stories
|
21
|
+
|
22
|
+
backlog_stories.each_with_index do |story, index|
|
23
|
+
puts "#{index} - #{story.name}"
|
24
|
+
end
|
25
|
+
|
26
|
+
puts "which ticket do you want start?"
|
27
|
+
index_ticket_typed = gets.chomp
|
28
|
+
|
29
|
+
story_choiced = backlog_stories.at(Integer(index_ticket_typed))
|
30
|
+
story.update_state(story_choiced.id,"started")
|
31
|
+
puts "ticket started, lets code!"
|
32
|
+
exit
|
22
33
|
end
|
23
34
|
|
24
35
|
ticket_number = current_branch.sub /\_.*$/,''
|
25
36
|
|
26
37
|
sto = story.update_state(ticket_number,"started")
|
27
38
|
puts "Ticket Name: #{sto.name}"
|
28
|
-
puts "ticket started, lets code!"
|
39
|
+
puts "ticket started, lets code!"
|
40
|
+
|
41
|
+
|
42
|
+
|
data/lib/Story.rb
CHANGED
@@ -9,7 +9,8 @@ module Pivotal_Hub
|
|
9
9
|
if File.exists?('.git')
|
10
10
|
@git = Git.open(Dir.pwd)
|
11
11
|
@client = TrackerApi::Client.new(token: @git.config('pivotal.api-token'))
|
12
|
-
@project = client.project(@git.config('pivotal.project-id'))
|
12
|
+
@project = @client.project(@git.config('pivotal.project-id'))
|
13
|
+
@label = @git.config('pivotal.sprint-label')
|
13
14
|
else
|
14
15
|
puts "Ops, you are not in git directory!"
|
15
16
|
exit
|
@@ -19,6 +20,7 @@ module Pivotal_Hub
|
|
19
20
|
def update_state story_id, state
|
20
21
|
story = @project.story(story_id)
|
21
22
|
story.current_state = state
|
23
|
+
story.owner_ids = [@client.me.id]
|
22
24
|
story.save
|
23
25
|
story
|
24
26
|
end
|
@@ -27,6 +29,10 @@ module Pivotal_Hub
|
|
27
29
|
@git.current_branch
|
28
30
|
end
|
29
31
|
|
32
|
+
def get_backlog_stories
|
33
|
+
@project.stories(with_state: :unstarted, with_label:@label, limit: 10)
|
34
|
+
end
|
35
|
+
|
30
36
|
end
|
31
37
|
end
|
32
38
|
|
data/lib/pivotal_hub/version.rb
CHANGED
Binary file
|