Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(89)

Side by Side Diff: lib/appengine-tools/xml-formatter.rb

Issue 89083: Start the appengine-tools gem (Closed) SVN Base: http://appengine-jruby.googlecode.com/svn/trunk/appengine-tools/
Patch Set: Clean up xml formatting. Created 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/ruby1.8 -w
2 #
3 # Copyright:: Copyright 2009 Google Inc.
4 # Original Author:: Ryan Brown (mailto:ribrdb@google.com)
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17
18 require 'rexml/formatters/pretty'
19
20 module AppEngine
21 module Rack
22 class XmlFormatter < REXML::Formatters::Pretty
23 def initialize
24 @compact = true
25 super
26 end
27
28 def write_text( node, output )
29 output << node.to_s()
30 end
31
32 def self.format(xml)
33 @formatter ||= XmlFormatter.new
34 output = ''
35 @formatter.write(xml, output)
36 return output
37 end
38 end
39 end
40 end
OLDNEW

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld r497