Skip to content

Commit

Permalink
Finished up the Trac Services Hook
Browse files Browse the repository at this point in the history
  • Loading branch information
davglass authored and pjhyett committed Jan 13, 2009
1 parent 1e9479f commit 645cee6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions docs/trac
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ Trac
Make sure that you installed the github-trac plugin from here:
http://github.com/davglass/github-trac/

Now put the URL of your trac project in the above field.
Please supply a link to your Trac project and your API Token.
(NOTE: The API Token provided needs to be the same that you put in your trac.ini)



It searches commit messages for text in the form of:

The plugin searches commit messages for text in the form of:
command #1
command #1, #2
command #1 & #2
Expand Down
10 changes: 6 additions & 4 deletions services/trac.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
service :trac do |data, payload|
url = URI.parse(data['url'])
# Need to get the GitHub API Token here..
api_token = "NEED TO GET THIS.."
url = data['url']
# This is the API Token that is set in your trac.ini
api_token = data['apitoken']
# Build the URL
url = "#{url}/github/#{api_token}"
# This should build a URL like this:
# http://yourserver.com/projects/myapp/github/APITOKEN
url = URI.join(url, "/github/", api_token)
# Send the request..
Net::HTTP.post_form(url, payload)
end

0 comments on commit 645cee6

Please sign in to comment.