hone-pivotal-tracker 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/pivotal-tracker.rb +21 -0
- data/lib/pivotal-tracker/note.rb +2 -2
- data/lib/pivotal-tracker/task.rb +38 -0
- data/pivotal-tracker.gemspec +3 -2
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
data/lib/pivotal-tracker.rb
CHANGED
@@ -8,12 +8,14 @@ require 'cgi'
|
|
8
8
|
class Story; end
|
9
9
|
class Iteration; end
|
10
10
|
class Project; end
|
11
|
+
class Note; end
|
11
12
|
|
12
13
|
require 'pivotal-tracker/extensions'
|
13
14
|
require 'pivotal-tracker/project'
|
14
15
|
require 'pivotal-tracker/story'
|
15
16
|
require 'pivotal-tracker/iteration'
|
16
17
|
require 'pivotal-tracker/note'
|
18
|
+
require 'pivotal-tracker/task'
|
17
19
|
|
18
20
|
class PivotalTracker
|
19
21
|
def initialize(project_id, token, options = {})
|
@@ -38,10 +40,29 @@ class PivotalTracker
|
|
38
40
|
Note.parse(response)
|
39
41
|
end
|
40
42
|
|
43
|
+
def tasks(id)
|
44
|
+
response = story_resource(id)["/tasks"].get
|
45
|
+
Task.parse(response)
|
46
|
+
end
|
47
|
+
|
41
48
|
def create_note(id, note)
|
42
49
|
story_resource(id)["/notes"].post note.to_xml
|
43
50
|
end
|
44
51
|
|
52
|
+
def create_task(id, task)
|
53
|
+
story_resource(id)["/tasks"].post task.to_xml
|
54
|
+
end
|
55
|
+
|
56
|
+
def find_task(story_id, task_id)
|
57
|
+
response = story_resource(story_id)["/tasks/#{task_id}"].get
|
58
|
+
Task.parse(response)
|
59
|
+
end
|
60
|
+
|
61
|
+
def update_task(story_id, task)
|
62
|
+
task_id = task.id
|
63
|
+
story_resource(id)["/tasks/#{task_id}"].put task.to_xml
|
64
|
+
end
|
65
|
+
|
45
66
|
def current_iteration
|
46
67
|
response = iterations_resource("/current").get
|
47
68
|
Iteration.parse(response).first
|
data/lib/pivotal-tracker/note.rb
CHANGED
@@ -14,10 +14,10 @@ class Note
|
|
14
14
|
|
15
15
|
def to_xml(options = {})
|
16
16
|
builder = Builder::XmlMarkup.new(options)
|
17
|
-
builder.note do |
|
17
|
+
builder.note do |note|
|
18
18
|
Note.elements.each do |element_type|
|
19
19
|
element = send(element_type.name)
|
20
|
-
eval("
|
20
|
+
eval("note.#{element_type.name}(\"#{element.to_s.gsub("\"", "\\\"")}\")") if element
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
=begin
|
2
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
3
|
+
<task>
|
4
|
+
<id type="integer">TASK_ID</id>
|
5
|
+
<description>find shields</description>
|
6
|
+
<position>1</position>
|
7
|
+
<complete>false</complete>
|
8
|
+
<created_at type="datetime">2008/12/10 00:00:00 UTC</created_at>
|
9
|
+
</task>
|
10
|
+
=end
|
11
|
+
class Task
|
12
|
+
include HappyMapper
|
13
|
+
element :id, Integer
|
14
|
+
element :description, String
|
15
|
+
element :position, Integer
|
16
|
+
element :complete, Boolean
|
17
|
+
element :created_at, DateTime
|
18
|
+
|
19
|
+
def initialize(attributes = {})
|
20
|
+
attributes.each do |key, value|
|
21
|
+
send("#{key}=", value)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def to_xml(options = {})
|
26
|
+
builder = Builder::XmlMarkup.new(options)
|
27
|
+
builder.task do |task|
|
28
|
+
Task.elements.each do |element_type|
|
29
|
+
element = send(element_type.name)
|
30
|
+
eval("task.#{element_type.name}(\"#{element.to_s.gsub("\"", "\\\"")}\")") if element
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def to_param
|
36
|
+
id.to_s
|
37
|
+
end
|
38
|
+
end
|
data/pivotal-tracker.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{pivotal-tracker}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Justin Smestad", "Josh Nichols", "Terence Lee"]
|
12
|
-
s.date = %q{2009-
|
12
|
+
s.date = %q{2009-09-09}
|
13
13
|
s.email = %q{justin.smestad@gmail.com}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"LICENSE",
|
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
|
|
28
28
|
"lib/pivotal-tracker/note.rb",
|
29
29
|
"lib/pivotal-tracker/project.rb",
|
30
30
|
"lib/pivotal-tracker/story.rb",
|
31
|
+
"lib/pivotal-tracker/task.rb",
|
31
32
|
"pivotal-tracker.gemspec",
|
32
33
|
"test/extensions_test.rb",
|
33
34
|
"test/pivotal_tracker_test.rb",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hone-pivotal-tracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Smestad
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2009-
|
14
|
+
date: 2009-09-09 00:00:00 -07:00
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
@@ -56,13 +56,13 @@ files:
|
|
56
56
|
- lib/pivotal-tracker/note.rb
|
57
57
|
- lib/pivotal-tracker/project.rb
|
58
58
|
- lib/pivotal-tracker/story.rb
|
59
|
+
- lib/pivotal-tracker/task.rb
|
59
60
|
- pivotal-tracker.gemspec
|
60
61
|
- test/extensions_test.rb
|
61
62
|
- test/pivotal_tracker_test.rb
|
62
63
|
- test/test_helper.rb
|
63
64
|
has_rdoc: true
|
64
65
|
homepage: http://github.com/jsmestad/pivotal-tracker
|
65
|
-
licenses:
|
66
66
|
post_install_message:
|
67
67
|
rdoc_options:
|
68
68
|
- --charset=UTF-8
|
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
requirements: []
|
84
84
|
|
85
85
|
rubyforge_project:
|
86
|
-
rubygems_version: 1.
|
86
|
+
rubygems_version: 1.2.0
|
87
87
|
signing_key:
|
88
88
|
specification_version: 2
|
89
89
|
summary: Ruby wrapper for the Pivotal Tracker API
|