class Hookers::Pivotal::TrackerProject
Attributes
base_uri[RW]
git[RW]
token[RW]
Public Class Methods
new(token)
click to toggle source
# File lib/hookers/pivotal/tracker_project.rb, line 8 def initialize(token) raise "Pivotal api token not found" unless token self.token = token self.git = Git::Repository.new self.base_uri = 'http://www.pivotaltracker.com/' end
Public Instance Methods
commit_uri()
click to toggle source
# File lib/hookers/pivotal/tracker_project.rb, line 15 def commit_uri "#{self.base_uri}services/v3/source_commits" end
notify_changes()
click to toggle source
# File lib/hookers/pivotal/tracker_project.rb, line 19 def notify_changes puts "Notifying pivotal tracker of changes..." commit = git.last_commit response = HttpClient.post(commit_uri, commit.to_xml, { "X-TrackerToken" => self.token, "Content-type" => "application/xml" }) puts "Pivotal notified succesfully" if response.code == "200" end