lib/provider/project.rb in ticketmaster-pivotal-0.5.1 vs lib/provider/project.rb in ticketmaster-pivotal-0.6.2
- old
+ new
@@ -14,33 +14,35 @@
# + find(:first, :name => <project_name>) - Returns the first project based on the attribute
# + find(:name => <project name>) - Returns all projects based on the attribute
attr_accessor :prefix_options
alias_method :stories, :tickets
alias_method :story, :ticket
-
+
# Save this project
def save
warn 'Warning: Pivotal does not allow editing of project attributes. This method does nothing.'
true
end
-
+
def initialize(*options)
super(*options)
self.id = self.id.to_i
end
-
+
# Delete this project
def destroy
result = self.system_data[:client].destroy
result.is_a?(Net::HTTPOK)
end
def ticket!(*options)
if options.first.is_a?(Hash)
options[0].merge!(:project_id => id)
title = options[0].delete('title') || options[0].delete(:title) || options[0].delete(:summary) || options[0].delete('summary')
+ description = options[0].delete('body') || options[0].delete(:body)
options[0][:name] = title
+ options[0][:description] = description
warn("Pivotal Tracker requires a title or name for the story") if options[0][:name].blank? and options[0]['name'].blank?
end
provider_parent(self.class)::Ticket.create(*options)
end
@@ -52,9 +54,9 @@
copy_ticket.comment!(:text => comment.body)
sleep 1
end
end
end
-
+
end
end
end