gisikw-pivotpro 0.1.0
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.
- data/.document +5 -0
- data/.gitignore +5 -0
- data/LICENSE +20 -0
- data/README.rdoc +25 -0
- data/Rakefile +56 -0
- data/VERSION +1 -0
- data/bin/pivotpro +6 -0
- data/lib/pivotpro/base.rb +24 -0
- data/lib/pivotpro/configuration.rb +16 -0
- data/lib/pivotpro/delegator.rb +38 -0
- data/lib/pivotpro/project.rb +15 -0
- data/lib/pivotpro/user.rb +37 -0
- data/lib/pivotpro.rb +8 -0
- data/pivotpro.gemspec +61 -0
- data/test/pivotpro_test.rb +7 -0
- data/test/test_helper.rb +10 -0
- metadata +80 -0
data/.document
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Kevin W. Gisi
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
= PivotPro
|
2
|
+
|
3
|
+
PivotPro is a RubyGem used to interface with PivotalTracker. It relied on the PivotalRecord gem (http://github.com/napcs/pivotalrecord) to access the api. Below, you can view the existing functionality that can be accessed from the binary: pivotpro
|
4
|
+
|
5
|
+
=== General Commands
|
6
|
+
|
7
|
+
help # show this usage
|
8
|
+
list # list your PivotalTracker projects
|
9
|
+
|
10
|
+
=== App Commands (execute inside a checkout directory, or use --project <id>
|
11
|
+
|
12
|
+
stories # list all stories associated with this project
|
13
|
+
stories:features # list all stories that are features
|
14
|
+
stories:bugs # list all stories that are bugs
|
15
|
+
stories:releases # list all stories that are releases
|
16
|
+
|
17
|
+
== Known Issues
|
18
|
+
|
19
|
+
This is still in early development. As such, there will be frequent changes, which may or not break previous versions of the Gem.
|
20
|
+
|
21
|
+
* The Gem does not yet parse out the project from a directory, so any app commands will require the passed parameter.
|
22
|
+
|
23
|
+
== Copyright
|
24
|
+
|
25
|
+
Copyright (c) 2009 Kevin W. Gisi. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "pivotpro"
|
8
|
+
gem.summary = %Q{RubyGem to interface with PivotalTracker}
|
9
|
+
gem.description = %Q{RubyGem to interface with PivotalTracker, relying on PivotalRecord}
|
10
|
+
gem.email = "kevin.gisi@gmail.com"
|
11
|
+
gem.homepage = "http://github.com/gisikw/pivotpro"
|
12
|
+
gem.authors = ["Kevin Gisi"]
|
13
|
+
gem.add_development_dependency "thoughtbot-shoulda"
|
14
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
15
|
+
end
|
16
|
+
rescue LoadError
|
17
|
+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
18
|
+
end
|
19
|
+
|
20
|
+
require 'rake/testtask'
|
21
|
+
Rake::TestTask.new(:test) do |test|
|
22
|
+
test.libs << 'lib' << 'test'
|
23
|
+
test.pattern = 'test/**/*_test.rb'
|
24
|
+
test.verbose = true
|
25
|
+
end
|
26
|
+
|
27
|
+
begin
|
28
|
+
require 'rcov/rcovtask'
|
29
|
+
Rcov::RcovTask.new do |test|
|
30
|
+
test.libs << 'test'
|
31
|
+
test.pattern = 'test/**/*_test.rb'
|
32
|
+
test.verbose = true
|
33
|
+
end
|
34
|
+
rescue LoadError
|
35
|
+
task :rcov do
|
36
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
task :test => :check_dependencies
|
41
|
+
|
42
|
+
task :default => :test
|
43
|
+
|
44
|
+
require 'rake/rdoctask'
|
45
|
+
Rake::RDocTask.new do |rdoc|
|
46
|
+
if File.exist?('VERSION')
|
47
|
+
version = File.read('VERSION')
|
48
|
+
else
|
49
|
+
version = ""
|
50
|
+
end
|
51
|
+
|
52
|
+
rdoc.rdoc_dir = 'rdoc'
|
53
|
+
rdoc.title = "pivotpro #{version}"
|
54
|
+
rdoc.rdoc_files.include('README*')
|
55
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
56
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
data/bin/pivotpro
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
module PivotPro
|
2
|
+
class Base
|
3
|
+
|
4
|
+
STORY_TYPES = ["features","bugs","releases"]
|
5
|
+
|
6
|
+
class << self
|
7
|
+
|
8
|
+
def authenticate
|
9
|
+
Pivotal::Configuration.options[:api_key] = "acf3d20d12757cfd975f8551122b10a9"
|
10
|
+
end
|
11
|
+
|
12
|
+
def scoped_project
|
13
|
+
@@scoped_project = PivotPro::Configuration.scoped_project
|
14
|
+
end
|
15
|
+
|
16
|
+
def scoped_project_name
|
17
|
+
authenticate
|
18
|
+
Pivotal::Project.find(scoped_project).name
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module PivotPro
|
2
|
+
module Configuration
|
3
|
+
extend self
|
4
|
+
attr_accessor :options
|
5
|
+
@options = {}
|
6
|
+
|
7
|
+
def scoped_project
|
8
|
+
options[:scoped_project] # ||= File.open(YAML)
|
9
|
+
end
|
10
|
+
|
11
|
+
def scoped_project_name
|
12
|
+
options[:scoped_project_name] ||= Pivotal::Project.find(scoped_project).name
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module PivotPro
|
2
|
+
class Delegator < PivotPro::Base
|
3
|
+
|
4
|
+
def self.run(args=[])
|
5
|
+
unless args.empty?
|
6
|
+
PivotPro::Configuration.options[:scoped_project] = (args[args.index("--project")+1] rescue nil)
|
7
|
+
case args[0]
|
8
|
+
when /^list/
|
9
|
+
PivotPro::User.print_projects
|
10
|
+
when /^stories:?(.*)/
|
11
|
+
($1.blank? || STORY_TYPES.include?($1)) ? PivotPro::User.print_stories($1) : print_usage
|
12
|
+
else
|
13
|
+
print_usage
|
14
|
+
end
|
15
|
+
else
|
16
|
+
print_usage
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.print_usage
|
21
|
+
puts %q{
|
22
|
+
=== General Commands
|
23
|
+
|
24
|
+
help # show this usage
|
25
|
+
list # list your PivotalTracker projects
|
26
|
+
|
27
|
+
=== App Commands (execute inside a checkout directory, or use --project <id>
|
28
|
+
|
29
|
+
stories # list all stories associated with this project
|
30
|
+
stories:features # list all stories that are features
|
31
|
+
stories:bugs # list all stories that are bugs
|
32
|
+
stories:releases # list all stories that are releases
|
33
|
+
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module PivotPro
|
2
|
+
class User < PivotPro::Base
|
3
|
+
|
4
|
+
class << self
|
5
|
+
|
6
|
+
def projects
|
7
|
+
authenticate
|
8
|
+
Pivotal::Project.find(:all)
|
9
|
+
end
|
10
|
+
|
11
|
+
def stories(conditions)
|
12
|
+
authenticate
|
13
|
+
returnable = Pivotal::Project.find(scoped_project).stories
|
14
|
+
conditions.blank? ? returnable : returnable.select{|x|x.story_type==conditions.singularize}
|
15
|
+
end
|
16
|
+
|
17
|
+
def print_projects
|
18
|
+
puts "Project".ljust(40)+"ID"
|
19
|
+
puts "="*45
|
20
|
+
projects.each do |p|
|
21
|
+
puts p.name.ljust(40)+p.id
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def print_stories(conditions)
|
26
|
+
l=(m="#{conditions.blank? ? "Stories" : conditions.singularize.capitalize+" stories"} for #{scoped_project_name}").length
|
27
|
+
puts m
|
28
|
+
puts "="*l
|
29
|
+
stories(conditions).each do |s|
|
30
|
+
puts s.name
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
data/lib/pivotpro.rb
ADDED
data/pivotpro.gemspec
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{pivotpro}
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Kevin Gisi"]
|
12
|
+
s.date = %q{2009-08-12}
|
13
|
+
s.default_executable = %q{pivotpro}
|
14
|
+
s.description = %q{RubyGem to interface with PivotalTracker, relying on PivotalRecord}
|
15
|
+
s.email = %q{kevin.gisi@gmail.com}
|
16
|
+
s.executables = ["pivotpro"]
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE",
|
19
|
+
"README.rdoc"
|
20
|
+
]
|
21
|
+
s.files = [
|
22
|
+
".document",
|
23
|
+
".gitignore",
|
24
|
+
"LICENSE",
|
25
|
+
"README.rdoc",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"bin/pivotpro",
|
29
|
+
"lib/pivotpro.rb",
|
30
|
+
"lib/pivotpro/base.rb",
|
31
|
+
"lib/pivotpro/configuration.rb",
|
32
|
+
"lib/pivotpro/delegator.rb",
|
33
|
+
"lib/pivotpro/project.rb",
|
34
|
+
"lib/pivotpro/user.rb",
|
35
|
+
"pivotpro.gemspec",
|
36
|
+
"test/pivotpro_test.rb",
|
37
|
+
"test/test_helper.rb"
|
38
|
+
]
|
39
|
+
s.homepage = %q{http://github.com/gisikw/pivotpro}
|
40
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
41
|
+
s.require_paths = ["lib"]
|
42
|
+
s.rubygems_version = %q{1.3.3}
|
43
|
+
s.summary = %q{RubyGem to interface with PivotalTracker}
|
44
|
+
s.test_files = [
|
45
|
+
"test/pivotpro_test.rb",
|
46
|
+
"test/test_helper.rb"
|
47
|
+
]
|
48
|
+
|
49
|
+
if s.respond_to? :specification_version then
|
50
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
51
|
+
s.specification_version = 3
|
52
|
+
|
53
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
54
|
+
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
55
|
+
else
|
56
|
+
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
57
|
+
end
|
58
|
+
else
|
59
|
+
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
60
|
+
end
|
61
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gisikw-pivotpro
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kevin Gisi
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-08-12 00:00:00 -07:00
|
13
|
+
default_executable: pivotpro
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: thoughtbot-shoulda
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
25
|
+
description: RubyGem to interface with PivotalTracker, relying on PivotalRecord
|
26
|
+
email: kevin.gisi@gmail.com
|
27
|
+
executables:
|
28
|
+
- pivotpro
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files:
|
32
|
+
- LICENSE
|
33
|
+
- README.rdoc
|
34
|
+
files:
|
35
|
+
- .document
|
36
|
+
- .gitignore
|
37
|
+
- LICENSE
|
38
|
+
- README.rdoc
|
39
|
+
- Rakefile
|
40
|
+
- VERSION
|
41
|
+
- bin/pivotpro
|
42
|
+
- lib/pivotpro.rb
|
43
|
+
- lib/pivotpro/base.rb
|
44
|
+
- lib/pivotpro/configuration.rb
|
45
|
+
- lib/pivotpro/delegator.rb
|
46
|
+
- lib/pivotpro/project.rb
|
47
|
+
- lib/pivotpro/user.rb
|
48
|
+
- pivotpro.gemspec
|
49
|
+
- test/pivotpro_test.rb
|
50
|
+
- test/test_helper.rb
|
51
|
+
has_rdoc: false
|
52
|
+
homepage: http://github.com/gisikw/pivotpro
|
53
|
+
licenses:
|
54
|
+
post_install_message:
|
55
|
+
rdoc_options:
|
56
|
+
- --charset=UTF-8
|
57
|
+
require_paths:
|
58
|
+
- lib
|
59
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: "0"
|
64
|
+
version:
|
65
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: "0"
|
70
|
+
version:
|
71
|
+
requirements: []
|
72
|
+
|
73
|
+
rubyforge_project:
|
74
|
+
rubygems_version: 1.3.5
|
75
|
+
signing_key:
|
76
|
+
specification_version: 3
|
77
|
+
summary: RubyGem to interface with PivotalTracker
|
78
|
+
test_files:
|
79
|
+
- test/pivotpro_test.rb
|
80
|
+
- test/test_helper.rb
|