git_flow_pivotal 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # GitFlowPivotal
2
2
 
3
- TODO: Write a gem description
3
+ This gem adds a rake task that allows you to streamline your workflow if you use pivotal tracker and git-flow.
4
4
 
5
5
  ## Installation
6
6
 
@@ -16,9 +16,32 @@ Or install it yourself as:
16
16
 
17
17
  $ gem install git_flow_pivotal
18
18
 
19
+ You will need to export a few variables to hook up to tracker
20
+
21
+ git config --global pivotal.fullname
22
+ git config --global pivotal.api-token your_token
23
+
24
+ Your full name must match your name in tracker.
25
+ If you do not already have an API token you can generate one by clicking your name and going to preferences.
26
+
27
+ Run the following command and select the corrent project to complete setup.
28
+
29
+ rake pt:setup
30
+
31
+ Alternatively you can set the projectid manually:
32
+
33
+ git config pivotal.projectid tracker_project_id
34
+
19
35
  ## Usage
20
36
 
21
- TODO: Write usage instructions here
37
+ The following tasks are available:
38
+
39
+ pt:list - Lists all unstarted and rejected stories assigned to you and asks which you want to start. Starting a story will update it in tracker and does "git flow feature start first_five_words_of_story_STORYID"
40
+ pt:finish - Finishes current story in tracker and does "git flow feature finish branchname"
41
+ pt:comment text="Yo story whack" - Adds a comment to the current story
42
+ pt:web - Browses to current story in browser
43
+
44
+ The latter 3 require branch names consistent with what pt:list does to work properly.
22
45
 
23
46
  ## Contributing
24
47
 
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
10
10
  gem.email = ["yakov.rabinovich@gmail.com"]
11
11
  gem.description = %q{This is a gem to help create a fast workflow with git-flow and pivotal tracker.%}
12
12
  gem.summary = %q{How is a summary different from a description?}
13
- gem.homepage = ""
13
+ gem.homepage = "https://github.com/fullscreeninc/git_flow_pivotal"
14
14
 
15
15
  gem.files = `git ls-files`.split($/)
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -1,3 +1,3 @@
1
1
  module GitFlowPivotal
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -25,12 +25,17 @@ namespace :pt do
25
25
 
26
26
  end
27
27
 
28
- def get_project
28
+ def setup_tracker
29
29
  token = `git config --get pivotal.token`
30
- projectid = `git config --get pivotal.projectid`
31
30
 
32
31
  PivotalTracker::Client.token = token
33
32
  PivotalTracker::Client.use_ssl = true
33
+ end
34
+
35
+ def get_project
36
+ setup_tracker
37
+
38
+ projectid = `git config --get pivotal.projectid`
34
39
  PivotalTracker::Project.find projectid
35
40
  end
36
41
 
@@ -50,6 +55,27 @@ namespace :pt do
50
55
  current_branch.split('_').last.strip
51
56
  end
52
57
 
58
+ desc "Hook up the correct tracker project"
59
+ task :setup do
60
+ setup_tracker
61
+ projects = PivotalTracker::Project.all
62
+
63
+ if project.count > 0
64
+ project_hash = {}
65
+ projects.each_with_index do |project, index|
66
+ project_hash[index+1] = project.id
67
+ puts "#{index + 1}. #{project.name}"
68
+ end
69
+
70
+ input = STDIN.gets.strip
71
+ selected = input.split(",")[0].to_i
72
+ `git config pivotal.projectid #{project_hash[selected]}`
73
+ puts "Setup complete"
74
+ else
75
+ puts "You do not have any projects."
76
+ end
77
+ end
78
+
53
79
  desc "list available pivotal tracker tix assigned to me from which to create a git branch"
54
80
  task :list do
55
81
  project = get_project
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_flow_pivotal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -45,7 +45,7 @@ files:
45
45
  - lib/git_flow_pivotal/railtie.rb
46
46
  - lib/git_flow_pivotal/version.rb
47
47
  - lib/tasks/git_flow_pivotal.rake
48
- homepage: ''
48
+ homepage: https://github.com/fullscreeninc/git_flow_pivotal
49
49
  licenses: []
50
50
  post_install_message:
51
51
  rdoc_options: []