git-pivotal-tracker 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. data/.gitignore +5 -0
  2. data/.rspec +2 -0
  3. data/.rvmrc +1 -0
  4. data/.travis.yml +3 -0
  5. data/CHANGELOG +45 -0
  6. data/Gemfile +3 -0
  7. data/Gemfile.lock +74 -0
  8. data/LICENSE +21 -0
  9. data/Rakefile +24 -0
  10. data/VERSION +1 -0
  11. data/bin/git-accept +7 -0
  12. data/bin/git-block +7 -0
  13. data/bin/git-finish +7 -0
  14. data/bin/git-info +7 -0
  15. data/bin/git-start +8 -0
  16. data/bin/git-unblock +7 -0
  17. data/features/accept.feature +140 -0
  18. data/features/block.feature +94 -0
  19. data/features/finish.feature +119 -0
  20. data/features/info.feature +99 -0
  21. data/features/start.feature +113 -0
  22. data/features/step_definitions/steps.rb +114 -0
  23. data/features/support/dsl/assertions.rb +11 -0
  24. data/features/support/dsl/data.rb +11 -0
  25. data/features/support/dsl/pivotal.rb +76 -0
  26. data/features/support/env.rb +6 -0
  27. data/features/support/git-pivotal.rb +69 -0
  28. data/features/test_repo/origin.git/COMMIT_EDITMSG +1 -0
  29. data/features/test_repo/origin.git/HEAD +1 -0
  30. data/features/test_repo/origin.git/config +8 -0
  31. data/features/test_repo/origin.git/description +1 -0
  32. data/features/test_repo/origin.git/hooks/applypatch-msg.sample +15 -0
  33. data/features/test_repo/origin.git/hooks/commit-msg.sample +24 -0
  34. data/features/test_repo/origin.git/hooks/post-commit.sample +8 -0
  35. data/features/test_repo/origin.git/hooks/post-receive.sample +15 -0
  36. data/features/test_repo/origin.git/hooks/post-update.sample +8 -0
  37. data/features/test_repo/origin.git/hooks/pre-applypatch.sample +14 -0
  38. data/features/test_repo/origin.git/hooks/pre-commit.sample +46 -0
  39. data/features/test_repo/origin.git/hooks/pre-rebase.sample +169 -0
  40. data/features/test_repo/origin.git/hooks/prepare-commit-msg.sample +36 -0
  41. data/features/test_repo/origin.git/hooks/update.sample +128 -0
  42. data/features/test_repo/origin.git/index +0 -0
  43. data/features/test_repo/origin.git/info/exclude +6 -0
  44. data/features/test_repo/origin.git/logs/HEAD +1 -0
  45. data/features/test_repo/origin.git/logs/refs/heads/master +1 -0
  46. data/features/test_repo/origin.git/objects/0c/6f7b1384910d1a2f137590095f008a06c7e00c +0 -0
  47. data/features/test_repo/origin.git/objects/10/ecf2b7ce989f01f3f7266e712b48d9275f2635 +0 -0
  48. data/features/test_repo/origin.git/objects/a5/71d56305df09fb060f6ccb730b46080d305beb +0 -0
  49. data/features/test_repo/origin.git/refs/heads/master +1 -0
  50. data/features/test_repo/readme +1 -0
  51. data/features/unblock.feature +68 -0
  52. data/git-pivotal-tracker.gemspec +27 -0
  53. data/lib/commands/accept.rb +76 -0
  54. data/lib/commands/base.rb +128 -0
  55. data/lib/commands/block.rb +59 -0
  56. data/lib/commands/bug.rb +19 -0
  57. data/lib/commands/card.rb +32 -0
  58. data/lib/commands/chore.rb +19 -0
  59. data/lib/commands/feature.rb +19 -0
  60. data/lib/commands/finish.rb +59 -0
  61. data/lib/commands/info.rb +58 -0
  62. data/lib/commands/map.rb +10 -0
  63. data/lib/commands/pick.rb +76 -0
  64. data/lib/commands/start.rb +35 -0
  65. data/lib/commands/unblock.rb +55 -0
  66. data/lib/git-pivotal-tracker.rb +11 -0
  67. data/readme.markdown +95 -0
  68. data/spec/commands/base_spec.rb +151 -0
  69. data/spec/commands/bug_spec.rb +24 -0
  70. data/spec/commands/chore_spec.rb +24 -0
  71. data/spec/commands/feature_spec.rb +24 -0
  72. data/spec/commands/finish_spec.rb +125 -0
  73. data/spec/commands/map_spec.rb +14 -0
  74. data/spec/commands/start_spec.rb +29 -0
  75. data/spec/factories.rb +13 -0
  76. data/spec/factory.rb +26 -0
  77. data/spec/spec_helper.rb +24 -0
  78. metadata +251 -0
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+
3
+ describe Commands::Map do
4
+
5
+ describe "#[]" do
6
+ it "retrieves values when a specific key matches a regular expression" do
7
+ subject[/^\d+$/] = "w00t"
8
+ subject["1234"].should eq("w00t")
9
+ subject["9123423423"].should eq("w00t")
10
+ subject["a9123423423"].should be_nil
11
+ subject["1234f"].should be_nil
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,29 @@
1
+ require 'spec_helper'
2
+
3
+ describe Commands::Start do
4
+
5
+ describe '.for' do
6
+ it "returns the Command::Bug when the first argument is bug" do
7
+ Commands::Start.for("bug").should be_instance_of(Commands::Bug)
8
+ end
9
+
10
+ it "returns the Command::Chore when the first argument is chore" do
11
+ Commands::Start.for("chore").should be_instance_of(Commands::Chore)
12
+ end
13
+
14
+ it "returns the Command::Feature when the first argument is feature" do
15
+ Commands::Start.for("feature").should be_instance_of(Commands::Feature)
16
+ end
17
+
18
+ it "returns the Command::Card when the first argument is a card id" do
19
+ Commands::Start.for("123456").should be_instance_of(Commands::Card)
20
+ end
21
+
22
+
23
+ it "raises when the command is unknown card type" do
24
+ expect { Commands::Start.for("unknown") }.should raise_error(ArgumentError, "Unknown card identifier given: unknown")
25
+ end
26
+
27
+ end
28
+
29
+ end
@@ -0,0 +1,13 @@
1
+ require File.join(File.dirname(__FILE__), 'factory')
2
+
3
+ Factory.define :story, {
4
+ :id => 1,
5
+ :current_state => :unstarted,
6
+ :story_type => :feature,
7
+ :estimate => 1,
8
+ }
9
+
10
+ Factory.define :project, {
11
+ :id => 1,
12
+ :name => "Project"
13
+ }
@@ -0,0 +1,26 @@
1
+ class Factory
2
+ class << self
3
+ def factories
4
+ @@factories ||= {}
5
+ end
6
+
7
+ def define(type, attributes)
8
+ factories[type] = attributes
9
+ end
10
+ end
11
+ end
12
+
13
+
14
+ def Factory(type, attrs = {})
15
+ defaults = Factory.factories[type]
16
+ attrs = defaults.merge(attrs)
17
+
18
+ markup = Builder::XmlMarkup.new
19
+ markup.__send__(type) do
20
+ attrs.each do |attribute, value|
21
+ markup.__send__(attribute, value.to_s)
22
+ end
23
+ end
24
+
25
+ markup.target!
26
+ end
@@ -0,0 +1,24 @@
1
+ require 'mocha'
2
+ require 'builder'
3
+
4
+ # This file was generated by the `rspec --init` command. Conventionally, all
5
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
6
+ # Require this file using `require "spec_helper.rb"` to ensure that it is only
7
+ # loaded once.
8
+ #
9
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
10
+ RSpec.configure do |config|
11
+ config.mock_with :mocha
12
+ config.treat_symbols_as_metadata_keys_with_true_values = true
13
+ config.run_all_when_everything_filtered = true
14
+ config.filter_run :focus
15
+ end
16
+
17
+ specdir = File.expand_path(File.join(File.dirname(__FILE__), '..'))
18
+ require File.join(specdir, 'lib','git-pivotal-tracker')
19
+
20
+ require File.join(File.dirname(__FILE__), 'factories')
21
+
22
+ def stub_connection_to_pivotal
23
+ RestClient::Resource.any_instance.stubs(:get).returns("")
24
+ end
metadata ADDED
@@ -0,0 +1,251 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: git-pivotal-tracker
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Zach Dennis
9
+ - Jeff Tucker
10
+ - Sam Stokes
11
+ autorequire:
12
+ bindir: bin
13
+ cert_chain: []
14
+ date: 2012-04-02 00:00:00.000000000 Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: pivotal-tracker
18
+ requirement: &70272204152400 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ! '>='
22
+ - !ruby/object:Gem::Version
23
+ version: '0'
24
+ type: :runtime
25
+ prerelease: false
26
+ version_requirements: *70272204152400
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: &70272204151360 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ! '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: *70272204151360
38
+ - !ruby/object:Gem::Dependency
39
+ name: mocha
40
+ requirement: &70272204149580 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ type: :development
47
+ prerelease: false
48
+ version_requirements: *70272204149580
49
+ - !ruby/object:Gem::Dependency
50
+ name: simplecov
51
+ requirement: &70272204148140 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ! '>='
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ type: :development
58
+ prerelease: false
59
+ version_requirements: *70272204148140
60
+ - !ruby/object:Gem::Dependency
61
+ name: aruba
62
+ requirement: &70272204146840 !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: *70272204146840
71
+ - !ruby/object:Gem::Dependency
72
+ name: rspec
73
+ requirement: &70272204145820 !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ type: :development
80
+ prerelease: false
81
+ version_requirements: *70272204145820
82
+ - !ruby/object:Gem::Dependency
83
+ name: cucumber
84
+ requirement: &70272204145100 !ruby/object:Gem::Requirement
85
+ none: false
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: *70272204145100
93
+ description: A collection of git utilities to ease integration with Pivotal Tracker.
94
+ email: zach.dennis@gmail.com
95
+ executables:
96
+ - git-accept
97
+ - git-block
98
+ - git-finish
99
+ - git-info
100
+ - git-start
101
+ - git-unblock
102
+ extensions: []
103
+ extra_rdoc_files: []
104
+ files:
105
+ - .gitignore
106
+ - .rspec
107
+ - .rvmrc
108
+ - .travis.yml
109
+ - CHANGELOG
110
+ - Gemfile
111
+ - Gemfile.lock
112
+ - LICENSE
113
+ - Rakefile
114
+ - VERSION
115
+ - bin/git-accept
116
+ - bin/git-block
117
+ - bin/git-finish
118
+ - bin/git-info
119
+ - bin/git-start
120
+ - bin/git-unblock
121
+ - features/accept.feature
122
+ - features/block.feature
123
+ - features/finish.feature
124
+ - features/info.feature
125
+ - features/start.feature
126
+ - features/step_definitions/steps.rb
127
+ - features/support/dsl/assertions.rb
128
+ - features/support/dsl/data.rb
129
+ - features/support/dsl/pivotal.rb
130
+ - features/support/env.rb
131
+ - features/support/git-pivotal.rb
132
+ - features/test_repo/origin.git/COMMIT_EDITMSG
133
+ - features/test_repo/origin.git/HEAD
134
+ - features/test_repo/origin.git/config
135
+ - features/test_repo/origin.git/description
136
+ - features/test_repo/origin.git/hooks/applypatch-msg.sample
137
+ - features/test_repo/origin.git/hooks/commit-msg.sample
138
+ - features/test_repo/origin.git/hooks/post-commit.sample
139
+ - features/test_repo/origin.git/hooks/post-receive.sample
140
+ - features/test_repo/origin.git/hooks/post-update.sample
141
+ - features/test_repo/origin.git/hooks/pre-applypatch.sample
142
+ - features/test_repo/origin.git/hooks/pre-commit.sample
143
+ - features/test_repo/origin.git/hooks/pre-rebase.sample
144
+ - features/test_repo/origin.git/hooks/prepare-commit-msg.sample
145
+ - features/test_repo/origin.git/hooks/update.sample
146
+ - features/test_repo/origin.git/index
147
+ - features/test_repo/origin.git/info/exclude
148
+ - features/test_repo/origin.git/logs/HEAD
149
+ - features/test_repo/origin.git/logs/refs/heads/master
150
+ - features/test_repo/origin.git/objects/0c/6f7b1384910d1a2f137590095f008a06c7e00c
151
+ - features/test_repo/origin.git/objects/10/ecf2b7ce989f01f3f7266e712b48d9275f2635
152
+ - features/test_repo/origin.git/objects/a5/71d56305df09fb060f6ccb730b46080d305beb
153
+ - features/test_repo/origin.git/refs/heads/master
154
+ - features/test_repo/readme
155
+ - features/unblock.feature
156
+ - git-pivotal-tracker.gemspec
157
+ - lib/commands/accept.rb
158
+ - lib/commands/base.rb
159
+ - lib/commands/block.rb
160
+ - lib/commands/bug.rb
161
+ - lib/commands/card.rb
162
+ - lib/commands/chore.rb
163
+ - lib/commands/feature.rb
164
+ - lib/commands/finish.rb
165
+ - lib/commands/info.rb
166
+ - lib/commands/map.rb
167
+ - lib/commands/pick.rb
168
+ - lib/commands/start.rb
169
+ - lib/commands/unblock.rb
170
+ - lib/git-pivotal-tracker.rb
171
+ - readme.markdown
172
+ - spec/commands/base_spec.rb
173
+ - spec/commands/bug_spec.rb
174
+ - spec/commands/chore_spec.rb
175
+ - spec/commands/feature_spec.rb
176
+ - spec/commands/finish_spec.rb
177
+ - spec/commands/map_spec.rb
178
+ - spec/commands/start_spec.rb
179
+ - spec/factories.rb
180
+ - spec/factory.rb
181
+ - spec/spec_helper.rb
182
+ homepage: https://github.com/zdennis/git-pivotal
183
+ licenses: []
184
+ post_install_message:
185
+ rdoc_options: []
186
+ require_paths:
187
+ - lib
188
+ required_ruby_version: !ruby/object:Gem::Requirement
189
+ none: false
190
+ requirements:
191
+ - - ! '>='
192
+ - !ruby/object:Gem::Version
193
+ version: '0'
194
+ required_rubygems_version: !ruby/object:Gem::Requirement
195
+ none: false
196
+ requirements:
197
+ - - ! '>='
198
+ - !ruby/object:Gem::Version
199
+ version: '0'
200
+ requirements: []
201
+ rubyforge_project:
202
+ rubygems_version: 1.8.17
203
+ signing_key:
204
+ specification_version: 3
205
+ summary: A collection of git utilities to ease integration with Pivotal Tracker.
206
+ test_files:
207
+ - features/accept.feature
208
+ - features/block.feature
209
+ - features/finish.feature
210
+ - features/info.feature
211
+ - features/start.feature
212
+ - features/step_definitions/steps.rb
213
+ - features/support/dsl/assertions.rb
214
+ - features/support/dsl/data.rb
215
+ - features/support/dsl/pivotal.rb
216
+ - features/support/env.rb
217
+ - features/support/git-pivotal.rb
218
+ - features/test_repo/origin.git/COMMIT_EDITMSG
219
+ - features/test_repo/origin.git/HEAD
220
+ - features/test_repo/origin.git/config
221
+ - features/test_repo/origin.git/description
222
+ - features/test_repo/origin.git/hooks/applypatch-msg.sample
223
+ - features/test_repo/origin.git/hooks/commit-msg.sample
224
+ - features/test_repo/origin.git/hooks/post-commit.sample
225
+ - features/test_repo/origin.git/hooks/post-receive.sample
226
+ - features/test_repo/origin.git/hooks/post-update.sample
227
+ - features/test_repo/origin.git/hooks/pre-applypatch.sample
228
+ - features/test_repo/origin.git/hooks/pre-commit.sample
229
+ - features/test_repo/origin.git/hooks/pre-rebase.sample
230
+ - features/test_repo/origin.git/hooks/prepare-commit-msg.sample
231
+ - features/test_repo/origin.git/hooks/update.sample
232
+ - features/test_repo/origin.git/index
233
+ - features/test_repo/origin.git/info/exclude
234
+ - features/test_repo/origin.git/logs/HEAD
235
+ - features/test_repo/origin.git/logs/refs/heads/master
236
+ - features/test_repo/origin.git/objects/0c/6f7b1384910d1a2f137590095f008a06c7e00c
237
+ - features/test_repo/origin.git/objects/10/ecf2b7ce989f01f3f7266e712b48d9275f2635
238
+ - features/test_repo/origin.git/objects/a5/71d56305df09fb060f6ccb730b46080d305beb
239
+ - features/test_repo/origin.git/refs/heads/master
240
+ - features/test_repo/readme
241
+ - features/unblock.feature
242
+ - spec/commands/base_spec.rb
243
+ - spec/commands/bug_spec.rb
244
+ - spec/commands/chore_spec.rb
245
+ - spec/commands/feature_spec.rb
246
+ - spec/commands/finish_spec.rb
247
+ - spec/commands/map_spec.rb
248
+ - spec/commands/start_spec.rb
249
+ - spec/factories.rb
250
+ - spec/factory.rb
251
+ - spec/spec_helper.rb