hone-pivotal-tracker 0.0.3 → 0.0.4

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -0,0 +1,28 @@
1
+ class Note
2
+ include HappyMapper
3
+ element :id, Integer
4
+ element :text, String
5
+ element :author, String
6
+ element :noted_at, DateTime
7
+ has_one :story, Story
8
+
9
+ def initialize(attributes = {})
10
+ attributes.each do |key, value|
11
+ send("#{key}=", value)
12
+ end
13
+ end
14
+
15
+ def to_xml(options = {})
16
+ builder = Builder::XmlMarkup.new(options)
17
+ builder.story do |story|
18
+ Note.elements.each do |element_type|
19
+ element = send(element_type.name)
20
+ eval("story.#{element_type.name}(\"#{element.to_s.gsub("\"", "\\\"")}\")") if element
21
+ end
22
+ end
23
+ end
24
+
25
+ def to_param
26
+ id.to_s
27
+ end
28
+ end
@@ -12,6 +12,7 @@ class Story
12
12
  element :created_at, DateTime
13
13
  element :accepted_at, DateTime
14
14
  element :labels, String
15
+ element :description, String
15
16
  has_one :iteration, Iteration
16
17
 
17
18
  def initialize(attributes = {})
@@ -13,6 +13,7 @@ require 'pivotal-tracker/extensions'
13
13
  require 'pivotal-tracker/project'
14
14
  require 'pivotal-tracker/story'
15
15
  require 'pivotal-tracker/iteration'
16
+ require 'pivotal-tracker/note'
16
17
 
17
18
  class PivotalTracker
18
19
  def initialize(project_id, token, options = {})
@@ -20,8 +21,8 @@ class PivotalTracker
20
21
 
21
22
  @base_url = "http://www.pivotaltracker.com/services/v2"
22
23
  @base_url.gsub! 'http', 'https' if options[:use_ssl]
23
- end
24
-
24
+ end
25
+
25
26
  def project
26
27
  response = project_resource.get
27
28
  Project.parse(response)
@@ -32,6 +33,11 @@ class PivotalTracker
32
33
  Story.parse(response)
33
34
  end
34
35
 
36
+ def notes(id)
37
+ response = story_resource(id)["/notes"].get
38
+ Note.parse(response)
39
+ end
40
+
35
41
  def current_iteration
36
42
  response = iterations_resource("/current").get
37
43
  Iteration.parse(response).first
@@ -98,7 +104,9 @@ class PivotalTracker
98
104
 
99
105
  def coerce_to_filter(object)
100
106
  case object
101
- when String, Integer,NilClass
107
+ when String
108
+ object
109
+ when Integer,NilClass
102
110
  object.to_s.inspect
103
111
  when Hash
104
112
  object.collect do |key, value|
@@ -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.3"
8
+ s.version = "0.0.4"
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-08-20}
12
+ s.date = %q{2009-08-29}
13
13
  s.email = %q{justin.smestad@gmail.com}
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE",
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
25
25
  "lib/pivotal-tracker.rb",
26
26
  "lib/pivotal-tracker/extensions.rb",
27
27
  "lib/pivotal-tracker/iteration.rb",
28
+ "lib/pivotal-tracker/note.rb",
28
29
  "lib/pivotal-tracker/project.rb",
29
30
  "lib/pivotal-tracker/story.rb",
30
31
  "pivotal-tracker.gemspec",
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.3
4
+ version: 0.0.4
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-08-20 00:00:00 -07:00
14
+ date: 2009-08-29 00:00:00 -07:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
@@ -53,6 +53,7 @@ files:
53
53
  - lib/pivotal-tracker.rb
54
54
  - lib/pivotal-tracker/extensions.rb
55
55
  - lib/pivotal-tracker/iteration.rb
56
+ - lib/pivotal-tracker/note.rb
56
57
  - lib/pivotal-tracker/project.rb
57
58
  - lib/pivotal-tracker/story.rb
58
59
  - pivotal-tracker.gemspec