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

Delta Between Two Patch Sets: lib/appengine-tools/genxml.rb

Issue 89083: Start the appengine-tools gem (Closed) SVN Base: http://appengine-jruby.googlecode.com/svn/trunk/appengine-tools/
Left Patch Set: Some cleanups to follow the style guide. Created 5 months ago
Right 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
1 #!/usr/bin/ruby1.8 -w 1 #!/usr/bin/ruby1.8 -w
2 # 2 #
3 # Copyright:: Copyright 2009 Google Inc. 3 # Copyright:: Copyright 2009 Google Inc.
4 # Original Author:: Ryan Brown (mailto:ribrdb@google.com) 4 # Original Author:: Ryan Brown (mailto:ribrdb@google.com)
5 # 5 #
6 # Licensed under the Apache License, Version 2.0 (the "License"); 6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with 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 8 # You may obtain a copy of the License at
9 # 9 #
10 # http://www.apache.org/licenses/LICENSE-2.0 10 # http://www.apache.org/licenses/LICENSE-2.0
11 # 11 #
12 # Unless required by applicable law or agreed to in writing, software 12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS, 13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and 15 # See the License for the specific language governing permissions and
16 # limitations under the License. 16 # limitations under the License.
17 17
18 require 'appengine-tools/web-xml' 18 require 'appengine-tools/web-xml'
19 require 'appengine-tools/rack' 19 require 'appengine-tools/rack'
20 require 'appengine-tools/xml-formatter'
20 21
21 Dir.mkdir('WEB-INF') unless File.exists?('WEB-INF') 22 Dir.mkdir('WEB-INF') unless File.exists?('WEB-INF')
woodie 2009/07/02 03:33:09 this is now handled inside the write methods (whic
ribrdb 2009/07/02 22:32:15 On 2009/07/02 03:33:09, mando.woodie wrote: > this
22 rackup = File.read('config.ru') 23 rackup = File.read('config.ru')
23 builder = WebXmlBuilder.new do 24 builder = WebXmlBuilder.new do
24 eval rackup, nil, 'config.ru', 1 25 eval rackup, nil, 'config.ru', 1
25 end 26 end
26 builder.write 27 open('WEB-INF/web.xml', 'w') do |webxml|
28 xml = AppEngine::Rack::XmlFormatter.format(builder.to_xml)
29 webxml.write(xml)
30 end
27 open('WEB-INF/appengine-web.xml', 'w') do |aeweb| 31 open('WEB-INF/appengine-web.xml', 'w') do |aeweb|
28 aeweb.write(AppEngine::Rack.app.to_xml) 32 xml = AppEngine::Rack::XmlFormatter.format(AppEngine::Rack.app.to_xml)
woodie 2009/07/02 03:33:09 write doesn't take any arguments, even in your ver
ribrdb 2009/07/02 22:32:15 I'm actually calling write on the file. This must
33 aeweb.write(xml)
29 end 34 end
LEFTRIGHT

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