tracker-git 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73a17722e09a98741a2b270a4c3cb222a6b7ea02
4
- data.tar.gz: 85e5c5168e6002be4cc8f486918d101bd7561eb1
3
+ metadata.gz: b0159ecbcf1438499f08844bc763b007dc2fed85
4
+ data.tar.gz: c592e5b85653233b00d023e35c7a73db7ebda898
5
5
  SHA512:
6
- metadata.gz: 83d79a0250ade8e2fb51c72b449b214a19219edacdcfe55fa7b8c56d2ccee4beda374acebd4ce57ab424eb6af40e0809b6d9068456fe4bac80687d5ffcffe080
7
- data.tar.gz: e739c358d8a5fcf378cbb7191ee01965a64415a8792981b25aab3898f8632e8411f9a416f3af76883f059edda2d4ef65d3dd083825b3e49bddeb421233e2f692
6
+ metadata.gz: b90e9a2f44674f9220a32040a58d1131a612587071e20c82fc7fc450daefae15b201d7a77962dbf70562c0af02b98e03a1c72f9afc1c1b92a977a3f58e9de9ee
7
+ data.tar.gz: 58953a7a352efb996029af6aabf36176d968da59c351ac9b9e5738f7c3fc53a7f34b73faf0dc5b2b07a9af1804ccccafe6b22a876aa02ca126e9f4c49d48a28b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tracker-git (0.0.4)
4
+ tracker-git (0.0.5)
5
5
  pivotal-tracker (>= 0.5.10)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Tracker::Git
2
2
 
3
- Update Pivotal Tracker depending on your local Git repository.
3
+ Update Pivotal Tracker depending on your local Git repository.
4
4
 
5
- This gem finds all finished stories and bugs and if it finds the story id in a Git commit, marks that story as delivery.
5
+ This gem finds all finished stories and bugs and if it finds the story id in a Git commit, marks that story as delivery.
6
6
 
7
7
  This has proved useful as part of a 'deploy to staging' strategy. If you automatically deploy to a staging environment after a successful continuous integration build, and want to update a story from 'finished' to 'delivered', then this Gem is for you.
8
8
 
@@ -36,7 +36,7 @@ delivered.
36
36
  export TRACKER_PROJECT_ID=123456
37
37
  export TRACKER_TOKEN=abc123
38
38
  tracker
39
-
39
+
40
40
  You can also pass the project id and token in as parameters
41
41
 
42
42
  tracker 123456 abc123
@@ -44,6 +44,12 @@ You can also pass the project id and token in as parameters
44
44
  Optionally you can specify a git branch to search for completed story IDs as
45
45
  the third command line argument or with the GIT\_BRANCH environment variable.
46
46
 
47
+ If you want to add a label (tag) to the story marked as delivered, you
48
+ can use the `--label` flag:
49
+
50
+ tracker --label THE_LABEL
51
+
52
+
47
53
  ## Known Issues
48
54
 
49
55
  - [Restarting stories](https://github.com/robb1e/tracker-git/issues/1)
@@ -15,6 +15,10 @@ OptionParser.new do |opts|
15
15
  opts.on("-l", "--label LABEL", "Add a label to a story marked as deployed") do |label|
16
16
  options[:label] = label if label =~ /[^[:space:]]/
17
17
  end
18
+
19
+ opts.on("-a", "--accept", "Changes status from delivered to accepted") do |accept|
20
+ options[:accept] = true
21
+ end
18
22
  end.parse!
19
23
 
20
24
  project_id, tracker_token, git_branch = \
@@ -41,3 +45,4 @@ project = Tracker::Project.new(tracker_token, project_id)
41
45
  git = Tracker::Git.new
42
46
  deliverer = Tracker::Deliverer.new(project, git)
43
47
  deliverer.mark_as_delivered(git_branch, options[:label])
48
+ deliverer.mark_as_accepted(git_branch, options[:label]) if options[:accept]
@@ -6,16 +6,23 @@ module Tracker
6
6
  @git = git
7
7
  end
8
8
 
9
- def mark_as_delivered(branch = nil, label = nil)
9
+ def mark_as_delivered(branch = nil, label = nil, use_accepted = false)
10
10
  options = {}
11
11
  options[:branch] = branch if branch
12
12
 
13
- project.finished.each do |story|
13
+ collection = use_accepted ? project.delivered : project.finished
14
+
15
+ collection.each do |story|
14
16
  if git.contains?(story.id, options)
15
- project.deliver(story)
17
+ project.accept(story) if use_accepted
18
+ project.deliver(story) unless use_accepted
16
19
  project.add_label(story, label) if label
17
20
  end
18
21
  end
19
22
  end
23
+
24
+ def mark_as_accepted(branch = nil, label = nil)
25
+ mark_as_delivered(branch, label, true)
26
+ end
20
27
  end
21
28
  end
@@ -17,10 +17,18 @@ module Tracker
17
17
  _project.stories.all(state: "finished", story_type: ['bug', 'feature'])
18
18
  end
19
19
 
20
+ def delivered
21
+ _project.stories.all(state: "delivered", story_type: ['bug', 'feature'])
22
+ end
23
+
20
24
  def deliver(story)
21
25
  story.update(current_state: "delivered")
22
26
  end
23
27
 
28
+ def accept(story)
29
+ story.update(current_state: "accepted")
30
+ end
31
+
24
32
  def add_label(story, label)
25
33
  labels = (story.labels || "").split(",")
26
34
  labels << label
@@ -1,3 +1,3 @@
1
1
  module Tracker
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tracker-git
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robbie Clutton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-20 00:00:00.000000000 Z
11
+ date: 2014-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pivotal-tracker
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.5.10
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.5.10
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: guard-rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: 'Tracker integration: Update Tracker based on current Git repo.'
@@ -74,9 +74,9 @@ executables:
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
- - ".gitignore"
78
- - ".rspec"
79
- - ".travis.yml"
77
+ - .gitignore
78
+ - .rspec
79
+ - .travis.yml
80
80
  - Gemfile
81
81
  - Gemfile.lock
82
82
  - Guardfile
@@ -104,17 +104,17 @@ require_paths:
104
104
  - lib
105
105
  required_ruby_version: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - ">="
107
+ - - '>='
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  requirements:
112
- - - ">="
112
+ - - '>='
113
113
  - !ruby/object:Gem::Version
114
114
  version: '0'
115
115
  requirements: []
116
116
  rubyforge_project:
117
- rubygems_version: 2.2.2
117
+ rubygems_version: 2.1.11
118
118
  signing_key:
119
119
  specification_version: 4
120
120
  summary: Tracker integration.