lib/appengine-tools/gem_bundler.rb in appengine-tools-0.0.5 vs lib/appengine-tools/gem_bundler.rb in appengine-tools-0.0.6
- old
+ new
@@ -65,20 +65,22 @@
exit e.exit_code unless e.exit_code == 0
end
bundler_dir = "#{app.gems_dir}/bundler_gems"
# TODO: this temporary hack should be fixed properly
gem_patch = <<MOD
-# Injected by appengine-tools to patch bundler 0.6.0 for Sinatra 0.9.4
+# Injected by appengine-tools to patch bundler for Sinatra and Rails 3
module Gem
- def self.dir; ENV['GEM_HOME']; end
- RubyGemsVersion = "0.0.0" unless defined? RubyGemsVersion
+ def self.default_dir; ENV['GEM_HOME']; end
+ def self.dir; ENV['GEM_HOME']; end
+ def self.path; ENV['GEM_PATH']; end
end
MOD
File.open("#{bundler_dir}/environment.rb",'a') {|f| f << gem_patch }
FileUtils.rm app.gems_jar, :force => true # blow away the old jar
- puts "=> Installing gems"
+ puts "=> Packaging gems"
gem_files = Dir["#{bundler_dir}/gems/**/**"] +
+ Dir["#{bundler_dir}/dirs/**/**"] +
Dir["#{bundler_dir}/environment.rb"]
Zip::ZipFile.open(app.gems_jar, 'w') do |jar|
gem_files.reject {|f| f == app.gems_jar}.each do |file|
jar.add(file.sub("#{app.gems_dir}/",''), file)
end
@@ -96,10 +98,10 @@
disable_system_gems
disable_rubygems
bundle_path ".gems/bundler_gems"
# List gems to bundle here:
-#gem "rack", "1.0.0"
+gem "appengine-rack"
#gem "dm-appengine"
#gem "sinatra"
EOF
File.open(app.gemfile,'w') {|f| f.write(stock_gemfile) }
end