roman-pivotal-tracker-api 0.0.1
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/LICENSE +20 -0
- data/README.rdoc +28 -0
- data/lib/pivotal_tracker.rb +48 -0
- data/lib/pivotal_tracker_api.rb +1 -0
- metadata +67 -0
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Roman Gonzalez
|
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,28 @@
|
|
1
|
+
= pivotal-tracker-api
|
2
|
+
|
3
|
+
No brainer wrapper for using the PivotalTracker API.
|
4
|
+
|
5
|
+
Start with declaring the token.
|
6
|
+
|
7
|
+
Pivotal.token = 'TOKEN'
|
8
|
+
|
9
|
+
Then just use the classes provided by Pivotal
|
10
|
+
|
11
|
+
== Querying:
|
12
|
+
projects = Pivotal::Project.find(:all)
|
13
|
+
|
14
|
+
projects[0].stories
|
15
|
+
|
16
|
+
Pivotal::Stories.find(:all, :params => { :project_id => '123' })
|
17
|
+
|
18
|
+
== Saving:
|
19
|
+
projects[1].destroy
|
20
|
+
|
21
|
+
== Updating
|
22
|
+
projects[2].name = "My New Project Name"
|
23
|
+
|
24
|
+
projects[2].save
|
25
|
+
|
26
|
+
== Copyright
|
27
|
+
|
28
|
+
Copyright (c) 2009 Roman Gonzalez. See LICENSE for details.
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require "activeresource"
|
2
|
+
|
3
|
+
|
4
|
+
module Pivotal
|
5
|
+
|
6
|
+
class << self
|
7
|
+
|
8
|
+
def resources
|
9
|
+
@resources ||= []
|
10
|
+
end
|
11
|
+
|
12
|
+
def token=(token)
|
13
|
+
@token = token
|
14
|
+
add_token_to_resources
|
15
|
+
end
|
16
|
+
|
17
|
+
protected
|
18
|
+
|
19
|
+
def add_token_to_resources
|
20
|
+
resources.each do |resource|
|
21
|
+
resource.headers['X-TrackerToken'] = @token
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
end # class << self
|
26
|
+
|
27
|
+
class Base < ActiveResource::Base
|
28
|
+
|
29
|
+
def self.inherited(child)
|
30
|
+
Pivotal.resources << child
|
31
|
+
super
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
class Project < Base
|
37
|
+
self.site = "http://www.pivotaltracker.com/services/v2/"
|
38
|
+
|
39
|
+
def stories(options = {})
|
40
|
+
Story.find(:all, :params => options.update(:project_id => id))
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
class Story < Base
|
45
|
+
self.site = "http://www.pivotaltracker.com/services/v2/projects/:project_id"
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'pivotal_tracker')
|
metadata
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: roman-pivotal-tracker-api
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Roman Gonzalez
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-03-12 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: activeresource
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ~>
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 2.2.2
|
24
|
+
version:
|
25
|
+
description:
|
26
|
+
email: romanandreg@gmail.com
|
27
|
+
executables: []
|
28
|
+
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files:
|
32
|
+
- README.rdoc
|
33
|
+
- LICENSE
|
34
|
+
files:
|
35
|
+
- lib/pivotal_tracker.rb
|
36
|
+
- lib/pivotal_tracker_api.rb
|
37
|
+
- README.rdoc
|
38
|
+
- LICENSE
|
39
|
+
has_rdoc: true
|
40
|
+
homepage: http://github.com/roman/pivotal-tracker-api
|
41
|
+
post_install_message:
|
42
|
+
rdoc_options:
|
43
|
+
- --inline-source
|
44
|
+
- --charset=UTF-8
|
45
|
+
require_paths:
|
46
|
+
- lib
|
47
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: "0"
|
52
|
+
version:
|
53
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: "0"
|
58
|
+
version:
|
59
|
+
requirements: []
|
60
|
+
|
61
|
+
rubyforge_project:
|
62
|
+
rubygems_version: 1.2.0
|
63
|
+
signing_key:
|
64
|
+
specification_version: 2
|
65
|
+
summary: Ruby Library for interacting with PivotalTracker API
|
66
|
+
test_files: []
|
67
|
+
|