Skip to content

Instantly share code, notes, and snippets.

@woodie
Created December 5, 2009 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save woodie/249844 to your computer and use it in GitHub Desktop.
Save woodie/249844 to your computer and use it in GitHub Desktop.
Rails 3 on App Engine - from hg files
#!/usr/bin/ruby
require 'rubygems'
file_base = 'http://appengine-jruby.googlecode.com/hg/demos/rails/'
mod_files = %w{ app/controllers/rails/info_controller.rb
Gemfile config/application_rb config/boot.rb
config/initializers/notifications.rb config_ru }
# Install apengine gems if missing
gems_index = Gem::SourceIndex.from_gems_in('local')
unless gems_index.find_name('google-appengine', '>=0.0.6')
run 'gem install google-appengine', :sudo => true
end
system "curl -O #{file_base}Gemfile"
system 'appcfg.rb bundle . --update'
system 'appcfg.rb run bin/rails .' # answer yes to all
mod_files.each do |path|
system "curl -o #{path} #{file_base}#{path}"
end
# TODO: prepend confir_ru to config.ru
# TODO: insert config/application_rb into config/application.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment