Created
October 21, 2009 13:09
-
-
Save woodie/215090 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# requires Rubygems 1.3.5, using JRuby 1.4.0 | |
jruby -S gem bundle | |
cd .gems | |
jar -cf ../WEB-INF/lib/gems.jar bundler_gems | |
cd .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# bundle everything into .gems (won't be uploaded) | |
disable_rubygems | |
bundle_path '.gems/bundler_gems' | |
gem "rack", "1.0.0" | |
gem "dm-appengine" | |
gem "sinatra" | |
gem "haml" | |
. . . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load gems from the jar file | |
require 'bundler_gems/environment' | |
require 'sinatra' | |
require 'dm-core' | |
require 'haml' | |
configure do | |
DataMapper.setup(:default, "appengine://auto") | |
end | |
. . . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In the Gemfile, I set the bundle_path to ".gems/bundler_gems", | |
then I require "bundler_gems/environment" from inside my app. | |
This way my app only loads the environment.rb from my jar file. | |
When I jar it all up, I skip the ".gems" dir, starting one dir lower. | |
When people say disable_rubygems, we can assume they want | |
us to toss the rubygems jar. I have no idea how we keep people | |
from messing with the defaults. Maybe we generate a Gemfile, | |
with some instructions, and a terse explainaton on the system | |
config.ru | |
guestbook.rb | |
bundle.sh # will be replaced by appcfg.rb gem | |
Gemfile | |
.gems # skipped during upload process | |
WEB-INF | |
|-- web.xml | |
|-- appengine-web.xml | |
`--lib | |
|-- appengine-jruby-0.0.5.jar | |
|-- jruby-rack-0.9.5.jar | |
|-- gems.jar | |
`-- appengine-api-1.0-sdk-1.2.6.jar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment