Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
zdennis committed Apr 1, 2012
1 parent 7354074 commit 7f52ddd
Show file tree
Hide file tree
Showing 15 changed files with 313 additions and 147 deletions.
2 changes: 0 additions & 2 deletions Gemfile
@@ -1,5 +1,3 @@
source "http://rubygems.org"

gem "pry"

gemspec
10 changes: 5 additions & 5 deletions Gemfile.lock
@@ -1,9 +1,9 @@
PATH
remote: .
specs:
git-pivotal (0.8.2)
builder
git-pivotal-tracker (0.9.0)
builder
git-pivotal-tracker
pivotal-tracker (~> 0.5.1)

GEM
Expand Down Expand Up @@ -83,11 +83,11 @@ PLATFORMS

DEPENDENCIES
aruba
cucumber (~> 1.1.9)
git-pivotal!
cucumber
git-pivotal-tracker!
jeweler
mocha
pry
rake
rspec (~> 2.9.0)
rspec
simplecov
27 changes: 20 additions & 7 deletions Rakefile
Expand Up @@ -8,16 +8,29 @@ task :default => [:spec, :features]
begin
require 'jeweler'
Jeweler::Tasks.new do |gemspec|
gemspec.name = "git-pivotal"
gemspec.summary = "A collection of git utilities to ease integration with Pivotal Tracker"
gemspec.description = "A collection of git utilities to ease integration with Pivotal Tracker"
gemspec.email = "jeff@trydionel.com"
gemspec.homepage = "http://github.com/trydionel/git-pivotal"
gemspec.authors = ["Jeff Tucker", "Sam Stokes"]
gemspec.name = "git-pivotal-tracker"
gemspec.summary = "A collection of git utilities to ease integration with Pivotal Tracker."
gemspec.description = "A collection of git utilities to ease integration with Pivotal Tracker."
gemspec.email = "zach.dennis@gmail.com"
gemspec.homepage = "http://github.com/zdennis/git-pivotal"
gemspec.authors = ["Zach Dennis", "Jeff Tucker", "Sam Stokes"]
gemspec.post_install_message = <<-EOT.gsub(/^\s+\S/, '')
|If you haven't set up git-pivotal-tracker before, here's a few commands to
|get started:
|
| # Applies to global Git configuration
| git config --global pivotal.api-token <your-token-here>
| git config --global pivotal.full-name "Your Name As In Pivotal"
|
| # Applies to project-specific Git configuration
| git config -f .git/config pivotal.project-id <pivotal-project-id>
|
EOT

gemspec.add_dependency "builder"
gemspec.add_dependency "pivotal-tracker", "~>0.5.1"

gemspec.add_development_dependency "pry"
gemspec.add_development_dependency "rspec"
gemspec.add_development_dependency "cucumber"
gemspec.add_development_dependency "aruba"
Expand All @@ -40,7 +53,7 @@ end
begin
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features) do |t|
# t.cucumber_opts = "features --format pretty"
t.cucumber_opts = "features --format pretty"
end
rescue LoadError => e
puts "Cucumber not installed"
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
0.8.2
0.9.0
7 changes: 7 additions & 0 deletions bin/git-unblock
@@ -0,0 +1,7 @@
#!/usr/bin/env ruby

$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')

require 'commands/unblock'

exit Commands::Unblock.new(*ARGV).with(STDIN, STDOUT).run!
8 changes: 6 additions & 2 deletions features/step_definitions/steps.rb
Expand Up @@ -85,8 +85,12 @@
refresh_current_card!
end

Then /^the card CURRENT_CARD should have the "([^"]*)" label$/ do |label|
current_card.labels.should include(label)
Then /^the card CURRENT_CARD should (not )?have the "([^"]*)" label$/ do |negate, label|
if negate
current_card.labels.to_s.should_not include(label)
else
current_card.labels.to_s.should include(label)
end
end

Then /^the card CURRENT_CARD should have the comment by "([^"]*)":$/ do |author, str|
Expand Down
2 changes: 1 addition & 1 deletion features/support/env.rb
Expand Up @@ -2,5 +2,5 @@

require 'aruba'
require 'aruba/cucumber'
require 'git-pivotal'
require 'git-pivotal-tracker'
require 'pivotal-tracker'
68 changes: 68 additions & 0 deletions features/unblock.feature
@@ -0,0 +1,68 @@
Feature: git block

In order to get information about a specific card you can issue one of the following
commands:

git unblock
git unblock <options>
git unblock <card_id>
git unblock <card_id> <options>

Supported options:
-k <api_key> - specify the Pivotal API key to use. Overrides configuration.
-p <project_id> - specify the Pivotal project id to use. Overrides configuration.

Background:
Given I have a Pivotal Tracker feature named "Test Story" with description "This is the description!"
And I am on the "CURRENT_CARD-feature" branch

# This scenario is to test the presence of a bug in Pivotal Tracker's v3 API. It is
# impossible to remove the last label from a story. When this fails then git-unblock
# will need to be updated to not use a placeholder label.
Scenario: Is Pivotal's API for removing the last label on a card still broken?
Given I have configured the Git repos for Pivotal
And the card is labeled "blocked"
When I run `git-unblock`
Then the card CURRENT_CARD should have the "blocked" label

Scenario: Executing with no settings
When I run `git-unblock`
Then the output should contain:
"""
Pivotal Tracker API Token and Project ID are required
"""
And the exit status should be 1

Scenario: Unblocking the current topic branch
Given I have configured the Git repos for Pivotal
And the card is labeled "blocked"
When I run `git-unblock`
Then the output should contain "Story CURRENT_CARD has been unblocked."
When the current card is refreshed
Then the card CURRENT_CARD should not have the "blocked" label

Scenario: Unlocking a specific card
Given I have configured the Git repos for Pivotal
And the card is labeled "blocked"
When I run `git-unblock CURRENT_CARD`
Then the output should contain "Story CURRENT_CARD has been unblocked."
When the current card is refreshed
Then the card CURRENT_CARD should not have the "blocked" label

Scenario: Unblocking a card that is not blocked
Given I have configured the Git repos for Pivotal
When I run `git-unblock CURRENT_CARD`
Then the output should contain "Story CURRENT_CARD is already unblocked."
When the current card is refreshed
Then the card CURRENT_CARD should not have the "blocked" label

Scenario: Trying to unblock when not on a topic branch and not supplying a card id
Given I have configured the Git repos for Pivotal
And I am on the "foo" branch
Then I should be on the "foo" branch
When I run `git-unblock`
Then the output should contain:
"""
No story id was supplied and you aren't on a topic branch!
"""

145 changes: 145 additions & 0 deletions git-pivotal-tracker.gemspec
@@ -0,0 +1,145 @@
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
s.name = "git-pivotal-tracker"
s.version = "0.9.0"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Zach Dennis", "Jeff Tucker", "Sam Stokes"]
s.date = "2012-04-01"
s.description = "A collection of git utilities to ease integration with Pivotal Tracker."
s.email = "zach.dennis@gmail.com"
s.executables = ["git-accept", "git-block", "git-finish", "git-info", "git-start", "git-unblock"]
s.extra_rdoc_files = [
"LICENSE"
]
s.files = [
".rspec",
".rvmrc",
".travis.yml",
"CHANGELOG",
"Gemfile",
"Gemfile.lock",
"LICENSE",
"Rakefile",
"VERSION",
"bin/git-accept",
"bin/git-block",
"bin/git-finish",
"bin/git-info",
"bin/git-start",
"bin/git-unblock",
"features/accept.feature",
"features/block.feature",
"features/finish.feature",
"features/info.feature",
"features/start.feature",
"features/step_definitions/steps.rb",
"features/support/dsl/assertions.rb",
"features/support/dsl/data.rb",
"features/support/dsl/pivotal.rb",
"features/support/env.rb",
"features/support/git-pivotal.rb",
"features/test_repo/origin.git/COMMIT_EDITMSG",
"features/test_repo/origin.git/HEAD",
"features/test_repo/origin.git/config",
"features/test_repo/origin.git/description",
"features/test_repo/origin.git/hooks/applypatch-msg.sample",
"features/test_repo/origin.git/hooks/commit-msg.sample",
"features/test_repo/origin.git/hooks/post-commit.sample",
"features/test_repo/origin.git/hooks/post-receive.sample",
"features/test_repo/origin.git/hooks/post-update.sample",
"features/test_repo/origin.git/hooks/pre-applypatch.sample",
"features/test_repo/origin.git/hooks/pre-commit.sample",
"features/test_repo/origin.git/hooks/pre-rebase.sample",
"features/test_repo/origin.git/hooks/prepare-commit-msg.sample",
"features/test_repo/origin.git/hooks/update.sample",
"features/test_repo/origin.git/index",
"features/test_repo/origin.git/info/exclude",
"features/test_repo/origin.git/logs/HEAD",
"features/test_repo/origin.git/logs/refs/heads/master",
"features/test_repo/origin.git/objects/0c/6f7b1384910d1a2f137590095f008a06c7e00c",
"features/test_repo/origin.git/objects/10/ecf2b7ce989f01f3f7266e712b48d9275f2635",
"features/test_repo/origin.git/objects/a5/71d56305df09fb060f6ccb730b46080d305beb",
"features/test_repo/origin.git/refs/heads/master",
"features/test_repo/readme",
"features/unblock.feature",
"lib/commands/accept.rb",
"lib/commands/base.rb",
"lib/commands/block.rb",
"lib/commands/bug.rb",
"lib/commands/card.rb",
"lib/commands/chore.rb",
"lib/commands/feature.rb",
"lib/commands/finish.rb",
"lib/commands/info.rb",
"lib/commands/map.rb",
"lib/commands/pick.rb",
"lib/commands/start.rb",
"lib/commands/unblock.rb",
"readme.markdown",
"spec/commands/base_spec.rb",
"spec/commands/bug_spec.rb",
"spec/commands/chore_spec.rb",
"spec/commands/feature_spec.rb",
"spec/commands/finish_spec.rb",
"spec/commands/map_spec.rb",
"spec/commands/start_spec.rb",
"spec/factories.rb",
"spec/factory.rb",
"spec/spec_helper.rb"
]
s.homepage = "http://github.com/zdennis/git-pivotal"
s.post_install_message = "If you haven't set up git-pivotal-tracker before, here's a few commands to \nget started:\n\n # Applies to global Git configuration\n git config --global pivotal.api-token <your-token-here>\n git config --global pivotal.full-name \"Your Name As In Pivotal\"\n\n # Applies to project-specific Git configuration\n git config -f .git/config pivotal.project-id <pivotal-project-id>\n\n"
s.require_paths = ["lib"]
s.rubygems_version = "1.8.17"
s.summary = "A collection of git utilities to ease integration with Pivotal Tracker."

if s.respond_to? :specification_version then
s.specification_version = 3

if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
puts "HERE1"
s.add_runtime_dependency(%q<git-pivotal-tracker>, [">= 0"])
s.add_development_dependency(%q<rake>, [">= 0"])
s.add_development_dependency(%q<jeweler>, [">= 0"])
s.add_development_dependency(%q<mocha>, [">= 0"])
s.add_development_dependency(%q<simplecov>, [">= 0"])
s.add_development_dependency(%q<aruba>, [">= 0"])
s.add_development_dependency(%q<rspec>, [">= 0"])
s.add_development_dependency(%q<cucumber>, [">= 0"])
s.add_runtime_dependency(%q<builder>, [">= 0"])
s.add_runtime_dependency(%q<pivotal-tracker>, ["~> 0.5.1"])
else
puts "HERE2"
s.add_dependency(%q<git-pivotal-tracker>, [">= 0"])
s.add_dependency(%q<rake>, [">= 0"])
s.add_dependency(%q<jeweler>, [">= 0"])
s.add_dependency(%q<mocha>, [">= 0"])
s.add_dependency(%q<simplecov>, [">= 0"])
s.add_dependency(%q<aruba>, [">= 0"])
s.add_dependency(%q<rspec>, [">= 0"])
s.add_dependency(%q<cucumber>, [">= 0"])
s.add_dependency(%q<pry>, [">= 0"])
s.add_dependency(%q<builder>, [">= 0"])
s.add_dependency(%q<pivotal-tracker>, ["~> 0.5.1"])
end
else
puts "HERE3"
s.add_dependency(%q<git-pivotal-tracker>, [">= 0"])
s.add_dependency(%q<rake>, [">= 0"])
s.add_dependency(%q<jeweler>, [">= 0"])
s.add_dependency(%q<mocha>, [">= 0"])
s.add_dependency(%q<simplecov>, [">= 0"])
s.add_dependency(%q<aruba>, [">= 0"])
s.add_dependency(%q<rspec>, [">= 0"])
s.add_dependency(%q<cucumber>, [">= 0"])
s.add_dependency(%q<pry>, [">= 0"])
s.add_dependency(%q<builder>, [">= 0"])
s.add_dependency(%q<pivotal-tracker>, ["~> 0.5.1"])
end
end

0 comments on commit 7f52ddd

Please sign in to comment.