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

@ -13,12 +13,12 @@ class StatusMessage < Post
def to_activity def to_activity
<<-XML <<-XML
<entry> <entry>
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb> <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
<title>#{self.message}</title> <title>#{self.message}</title>
<link rel="alternate" type="text/html" href="#{person.url}status_messages/#{self.id}"/> <link rel="alternate" type="text/html" href="#{person.url}status_messages/#{self.id}"/>
<id>#{person.url}status_messages/#{self.id}</id> <id>#{person.url}status_messages/#{self.id}</id>
<published>#{self.created_at.xmlschema}</published> <published>#{self.created_at.xmlschema}</published>
<updated>#{self.updated_at.xmlschema}</updated> <updated>#{self.updated_at.xmlschema}</updated>
</entry> </entry>
XML XML
end end

View file

@ -24,35 +24,35 @@ module Diaspora
end end
def create_headers def create_headers
<<-XML.strip <<-XML
<?xml version="1.0" encoding="UTF-8"?> <?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/"> <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> <generator uri="http://joindiaspora.com/">Diaspora</generator>
<id>#{@user.public_url}</id> <id>#{@user.public_url}</id>
<title>#{@user.real_name}'s Public Feed</title> <title>#{@user.real_name}'s Public Feed</title>
<subtitle>its a stream</subtitle> <subtitle>its a stream</subtitle>
<updated>#{Time.now.xmlschema}</updated> <updated>#{Time.now.xmlschema}</updated>
<author> <author>
<name>#{@user.real_name}</name> <name>#{@user.real_name}</name>
<uri>#{@user.public_url}</uri> <uri>#{@user.public_url}</uri>
</author> </author>
XML XML
end end
def create_endpoints def create_endpoints
<<-XML <<-XML
<link href="#{APP_CONFIG[:pubsub_server]}" rel="hub"/> <link href="#{APP_CONFIG[:pubsub_server]}" rel="hub"/>
XML XML
end end
def create_subject def create_subject
<<-XML <<-XML
<activity:subject> <activity:subject>
<activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type> <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
<id>#{@user.public_url}</id> <id>#{@user.public_url}</id>
<title>#{@user.real_name}</title> <title>#{@user.real_name}</title>
<link rel="alternative" type="text/html" href="#{@user.public_url}"/> <link rel="alternative" type="text/html" href="#{@user.public_url}"/>
</activity:subject> </activity:subject>
XML XML
end end
@ -70,7 +70,7 @@ module Diaspora
def create_footer def create_footer
<<-XML <<-XML
</feed> </feed>
XML XML
end end
end end