Skip to content

Commit

Permalink
remove whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
technoweenie committed Mar 21, 2011
1 parent ee513a3 commit 520bec4
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions services/unfuddle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
repository = payload['repository']['name']
branch = payload['ref_name']
before = payload['before']

# setup
uri = URI.parse(u_account)
http = Net::HTTP.new(uri.host, uri.port)

# grab people data for matching author-id
begin
req = Net::HTTP::Get.new('/api/v1/people.json')
Expand All @@ -29,7 +29,7 @@
commit_id = commit['id']
message = "#{commit['message']}\n#{commit['url']}"
files = commit['removed'] | commit['added'] | commit['modified']

# set Unfuddles's correct changeset association by getting the matching
# author-id
author_id = 0
Expand All @@ -39,15 +39,15 @@
break
end
end

if author_id > 0
author_id_element = "<author-id type=\"integer\">#{author_id}</author-id>"
committer_id_element = "<committer-id type=\"integer\">#{author_id}</committer-id>"
else
author_id_element = ""
committer_id_element = ""
end

changeset_xml = <<-XML.strip
<changeset>
#{author_id_element}
Expand All @@ -63,7 +63,7 @@
<revision>#{CGI.escapeHTML(commit_id)}</revision>
</changeset>
XML

begin
url = URI.parse("%s/api/v1/repositories/%d/changesets.json" % [u_account, u_repoid.to_i])
req = Net::HTTP::Post.new(url.path)
Expand All @@ -87,7 +87,5 @@
rescue URI::InvalidURIError
raise GitHub::ServiceConfigurationError, "Invalid Unfuddle repository id: #{data['u_repoid']}"
end

end

end
end

0 comments on commit 520bec4

Please sign in to comment.