correctly indent xml

This commit is contained in:
danielvincent 2010-10-05 16:40:50 -07:00
parent 11857a9308
commit 6723a51149
2 changed files with 26 additions and 26 deletions

View file

@ -24,35 +24,35 @@ module Diaspora
end
def create_headers
<<-XML.strip
<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:georss="http://www.georss.org/georss" xmlns:activity="http://activitystrea.ms/spec/1.0/" xmlns:media="http://purl.org/syndication/atommedia" xmlns:poco="http://portablecontacts.net/spec/1.0" xmlns:ostatus="http://ostatus.org/schema/1.0" xmlns:statusnet="http://status.net/schema/api/1/">
<generator uri="http://joindiaspora.com/">Diaspora</generator>
<id>#{@user.public_url}</id>
<title>#{@user.real_name}'s Public Feed</title>
<subtitle>its a stream</subtitle>
<updated>#{Time.now.xmlschema}</updated>
<author>
<<-XML
<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:georss="http://www.georss.org/georss" xmlns:activity="http://activitystrea.ms/spec/1.0/" xmlns:media="http://purl.org/syndication/atommedia" xmlns:poco="http://portablecontacts.net/spec/1.0" xmlns:ostatus="http://ostatus.org/schema/1.0" xmlns:statusnet="http://status.net/schema/api/1/">
<generator uri="http://joindiaspora.com/">Diaspora</generator>
<id>#{@user.public_url}</id>
<title>#{@user.real_name}'s Public Feed</title>
<subtitle>its a stream</subtitle>
<updated>#{Time.now.xmlschema}</updated>
<author>
<name>#{@user.real_name}</name>
<uri>#{@user.public_url}</uri>
</author>
</author>
XML
end
def create_endpoints
<<-XML
<link href="#{APP_CONFIG[:pubsub_server]}" rel="hub"/>
<link href="#{APP_CONFIG[:pubsub_server]}" rel="hub"/>
XML
end
def create_subject
<<-XML
<activity:subject>
<activity:subject>
<activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
<id>#{@user.public_url}</id>
<title>#{@user.real_name}</title>
<link rel="alternative" type="text/html" href="#{@user.public_url}"/>
</activity:subject>
</activity:subject>
XML
end
@ -70,7 +70,7 @@ module Diaspora
def create_footer
<<-XML
</feed>
</feed>
XML
end
end